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