os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcig711decoderconfig.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 "teststepcig711decoderconfig.h"
19 TVerdict CTestStepCIG711DecoderConfig::DoTestStepL()
21 iTestStepResult = ETestSuiteError;
23 INFO_PRINTF1(_L("Initializing test CI device"));
25 if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0040-HP")) == 0)
27 iTestStepResult = DoTestStep0040L();
29 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0041-HP")) == 0)
31 iTestStepResult = DoTestStep0041L();
33 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0042-HP")) == 0)
35 iTestStepResult = DoTestStep0042L();
37 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0043-HP")) == 0)
39 iTestStepResult = DoTestStep0043L();
41 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0044-HP")) == 0)
43 iTestStepResult = DoTestStep0044L();
45 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0094-HP")) == 0)
47 iTestStepResult = DoTestStep0094L();
49 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0095-HP")) == 0)
51 iTestStepResult = DoTestStep0095L();
54 return iTestStepResult;
58 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0040L()
60 iTestStepResult = EFail;
62 INFO_PRINTF1(_L("G711DecoderIntfc - Instantiating"));
64 //Initialize - with the UID of our test HwDevice
65 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
66 TUid testUID = {KUidG711DecoderConfigTestDevice};
68 TFourCC testUID('T','0','1','5');
71 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
73 if (iTestStepResult != EPass)
75 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
79 // reset the value as previous test is pass
80 iTestStepResult = EFail;
82 // KUidG711DecoderIntfc
83 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
87 INFO_PRINTF1(_L("MG711DecoderIntfc instantiated successfully"));
89 iTestStepResult = EPass;
93 ERR_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
96 return iTestStepResult;
100 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0041L()
102 iTestStepResult = EFail;
103 TInt result = KErrGeneral;
105 INFO_PRINTF1(_L("G711DecoderIntfc - SetDecoderMode"));
107 //Initialize - with the UID of our test HwDevice
108 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
109 TUid testUID = {KUidG711DecoderConfigTestDevice};
111 TFourCC testUID('T','0','1','5');
114 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
116 if (iTestStepResult != EPass)
118 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
119 return EInconclusive;
122 // reset the value as previous test is pass
123 iTestStepResult = EFail;
125 // KUidG711DecoderIntfc
126 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
130 result = ptr->SetDecoderMode(MG711DecoderIntfc::EDecULaw); // call method
132 if (result == KErrNone)
134 INFO_PRINTF1(_L("MG711DecoderIntfc::SetDecoderMode finished successfully"));
136 iTestStepResult = EPass;
140 ERR_PRINTF2(_L("MG711DecoderIntfc::SetDecoderMode failed with error %d"), result);
145 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
146 iTestStepResult = EInconclusive;
149 return iTestStepResult;
153 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0094L()
155 iTestStepResult = EFail;
156 TInt result = KErrGeneral;
158 INFO_PRINTF1(_L("G711DecoderIntfc - GetDecoderMode"));
160 //Initialize - with the UID of our test HwDevice
161 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
162 TUid testUID = {KUidG711DecoderConfigTestDevice};
164 TFourCC testUID('T','0','1','5');
167 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
169 if (iTestStepResult != EPass)
171 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
172 return EInconclusive;
175 // reset the value as previous test is pass
176 iTestStepResult = EFail;
178 // KUidG711DecoderIntfc
179 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
183 MG711DecoderIntfc::TDecodeMode decodeMode = MG711DecoderIntfc::EDecULaw;
185 result = ptr->SetDecoderMode(MG711DecoderIntfc::EDecALaw);
187 if (result == KErrNone)
189 INFO_PRINTF1(_L("MG711DecoderIntfc::SetDecoderMode finished successfully"));
191 result = ptr->GetDecoderMode(decodeMode); // call method
193 if (MG711DecoderIntfc::EDecALaw == decodeMode)
195 INFO_PRINTF1(_L("MG711DecoderIntfc::GetDecoderMode finished successfully"));
197 iTestStepResult = EPass;
201 ERR_PRINTF3(_L("MG711DecoderIntfc::GetDecoderMode failed with result %d decodeMode %d"), result, decodeMode);
206 ERR_PRINTF2(_L("MG711DecoderIntfc::SetDecoderMode failed with error %d"), result);
211 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
212 iTestStepResult = EInconclusive;
215 return iTestStepResult;
219 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0042L()
221 iTestStepResult = EFail;
222 TInt result = KErrGeneral;
224 INFO_PRINTF1(_L("G711DecoderIntfc - SetComfortNoiseGeneration"));
226 //Initialize - with the UID of our test HwDevice
227 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
228 TUid testUID = {KUidG711DecoderConfigTestDevice};
230 TFourCC testUID('T','0','1','5');
233 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
235 if (iTestStepResult != EPass)
237 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
238 return EInconclusive;
241 // reset the value as previous test is pass
242 iTestStepResult = EFail;
244 // KUidG711DecoderIntfc
245 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
251 result = ptr->SetComfortNoiseGeneration(cng); // call method
253 if (result == KErrNone)
255 INFO_PRINTF1(_L("MG711DecoderIntfc::SetComfortNoiseGeneration finished successfully"));
257 result = ptr->GetComfortNoiseGeneration(cng);
259 if ( (result == KErrNone) && cng)
261 INFO_PRINTF1(_L("MG711DecoderIntfc::GetComfortNoiseGeneration finished successfully"));
263 result = ptr->SetComfortNoiseGeneration(EFalse);
265 if (result == KErrNone)
267 INFO_PRINTF1(_L("MG711DecoderIntfc::SetComfortNoiseGeneration finished successfully"));
269 result = ptr->GetComfortNoiseGeneration(cng);
271 if ( (result == KErrNone) && !cng)
273 INFO_PRINTF1(_L("MG711DecoderIntfc::GetComfortNoiseGeneration finished successfully"));
275 iTestStepResult = EPass;
279 ERR_PRINTF3(_L("MG711DecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng);
284 ERR_PRINTF2(_L("MG711DecoderIntfc::SetComfortNoiseGeneration failed with result %d"), result);
289 ERR_PRINTF3(_L("MG711DecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng);
294 ERR_PRINTF2(_L("MG711DecoderIntfc::SetComfortNoiseGeneration failed with result %d"), result);
299 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
300 iTestStepResult = EInconclusive;
303 return iTestStepResult;
307 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0043L()
309 iTestStepResult = EFail;
310 TInt result = KErrGeneral;
312 INFO_PRINTF1(_L("G711DecoderIntfc - GetComfortNoiseGeneration"));
314 //Initialize - with the UID of our test HwDevice
315 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
316 TUid testUID = {KUidG711DecoderConfigTestDevice};
318 TFourCC testUID('T','0','1','5');
321 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
323 if (iTestStepResult != EPass)
325 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
326 return EInconclusive;
329 // reset the value as previous test is pass
330 iTestStepResult = EFail;
332 // KUidG711DecoderIntfc
333 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
339 result = ptr->SetComfortNoiseGeneration(cng); // call method
341 if (result == KErrNone)
343 INFO_PRINTF1(_L("MG711DecoderIntfc::SetComfortNoiseGeneration finished successfully"));
345 result = ptr->GetComfortNoiseGeneration(cng);
347 if ( (result == KErrNone) && cng)
349 INFO_PRINTF1(_L("MG711DecoderIntfc::GetComfortNoiseGeneration finished successfully"));
351 iTestStepResult = EPass;
355 ERR_PRINTF3(_L("MG711DecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng);
360 ERR_PRINTF2(_L("MG711DecoderIntfc::GetComfortNoiseGeneration failed with result %d"), result);
365 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
366 iTestStepResult = EInconclusive;
369 return iTestStepResult;
373 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0044L()
375 iTestStepResult = EFail;
376 TInt result = KErrGeneral;
378 INFO_PRINTF1(_L("G711DecoderIntfc - SetPacketLossConcealment"));
380 //Initialize - with the UID of our test HwDevice
381 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
382 TUid testUID = {KUidG711DecoderConfigTestDevice};
384 TFourCC testUID('T','0','1','5');
387 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
389 if (iTestStepResult != EPass)
391 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
392 return EInconclusive;
395 // reset the value as previous test is pass
396 iTestStepResult = EFail;
398 // KUidG711DecoderIntfc
399 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
405 result = ptr->SetPacketLossConcealment(EFalse); // call method
407 if (result == KErrNone)
409 INFO_PRINTF1(_L("MG711DecoderIntfc::SetPacketLossConcealment finished successfully"));
411 result = ptr->GetPacketLossConcealment(plc);
413 if ( (result == KErrNone) && (EFalse == plc) )
415 INFO_PRINTF1(_L("MG711DecoderIntfc::GetPacketLossConcealment finished successfully"));
417 iTestStepResult = EPass;
421 ERR_PRINTF3(_L("MG711DecoderIntfc::GetPacketLossConcealment failed with result %d plc %d"), result, plc);
426 ERR_PRINTF2(_L("MG711DecoderIntfc::SetPacketLossConcealment failed with error %d"), result);
431 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
432 iTestStepResult = EInconclusive;
435 return iTestStepResult;
439 TVerdict CTestStepCIG711DecoderConfig::DoTestStep0095L()
441 iTestStepResult = EFail;
442 TInt result = KErrGeneral;
444 INFO_PRINTF1(_L("G711DecoderIntfc - GetPacketLossConcealment"));
446 //Initialize - with the UID of our test HwDevice
447 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
448 TUid testUID = {KUidG711DecoderConfigTestDevice};
450 TFourCC testUID('T','0','1','5');
453 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
455 if (iTestStepResult != EPass)
457 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
458 return EInconclusive;
461 // reset the value as previous test is pass
462 iTestStepResult = EFail;
464 // KUidG711DecoderIntfc
465 MG711DecoderIntfc* ptr = static_cast <MG711DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG711DecoderIntfc));
471 result = ptr->SetPacketLossConcealment(EFalse);
473 if (result == KErrNone)
475 INFO_PRINTF1(_L("MG711DecoderIntfc::SetPacketLossConcealment finished successfully"));
477 result = ptr->GetPacketLossConcealment(plc); // call method
479 if ( (result == KErrNone) && (EFalse == plc) )
481 INFO_PRINTF1(_L("MG711DecoderIntfc::GetPacketLossConcealment finished successfully"));
483 iTestStepResult = EPass;
487 ERR_PRINTF3(_L("MG711DecoderIntfc::GetPacketLossConcealment failed with result %d plc %d"), result, plc);
492 ERR_PRINTF2(_L("MG711DecoderIntfc::SetPacketLossConcealment failed with error %d"), result);
497 INFO_PRINTF1(_L("MG711DecoderIntfc failed to retrieve the interface"));
498 iTestStepResult = EInconclusive;
501 return iTestStepResult;