os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepciilbcencoderconfig.cpp
Update contrib.
1 // Copyright (c) 2007-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.
16 #include "teststepciilbcencoderconfig.h"
19 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStepL()
21 iTestStepResult = ETestSuiteError;
23 INFO_PRINTF1(_L("Initializing test CI device"));
25 if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0058-HP")) == 0)
27 iTestStepResult = DoTestStep0058L();
29 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0059-HP")) == 0)
31 iTestStepResult = DoTestStep0059L();
33 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0060-HP")) == 0)
35 iTestStepResult = DoTestStep0060L();
37 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0061-HP")) == 0)
39 iTestStepResult = DoTestStep0061L();
41 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0096-HP")) == 0)
43 iTestStepResult = DoTestStep0096L();
46 return iTestStepResult;
50 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0058L()
52 iTestStepResult = EFail;
54 INFO_PRINTF1(_L("IlbcEncoderIntfc - Instantiating"));
56 //Initialize - with the UID of our test HwDevice
57 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
58 TUid testUID = {KUidIlbcEncoderIntfcTestDevice};
60 TFourCC testUID('T','0','1','8');
63 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
65 if (iTestStepResult != EPass)
67 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
71 // reset the value as previous test is pass
72 iTestStepResult = EFail;
74 // KUidCustomInterfaceDevSoundIlbcEncoderConfig
75 MIlbcEncoderIntfc* ptr = static_cast <MIlbcEncoderIntfc*> (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc));
79 INFO_PRINTF1(_L("MIlbcEncoderIntfc instantiated successfully"));
81 iTestStepResult = EPass;
85 ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface"));
88 return iTestStepResult;
92 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0059L()
94 iTestStepResult = EFail;
95 TInt result = KErrGeneral;
97 INFO_PRINTF1(_L("IlbcEncoderIntfc - SetEncoderMode"));
99 //Initialize - with the UID of our test HwDevice
100 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
101 TUid testUID = {KUidIlbcEncoderIntfcTestDevice};
103 TFourCC testUID('T','0','1','8');
106 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
108 if (iTestStepResult != EPass)
110 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
111 return EInconclusive;
114 // reset the value as previous test is pass
115 iTestStepResult = EFail;
117 // KUidIlbcEncoderIntfc
118 MIlbcEncoderIntfc* ptr = static_cast <MIlbcEncoderIntfc*> (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc));
122 MIlbcEncoderIntfc::TEncodeMode encodeMode = MIlbcEncoderIntfc::E30msFrame;
124 result = ptr->SetEncoderMode(MIlbcEncoderIntfc::E20msFrame); // call method
126 if (result == KErrNone)
128 INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetEncoderMode finished successfully"));
130 result = ptr->GetEncoderMode(encodeMode);
132 if (MIlbcEncoderIntfc::E20msFrame == encodeMode)
134 INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetEncoderMode finished successfully"));
136 iTestStepResult = EPass;
140 ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetEncoderMode failed with result %d encodeMode %d"), result, encodeMode);
145 ERR_PRINTF2(_L("MIlbcEncoderIntfc::SetEncoderMode failed with result %d"), result);
150 ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface"));
151 iTestStepResult = EInconclusive;
154 return iTestStepResult;
158 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0096L()
160 iTestStepResult = EFail;
161 TInt result = KErrGeneral;
163 INFO_PRINTF1(_L("IlbcEncoderIntfc - GetEncoderMode"));
165 //Initialize - with the UID of our test HwDevice
166 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
167 TUid testUID = {KUidIlbcEncoderIntfcTestDevice};
169 TFourCC testUID('T','0','1','8');
172 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
174 if (iTestStepResult != EPass)
176 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
177 return EInconclusive;
180 // reset the value as previous test is pass
181 iTestStepResult = EFail;
183 // KUidIlbcEncoderIntfc
184 MIlbcEncoderIntfc* ptr = static_cast <MIlbcEncoderIntfc*> (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc));
188 MIlbcEncoderIntfc::TEncodeMode encodeMode = MIlbcEncoderIntfc::E20msFrame;
190 result = ptr->SetEncoderMode(MIlbcEncoderIntfc::E30msFrame);
192 if (result == KErrNone)
194 INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetEncoderMode finished successfully"));
196 result = ptr->GetEncoderMode(encodeMode); // call method
198 if (MIlbcEncoderIntfc::E30msFrame == encodeMode)
200 INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetEncoderMode finished successfully"));
202 iTestStepResult = EPass;
206 ERR_PRINTF2(_L("MIlbcEncoderIntfc::GetEncoderMode failed with encodeMode %d"), encodeMode);
211 ERR_PRINTF2(_L("MIlbcEncoderIntfc::SetEncoderMode failed with result %d"), result);
216 ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface"));
217 iTestStepResult = EInconclusive;
220 return iTestStepResult;
224 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0060L()
226 iTestStepResult = EFail;
227 TInt result = KErrGeneral;
229 INFO_PRINTF1(_L("IlbcEncoderIntfc - SetVadMode"));
231 //Initialize - with the UID of our test HwDevice
232 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
233 TUid testUID = {KUidIlbcEncoderIntfcTestDevice};
235 TFourCC testUID('T','0','1','8');
238 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
240 if (iTestStepResult != EPass)
242 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
243 return EInconclusive;
246 // reset the value as previous test is pass
247 iTestStepResult = EFail;
249 // KUidIlbcEncoderIntfc
250 MIlbcEncoderIntfc* ptr = static_cast <MIlbcEncoderIntfc*> (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc));
254 TBool vadModeOn = EFalse;
256 result = ptr->SetVadMode(ETrue); // call method
258 if (result == KErrNone)
260 INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully"));
262 result = ptr->GetVadMode(vadModeOn);
264 if ( (result == KErrNone) && vadModeOn)
266 INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully"));
268 iTestStepResult = EPass;
272 ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
277 ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
282 INFO_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface"));
283 iTestStepResult = EInconclusive;
286 return iTestStepResult;
290 TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0061L()
292 iTestStepResult = EFail;
293 TInt result = KErrGeneral;
295 INFO_PRINTF1(_L("IlbcEncoderIntfc - GetVadMode"));
297 //Initialize - with the UID of our test HwDevice
298 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
299 TUid testUID = {KUidIlbcEncoderIntfcTestDevice};
301 TFourCC testUID('T','0','1','8');
304 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
306 if (iTestStepResult != EPass)
308 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
309 return EInconclusive;
312 // reset the value as previous test is pass
313 iTestStepResult = EFail;
315 // KUidIlbcEncoderIntfc
316 MIlbcEncoderIntfc* ptr = static_cast <MIlbcEncoderIntfc*> (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc));
320 TBool vadModeOn = EFalse;
322 result = ptr->SetVadMode(ETrue); // call method
324 if (result == KErrNone)
326 INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully"));
328 result = ptr->GetVadMode(vadModeOn);
330 if ( (result == KErrNone) && vadModeOn)
332 INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully"));
334 result = ptr->SetVadMode(EFalse);
336 if (result == KErrNone)
338 INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully"));
340 result = ptr->GetVadMode(vadModeOn);
342 if ( (result == KErrNone) && !vadModeOn)
344 INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully"));
346 iTestStepResult = EPass;
350 ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
355 ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
360 ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
365 ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn);
370 INFO_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface"));
371 iTestStepResult = EInconclusive;
374 return iTestStepResult;