123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #include "PipeTestFixture.h"
- extern Logger g_Logger;
- Pipe PipeTestFixture::m_IpaToUsbPipe(IPA_CLIENT_TEST_CONS, IPA_TEST_CONFIFURATION_1);
- Pipe PipeTestFixture::m_UsbToIpaPipe(IPA_CLIENT_TEST_PROD, IPA_TEST_CONFIFURATION_1);
- PipeTestFixture::PipeTestFixture()
- {
- m_testSuiteName.push_back("Pipes");
- Register(*this);
- }
- static int SetupKernelModule(void)
- {
- int retval;
- struct ipa_channel_config from_ipa_0 = {0};
- struct test_ipa_ep_cfg from_ipa_0_cfg;
- struct ipa_channel_config to_ipa_0 = {0};
- struct test_ipa_ep_cfg to_ipa_0_cfg;
- struct ipa_test_config_header header = {0};
- struct ipa_channel_config *to_ipa_array[1];
- struct ipa_channel_config *from_ipa_array[1];
-
- memset(&from_ipa_0_cfg, 0 , sizeof(from_ipa_0_cfg));
- prepare_channel_struct(&from_ipa_0,
- header.from_ipa_channels_num++,
- IPA_CLIENT_TEST_CONS,
- (void *)&from_ipa_0_cfg,
- sizeof(from_ipa_0_cfg));
- from_ipa_array[0] = &from_ipa_0;
-
- memset(&to_ipa_0_cfg, 0 , sizeof(to_ipa_0_cfg));
- to_ipa_0_cfg.mode.mode = IPA_DMA;
- to_ipa_0_cfg.mode.dst = IPA_CLIENT_TEST_CONS;
- prepare_channel_struct(&to_ipa_0,
- header.to_ipa_channels_num++,
- IPA_CLIENT_TEST_PROD,
- (void *)&to_ipa_0_cfg,
- sizeof(to_ipa_0_cfg));
- to_ipa_array[0] = &to_ipa_0;
- prepare_header_struct(&header, from_ipa_array, to_ipa_array);
- retval = GenericConfigureScenario(&header);
- return retval;
- }
- bool PipeTestFixture::Setup()
- {
- bool bRetVal = true;
- if (SetupKernelModule() == false)
- return false;
-
- bRetVal &= m_IpaToUsbPipe.Init();
- bRetVal &= m_UsbToIpaPipe.Init();
- return bRetVal;
- }
- bool PipeTestFixture::Teardown()
- {
-
- m_IpaToUsbPipe.Destroy();
- m_UsbToIpaPipe.Destroy();
- return true;
- }
|