Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // TSU_MMF_SwCodecDevicesSuite.cpp
15 // This main DLL entry point for the TSU_MMF_SWCODECDEVICES.dll
22 // Test system includes
23 #include "TSU_MMF_DeviceSuite.h"
24 #include "TSU_MMF_SWCODECDEVICES.h"
25 #include "tsu_mmf_CodecTests.h"
26 #include "TSU_MMF_SignConversionCodecs.h"
27 #include "TSU_MMF_Loop.h"
28 #include "TSU_MMF_Oom.h"
29 //[ actual codec includes ]
30 #include "MmfPcm16toAlawhwDevice.h"
31 #include "MmfALawToPcm16HwDevice.h"
33 #include "MmfImaAdpcmtopcm16hwdevice.h"
34 #include "MmfMuLawToPcm16hwDevice.h"
35 #include "mmfpcm16SwapEndianhwdevice.h"
36 #include "mmfpcm16ToImaAdpcm.h"
37 #include "mmfpcm16toMulawhwdevice.h"
38 #include "mmfpcm16topcmU16BEHwDevice.h"
39 #include "MMFpcm16ToPcmU8HwDevice.h"
40 #include "MMFpcm16ToPcmU8HwDevice.h"
41 #include "mmfpcmS16PcmS8HwDevice.h"
42 #include "mmfpcmS16topcmU16Codec.h"
43 #include "mmfpcmS8ToPcmS16HwDevice.h"
44 #include "mmfpcmU16BeToPcmS16HwDevice.h"
45 #include "mmfpcmU16TopcmS16HwDevice.h"
46 #include "MMFpcmU8ToPcm16HwDevice.h"
50 * NewTestSuite is exported at ordinal 1
51 * this provides the interface to allow schedule test
52 * to create instances of this test suite
54 EXPORT_C CTestSuite_MMF_SwCodecDevices* NewTestSuiteL()
56 CTestSuite_MMF_SwCodecDevices* result = new (ELeave) CTestSuite_MMF_SwCodecDevices;
57 CleanupStack::PushL(result);
59 CleanupStack::Pop(1, result); // result
64 CTestSuite_MMF_SwCodecDevices::~CTestSuite_MMF_SwCodecDevices()
68 //Get Test Suite version
69 _LIT(KTxtVersion,"0.1");
70 TPtrC CTestSuite_MMF_SwCodecDevices::GetVersion( void )
77 * Add a test step into the suite
78 * @param "CTestStep_MMF_SwCodecDevices* aPtrTestStep"
81 void CTestSuite_MMF_SwCodecDevices::AddTestStepL( CTestStep_MMF_SwCodecDevices* aPtrTestStep )
83 // test steps contain a pointer back to the suite which owns them
84 aPtrTestStep->SetSuite(this);
85 // add the step using tyhe base class method
86 CTestSuite::AddTestStepL(aPtrTestStep);
90 * Constructor for test suite
91 * this creates all the test steps and
92 * stores them inside CTestSuite_MMF_SWCODECDEVICES
94 void CTestSuite_MMF_SwCodecDevices::InitialiseL( void )
96 // store the name of this test suite
98 iSuiteName = _L("TSU_MMF_SWCODECDEVICES");
100 AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0001() );
101 AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0002() );
102 AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0003() );
103 AddTestStepL( new(ELeave) CTestALawCodec_U_0004());
104 AddTestStepL( new(ELeave) CTestMuLawCodec_U_0006());
106 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16SwapEndianCodec,TComparator,0,1,1>(0));
107 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToImaAdpcmCodec,TComparator>(1) );
108 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFImaAdpcmToPcm16Codec,TDbComparator<>,0,0,1>(2));
109 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToPcmU8Codec,TComparator>(3));
110 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcmU8ToPcm16Codec,TDbComparator<>,0,0,1>(4));
111 AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToPcmU8Codec,TComparator>(5));
113 AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16ToPcmU8Codec,CMMFPcm16ToPcmU8Generator,0>());
114 AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm8ToPcm16Codec,CMMFPcm8ToPcm16Generator,1>());
115 AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16SwapEndianCodec,CMMFPcmU16toPcmU16BGenerator,2>());
116 AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16SwapEndianCodec,CMMFPcmU16BtoPcmU16Generator,3>());
117 AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcmU8ToPcm16Codec,CMMFPcmU8ToPcm16Generator,4>());
119 AddTestStepL( new(ELeave) CTestIMaadCodec());
121 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToALawCodec>(0));
122 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFAlawToPcm16Codec>(1));
123 AddTestStepL( new(ELeave) CTestStepGsm610ToPcm16OomTest(2));
124 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFImaAdpcmToPcm16Codec>(3));
125 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFMulawToPcm16Codec>(4));
126 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16SwapEndianCodec>(5));
127 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToImaAdpcmCodec>(6));
128 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToMuLawCodec>(7));
129 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16BECodec>(8));
130 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU8Codec>(9));
131 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcmS16ToPcmS8Codec>(10));
132 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16CodecCodec>(11));
133 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm8ToPcm16Codec>(12));
134 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcmU16BeToPcmS16Codec>(13));
135 AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16CodecCodec>(14));
136 AddTestStepL( new(ELeave) CTestStepPcm16ToGsm610OomTest(15));
138 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToALawCodec>(0));
139 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFAlawToPcm16Codec>(1));
140 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFGsm610ToPcm16Codec>(2));
141 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFImaAdpcmToPcm16Codec>(3));
142 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFMulawToPcm16Codec>(4));
143 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16SwapEndianCodec>(5));
144 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToImaAdpcmCodec>(6));
145 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToMuLawCodec>(7));
146 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16BECodec>(8));
147 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU8Codec>(9));
148 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcmS16ToPcmS8Codec>(10));
149 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16CodecCodec>(11));
150 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm8ToPcm16Codec>(12));
151 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcmU16BeToPcmS16Codec>(13));
152 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16CodecCodec>(14));
153 AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToGsm610Codec>(15));
160 * This sets up the default path
163 void CTestSuite_MMF_SwCodecDevices::InitSystemPath()
165 _LIT(KAudioStremOutSourcePathOnC,"c:\\mm\\mmf\\testfiles\\SwCodecDevices\\");
169 TInt ret = fs.Connect();
170 __ASSERT_ALWAYS(ret == KErrNone,User::Panic(_L("Sys path not setup"),ret));
172 if (fs.Att(KAudioStremOutSourcePathOnC, att) == KErrNone)
173 iDefaultPath = KAudioStremOutSourcePathOnC;
175 User::Panic(_L("Test files not found"),KErrNotFound);
180 const TDesC& CTestSuite_MMF_SwCodecDevices::DefaultPath() const