os/mm/devsound/a3fcharacterisationtest/src/char_a3f_devsound_initializationtest.cpp
Update contrib.
1 // Copyright (c) 2008-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.
17 #include "char_a3f_devsound_initializationtest.h"
20 *========================================================================================================
21 * MM-A3F-DEVSOUND-CHRTZ-INIT-0001
23 RA3FDevSoundToneInitializationTest::RA3FDevSoundToneInitializationTest(const TDesC& aTestName)
24 : RA3FDevSoundTestBase(aTestName)
28 RA3FDevSoundToneInitializationTest* RA3FDevSoundToneInitializationTest::NewL(const TDesC& aTestName)
30 RA3FDevSoundToneInitializationTest* self = new (ELeave) RA3FDevSoundToneInitializationTest(aTestName);
34 void RA3FDevSoundToneInitializationTest::DoKickoffTestL()
38 void RA3FDevSoundToneInitializationTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
40 switch(iDevSoundState)
44 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializationTest"),EFsmIncorrectErrorPassed));
45 if(aDevSoundEvent == EEventInitialize)
47 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
48 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
51 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
55 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
56 iDevSoundState = EStateInitializing;
60 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
61 StopTest(aError, EFail);
65 case EStateInitializing:
67 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
69 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
72 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
74 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
79 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
80 StopTest(aError, EFail);
86 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
87 StopTest(aError, EFail);
93 *========================================================================================================
94 * MM-A3F-DEVSOUND-CHRTZ-INIT-0002
96 RA3FDevSoundToneCancelInitializeTest::RA3FDevSoundToneCancelInitializeTest(const TDesC& aTestName)
97 : RA3FDevSoundTestBase(aTestName),iInitCompleteReceived(EFalse),
98 iSampleRate(0), iChannels(0)
102 RA3FDevSoundToneCancelInitializeTest* RA3FDevSoundToneCancelInitializeTest::NewL(const TDesC& aTestName)
104 RA3FDevSoundToneCancelInitializeTest* self = new (ELeave) RA3FDevSoundToneCancelInitializeTest(aTestName);
108 void RA3FDevSoundToneCancelInitializeTest::DoKickoffTestL()
110 if (!GetIntFromConfig(iTestStepName, KSampleRate, iSampleRate))
112 ERR_PRINTF2(KMsgErrorGetParameter, &KSampleRate);
113 StopTest(KErrNotFound);
116 if (!GetIntFromConfig(iTestStepName, KChannel, iChannels))
118 ERR_PRINTF2(KMsgErrorGetParameter, &KChannel);
119 StopTest(KErrNotFound);
122 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
125 void RA3FDevSoundToneCancelInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
127 switch(iDevSoundState)
131 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneCancelInitializeTest"),EFsmIncorrectErrorPassed));
132 if(aDevSoundEvent == EEventInitialize)
134 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
135 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
138 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
142 StartTimer(KMicroSecsTwoSec);
143 INFO_PRINTF1(_L("Calling CMMFDevSound::CancelInitialize"));
144 err = iMMFDevSound->CancelInitialize();
147 ERR_PRINTF2(_L("Unexpected error on CancelInitialize = %d"), err);
150 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
151 iDevSoundState = EStateInitializing;
155 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
156 StopTest(aError, EFail);
160 case EStateInitializing:
162 if(aDevSoundEvent == EEventInitComplete)
164 iInitCompleteReceived = ETrue;
170 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
171 StopTest(aError, EFail);
175 void RA3FDevSoundToneCancelInitializeTest::DoTimerCallback()
177 if(!iInitCompleteReceived)
179 INFO_PRINTF1(_L("Waiting for InitializeComplete event"));
180 iInitCompleteReceived = ETrue;
185 TMMFCapabilities capabilitiesSet;
186 TBuf<KMaxSampleRateStringLength> stringSampleRateSet;
187 TBuf<KMaxChannelsStringLength> stringChannelsSet;
188 SampleRateFromTIntToTMMFSampleRate (iSampleRate, iESampleRate);
189 capabilitiesSet.iRate = iESampleRate;
190 capabilitiesSet.iChannels = iChannels;
191 SampleRateFromTUintToString (capabilitiesSet.iRate, stringSampleRateSet);
192 ChannelsFromTUintToString (capabilitiesSet.iChannels, stringChannelsSet);
193 INFO_PRINTF3(_L("Settings for Sample rate an channel mode. %S %S"), &stringSampleRateSet, &stringChannelsSet);
194 INFO_PRINTF1(_L("Calling CMMFDevSound::SetConfigL"));
195 TRAPD(err, iMMFDevSound->SetConfigL(capabilitiesSet));
196 if (err == KErrNotReady)
198 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with the expected error = %d"), err);
203 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with error = %d"), err);
204 ERR_PRINTF2(_L("Expected error value = %d"), KErrNotReady);
205 StopTest(err, EFail);
210 void RA3FDevSoundToneCancelInitializeTest::InitializeComplete(TInt aError)
212 ERR_PRINTF1(_L("DevSound called InitializeComplete after calling CMMFDevSound::CancelInitialize"));
213 StopTest(aError, EFail);
218 *========================================================================================================
219 * MM-A3F-DEVSOUND-CHRTZ-INIT-0003
221 RA3FDevSoundToneInitializeToPlayTonesTwiceTest::RA3FDevSoundToneInitializeToPlayTonesTwiceTest(const TDesC& aTestName)
222 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
226 RA3FDevSoundToneInitializeToPlayTonesTwiceTest* RA3FDevSoundToneInitializeToPlayTonesTwiceTest::NewL(const TDesC& aTestName)
228 RA3FDevSoundToneInitializeToPlayTonesTwiceTest* self = new (ELeave) RA3FDevSoundToneInitializeToPlayTonesTwiceTest(aTestName);
232 void RA3FDevSoundToneInitializeToPlayTonesTwiceTest::DoKickoffTestL()
236 void RA3FDevSoundToneInitializeToPlayTonesTwiceTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
238 switch(iDevSoundState)
242 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializeTwiceToPlayTonesTest"),EFsmIncorrectErrorPassed));
243 if(aDevSoundEvent == EEventInitialize)
245 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
246 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
249 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
253 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
254 iDevSoundState = EStateInitializing;
258 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
259 StopTest(aError, EFail);
263 case EStateInitializing:
265 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
269 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
270 iReinitialized = ETrue;
271 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
272 TRAPD(err, iMMFDevSound->InitializeL(*this,EMMFStateTonePlaying));
278 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
279 iDevSoundState = EStateInitializing;
283 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
287 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
289 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
294 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
295 StopTest(aError, EFail);
301 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
302 StopTest(aError, EFail);
308 *========================================================================================================
309 * MM-A3F-DEVSOUND-CHRTZ-INIT-0004
311 RA3FDevSoundToneInitializeToPlayTonesThenAudioTest::RA3FDevSoundToneInitializeToPlayTonesThenAudioTest(const TDesC& aTestName)
312 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
316 RA3FDevSoundToneInitializeToPlayTonesThenAudioTest* RA3FDevSoundToneInitializeToPlayTonesThenAudioTest::NewL(const TDesC& aTestName)
318 RA3FDevSoundToneInitializeToPlayTonesThenAudioTest* self = new (ELeave) RA3FDevSoundToneInitializeToPlayTonesThenAudioTest(aTestName);
322 void RA3FDevSoundToneInitializeToPlayTonesThenAudioTest::DoKickoffTestL()
326 void RA3FDevSoundToneInitializeToPlayTonesThenAudioTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
328 switch(iDevSoundState)
332 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializeToPlayTonesThenAudioTest"),EFsmIncorrectErrorPassed));
333 if(aDevSoundEvent == EEventInitialize)
335 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
336 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
339 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
343 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
344 iDevSoundState = EStateInitializing;
348 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
349 StopTest(aError, EFail);
353 case EStateInitializing:
355 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
359 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
360 iReinitialized = ETrue;
361 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
362 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStatePlaying));
368 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
369 iDevSoundState = EStateInitializing;
373 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
377 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
379 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
384 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
385 StopTest(aError, EFail);
391 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
392 StopTest(aError, EFail);
398 *========================================================================================================
399 * MM-A3F-DEVSOUND-CHRTZ-INIT-0005
401 RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest::RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest(const TDesC& aTestName)
402 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
406 RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest* RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest::NewL(const TDesC& aTestName)
408 RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest* self = new (ELeave) RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest(aTestName);
412 void RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest::DoKickoffTestL()
416 void RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
418 switch(iDevSoundState)
422 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializeToPlayTonesThenRecordAudioTest"),EFsmIncorrectErrorPassed));
423 if(aDevSoundEvent == EEventInitialize)
425 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
426 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
429 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
433 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
434 iDevSoundState = EStateInitializing;
438 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
439 StopTest(aError, EFail);
443 case EStateInitializing:
445 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
449 INFO_PRINTF1(_L("========== First initialization successfully completed=========="));
450 iReinitialized = ETrue;
451 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
452 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateRecording));
458 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
459 iDevSoundState = EStateInitializing;
463 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
467 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
469 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
474 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
475 StopTest(aError, EFail);
481 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
482 StopTest(aError, EFail);
488 *========================================================================================================
489 * MM-A3F-DEVSOUND-CHRTZ-INIT-0006
491 RA3FDevSoundToneInitializeTFourCCTest::RA3FDevSoundToneInitializeTFourCCTest(const TDesC& aTestName)
492 : RA3FDevSoundTestBase(aTestName)
496 RA3FDevSoundToneInitializeTFourCCTest* RA3FDevSoundToneInitializeTFourCCTest::NewL(const TDesC& aTestName)
498 RA3FDevSoundToneInitializeTFourCCTest* self = new (ELeave) RA3FDevSoundToneInitializeTFourCCTest(aTestName);
502 void RA3FDevSoundToneInitializeTFourCCTest::DoKickoffTestL()
505 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
507 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
508 StopTest(KErrNotFound);
511 EncodingFromStringToTFourCC(fourccCode);
514 void RA3FDevSoundToneInitializeTFourCCTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
516 switch(iDevSoundState)
520 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializeTFourCCTest"),EFsmIncorrectErrorPassed));
521 if(aDevSoundEvent == EEventInitialize)
523 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
524 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateTonePlaying));
525 if(err == KErrNotSupported)
527 ERR_PRINTF2(_L("Calling CMMFDevSound::InitializeL to play tones using a FourCC code left with expected error = %d"), err);
528 StopTest(err, EPass);
533 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
534 INFO_PRINTF2(_L("Expected error = %d"), KErrNotSupported);
535 StopTest(err, EFail);
541 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
542 StopTest(aError, EFail);
548 *========================================================================================================
549 * MM-A3F-DEVSOUND-CHRTZ-INIT-0007
551 RA3FDevSoundInitializeInvalidModeTest::RA3FDevSoundInitializeInvalidModeTest(const TDesC& aTestName)
552 : RA3FDevSoundTestBase(aTestName)
556 RA3FDevSoundInitializeInvalidModeTest* RA3FDevSoundInitializeInvalidModeTest::NewL(const TDesC& aTestName)
558 RA3FDevSoundInitializeInvalidModeTest* self = new (ELeave) RA3FDevSoundInitializeInvalidModeTest(aTestName);
562 void RA3FDevSoundInitializeInvalidModeTest::DoKickoffTestL()
566 void RA3FDevSoundInitializeInvalidModeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
568 switch(iDevSoundState)
572 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundInitializeInvalidModeTest"),EFsmIncorrectErrorPassed));
573 if(aDevSoundEvent == EEventInitialize)
575 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
576 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateConverting));
577 if(err == KErrNotSupported)
579 ERR_PRINTF2(_L("Calling CMMFDevSound::InitializeL using an invalid TMMFState argument left with expected error code = %d"), err);
580 StopTest(err, EPass);
585 INFO_PRINTF2(_L("Calling CMMFDevSound::InitializeL using an invalid TMMFState argument left with unexpected error code = %d"), err);
586 INFO_PRINTF2(_L("Expected error = %d"), KErrNotSupported);
587 StopTest(err, EFail);
593 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
594 StopTest(aError, EFail);
601 *========================================================================================================
602 * MM-A3F-DEVSOUND-CHRTZ-INIT-0008
604 RA3FDevSoundPlayInitializationTest::RA3FDevSoundPlayInitializationTest(const TDesC& aTestName)
605 : RA3FDevSoundTestBase(aTestName)
609 RA3FDevSoundPlayInitializationTest* RA3FDevSoundPlayInitializationTest::NewL(const TDesC& aTestName)
611 RA3FDevSoundPlayInitializationTest* self = new (ELeave) RA3FDevSoundPlayInitializationTest(aTestName);
615 void RA3FDevSoundPlayInitializationTest::DoKickoffTestL()
618 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
620 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
621 StopTest(KErrNotFound);
624 EncodingFromStringToTFourCC(fourccCode);
627 void RA3FDevSoundPlayInitializationTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
629 switch(iDevSoundState)
633 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializationTest"),EFsmIncorrectErrorPassed));
634 if(aDevSoundEvent == EEventInitialize)
636 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
637 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
640 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
644 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
645 iDevSoundState = EStateInitializing;
649 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
650 StopTest(aError, EFail);
654 case EStateInitializing:
656 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
658 INFO_PRINTF1(_L("CMMFDevSound::InitializeL succeeded"));
661 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
663 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
668 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
669 StopTest(aError, EFail);
675 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
676 StopTest(aError, EFail);
682 *========================================================================================================
683 * MM-A3F-DEVSOUND-CHRTZ-INIT-0009
685 RA3FDevSoundPlayCancelInitializeTest::RA3FDevSoundPlayCancelInitializeTest(const TDesC& aTestName)
686 : RA3FDevSoundTestBase(aTestName),iInitCompleteReceived(EFalse),
687 iSampleRate(0), iChannels(0)
691 RA3FDevSoundPlayCancelInitializeTest* RA3FDevSoundPlayCancelInitializeTest::NewL(const TDesC& aTestName)
693 RA3FDevSoundPlayCancelInitializeTest* self = new (ELeave) RA3FDevSoundPlayCancelInitializeTest(aTestName);
697 void RA3FDevSoundPlayCancelInitializeTest::DoKickoffTestL()
699 if (!GetIntFromConfig(iTestStepName, KSampleRate, iSampleRate))
701 ERR_PRINTF2(KMsgErrorGetParameter, &KSampleRate);
702 StopTest(KErrNotFound);
705 if (!GetIntFromConfig(iTestStepName, KChannel, iChannels))
707 ERR_PRINTF2(KMsgErrorGetParameter, &KChannel);
708 StopTest(KErrNotFound);
712 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
714 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
715 StopTest(KErrNotFound);
718 EncodingFromStringToTFourCC(fourccCode);
719 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
722 void RA3FDevSoundPlayCancelInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
724 switch(iDevSoundState)
728 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayCancelInitializeTest"),EFsmIncorrectErrorPassed));
729 if(aDevSoundEvent == EEventInitialize)
731 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
732 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
735 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
739 StartTimer(KMicroSecsTwoSec);
740 INFO_PRINTF1(_L("Calling CMMFDevSound::CancelInitialize"));
741 err = iMMFDevSound->CancelInitialize();
744 ERR_PRINTF2(_L("Unexpected error on CancelInitialize = %d"), err);
747 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
748 iDevSoundState = EStateInitializing;
752 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
753 StopTest(aError, EFail);
757 case EStateInitializing:
759 if(aDevSoundEvent == EEventInitComplete)
761 iInitCompleteReceived = ETrue;
767 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
768 StopTest(aError, EFail);
773 void RA3FDevSoundPlayCancelInitializeTest::DoTimerCallback()
775 if(!iInitCompleteReceived)
777 INFO_PRINTF1(_L("Waiting for InitializeComplete event"));
778 iInitCompleteReceived = ETrue;
783 TMMFCapabilities capabilitiesSet;
784 TBuf<KMaxSampleRateStringLength> stringSampleRateSet;
785 TBuf<KMaxChannelsStringLength> stringChannelsSet;
786 SampleRateFromTIntToTMMFSampleRate (iSampleRate, iESampleRate);
787 capabilitiesSet.iRate = iESampleRate;
788 capabilitiesSet.iChannels = iChannels;
789 SampleRateFromTUintToString (capabilitiesSet.iRate, stringSampleRateSet);
790 ChannelsFromTUintToString (capabilitiesSet.iChannels, stringChannelsSet);
791 INFO_PRINTF3(_L("Settings for Sample rate an channel mode. %S %S"), &stringSampleRateSet, &stringChannelsSet);
792 INFO_PRINTF1(_L("Calling CMMFDevSound::SetConfigL"));
793 TRAPD(err, iMMFDevSound->SetConfigL(capabilitiesSet));
794 if (err == KErrNotReady)
796 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with the expected error = %d"), err);
801 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with error = %d"), err);
802 ERR_PRINTF2(_L("Expected error value = %d"), KErrNotReady);
803 StopTest(err, EFail);
808 void RA3FDevSoundPlayCancelInitializeTest::InitializeComplete(TInt aError)
810 ERR_PRINTF1(_L("DevSound called InitializeComplete after calling CMMFDevSound::CancelInitialize"));
811 StopTest(aError, EFail);
816 *========================================================================================================
817 * MM-A3F-DEVSOUND-CHRTZ-INIT-0010
819 RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest::RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest(const TDesC& aTestName)
820 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
824 RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest* RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest::NewL(const TDesC& aTestName)
826 RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest* self = new (ELeave) RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest(aTestName);
830 void RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest::DoKickoffTestL()
833 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
835 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
836 StopTest(KErrNotFound);
839 EncodingFromStringToTFourCC(fourccCode);
842 void RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
844 switch(iDevSoundState)
848 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializeToPlayAudioThenTonesTest"),EFsmIncorrectErrorPassed));
849 if(aDevSoundEvent == EEventInitialize)
851 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
852 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
855 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
859 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
860 iDevSoundState = EStateInitializing;
864 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
865 StopTest(aError, EFail);
869 case EStateInitializing:
871 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
875 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
876 iReinitialized = ETrue;
877 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
878 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
884 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
885 iDevSoundState = EStateInitializing;
889 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
893 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
895 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
900 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
901 StopTest(aError, EFail);
907 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
908 StopTest(aError, EFail);
914 *========================================================================================================
915 * MM-A3F-DEVSOUND-CHRTZ-INIT-0011
917 RA3FDevSoundPlayInitializeToPlayAudioTwiceTest::RA3FDevSoundPlayInitializeToPlayAudioTwiceTest(const TDesC& aTestName)
918 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
922 RA3FDevSoundPlayInitializeToPlayAudioTwiceTest* RA3FDevSoundPlayInitializeToPlayAudioTwiceTest::NewL(const TDesC& aTestName)
924 RA3FDevSoundPlayInitializeToPlayAudioTwiceTest* self = new (ELeave) RA3FDevSoundPlayInitializeToPlayAudioTwiceTest(aTestName);
928 void RA3FDevSoundPlayInitializeToPlayAudioTwiceTest::DoKickoffTestL()
931 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
933 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
934 StopTest(KErrNotFound);
937 EncodingFromStringToTFourCC(fourccCode);
940 void RA3FDevSoundPlayInitializeToPlayAudioTwiceTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
942 switch(iDevSoundState)
946 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializeTwiceToPlayAudioTest"),EFsmIncorrectErrorPassed));
947 if(aDevSoundEvent == EEventInitialize)
949 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
950 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
953 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
957 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
958 iDevSoundState = EStateInitializing;
962 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
963 StopTest(aError, EFail);
967 case EStateInitializing:
969 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
973 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
974 iReinitialized = ETrue;
975 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
976 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
982 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
983 iDevSoundState = EStateInitializing;
987 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
991 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
993 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
998 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
999 StopTest(aError, EFail);
1005 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1006 StopTest(aError, EFail);
1013 *========================================================================================================
1014 * MM-A3F-DEVSOUND-CHRTZ-INIT-0012
1016 RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest::RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest(const TDesC& aTestName)
1017 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
1021 RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest* RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest::NewL(const TDesC& aTestName)
1023 RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest* self = new (ELeave) RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest(aTestName);
1027 void RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest::DoKickoffTestL()
1030 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1032 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1033 StopTest(KErrNotFound);
1036 EncodingFromStringToTFourCC(fourccCode);
1039 void RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1041 switch(iDevSoundState)
1045 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializeToPlayAudioThenRecordTest"),EFsmIncorrectErrorPassed));
1046 if(aDevSoundEvent == EEventInitialize)
1048 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1049 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
1052 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1056 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1057 iDevSoundState = EStateInitializing;
1061 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1062 StopTest(aError, EFail);
1066 case EStateInitializing:
1068 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1072 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
1073 iReinitialized = ETrue;
1074 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
1075 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1081 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1082 iDevSoundState = EStateInitializing;
1086 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
1090 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1092 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1097 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1098 StopTest(aError, EFail);
1104 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1105 StopTest(aError, EFail);
1111 *========================================================================================================
1112 * MM-A3F-DEVSOUND-CHRTZ-INIT-0013
1114 RA3FDevSoundPlayInitializeInvalidTFourCCTest::RA3FDevSoundPlayInitializeInvalidTFourCCTest(const TDesC& aTestName)
1115 : RA3FDevSoundTestBase(aTestName)
1119 RA3FDevSoundPlayInitializeInvalidTFourCCTest* RA3FDevSoundPlayInitializeInvalidTFourCCTest::NewL(const TDesC& aTestName)
1121 RA3FDevSoundPlayInitializeInvalidTFourCCTest* self = new (ELeave) RA3FDevSoundPlayInitializeInvalidTFourCCTest(aTestName);
1125 void RA3FDevSoundPlayInitializeInvalidTFourCCTest::DoKickoffTestL()
1129 void RA3FDevSoundPlayInitializeInvalidTFourCCTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1131 switch(iDevSoundState)
1135 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializeInvalidTFourCCTest"),EFsmIncorrectErrorPassed));
1136 if(aDevSoundEvent == EEventInitialize)
1138 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1139 TRAPD(err, iMMFDevSound->InitializeL(*this, 0x00000000, EMMFStatePlaying));
1140 if(err == KErrNotSupported)
1142 INFO_PRINTF2(_L("Calling CMMFDevSound::InitializeL using an invalid TFourCC argument left with expected error = %d"), err);
1143 StopTest(err, EPass);
1148 ERR_PRINTF2(_L("Calling CMMFDevSound::InitializeL using an invalid TFourCC argument left with expected error = %d"), err);
1149 ERR_PRINTF2(_L("Expected error = %d"), KErrNotSupported);
1150 StopTest(err, EFail);
1157 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1158 StopTest(aError, EFail);
1164 *========================================================================================================
1165 * MM-A3F-DEVSOUND-CHRTZ-INIT-0014
1167 RA3FDevSoundRecordInitializationTest::RA3FDevSoundRecordInitializationTest(const TDesC& aTestName)
1168 : RA3FDevSoundTestBase(aTestName)
1172 RA3FDevSoundRecordInitializationTest* RA3FDevSoundRecordInitializationTest::NewL(const TDesC& aTestName)
1174 RA3FDevSoundRecordInitializationTest* self = new (ELeave) RA3FDevSoundRecordInitializationTest(aTestName);
1178 void RA3FDevSoundRecordInitializationTest::DoKickoffTestL()
1181 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1183 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1184 StopTest(KErrNotFound);
1187 EncodingFromStringToTFourCC(fourccCode);
1190 void RA3FDevSoundRecordInitializationTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1192 switch(iDevSoundState)
1196 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitializationTest"),EFsmIncorrectErrorPassed));
1197 if(aDevSoundEvent == EEventInitialize)
1199 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1200 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1203 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1207 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1208 iDevSoundState = EStateInitializing;
1212 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1213 StopTest(aError, EFail);
1217 case EStateInitializing:
1219 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1221 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
1224 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1226 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1231 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1232 StopTest(aError, EFail);
1238 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1239 StopTest(aError, EFail);
1245 *========================================================================================================
1246 * MM-A3F-DEVSOUND-CHRTZ-INIT-0015
1248 RA3FDevSoundRecordCancelInitializeTest::RA3FDevSoundRecordCancelInitializeTest(const TDesC& aTestName)
1249 : RA3FDevSoundTestBase(aTestName),iInitCompleteReceived(EFalse),
1250 iSampleRate(0), iChannels(0)
1254 RA3FDevSoundRecordCancelInitializeTest* RA3FDevSoundRecordCancelInitializeTest::NewL(const TDesC& aTestName)
1256 RA3FDevSoundRecordCancelInitializeTest* self = new (ELeave) RA3FDevSoundRecordCancelInitializeTest(aTestName);
1260 void RA3FDevSoundRecordCancelInitializeTest::DoKickoffTestL()
1262 if (!GetIntFromConfig(iTestStepName, KSampleRate, iSampleRate))
1264 ERR_PRINTF2(KMsgErrorGetParameter, &KSampleRate);
1265 StopTest(KErrNotFound);
1268 if (!GetIntFromConfig(iTestStepName, KChannel, iChannels))
1270 ERR_PRINTF2(KMsgErrorGetParameter, &KChannel);
1271 StopTest(KErrNotFound);
1275 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1277 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1278 StopTest(KErrNotFound);
1281 EncodingFromStringToTFourCC(fourccCode);
1282 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
1285 void RA3FDevSoundRecordCancelInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1287 switch(iDevSoundState)
1291 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordCancelInitializeTest"),EFsmIncorrectErrorPassed));
1292 if(aDevSoundEvent == EEventInitialize)
1294 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1295 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1298 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1302 StartTimer(KMicroSecsTwoSec);
1303 INFO_PRINTF1(_L("Calling CMMFDevSound::CancelInitialize"));
1304 err = iMMFDevSound->CancelInitialize();
1307 ERR_PRINTF2(_L("Unexpected error on CancelInitialize = %d"), err);
1310 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1311 iDevSoundState = EStateInitializing;
1315 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1316 StopTest(aError, EFail);
1320 case EStateInitializing:
1322 if(aDevSoundEvent == EEventInitComplete)
1324 iInitCompleteReceived = ETrue;
1330 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1331 StopTest(aError, EFail);
1336 void RA3FDevSoundRecordCancelInitializeTest::DoTimerCallback()
1338 if(!iInitCompleteReceived)
1340 INFO_PRINTF1(_L("Waiting for InitializeComplete event"));
1341 iInitCompleteReceived = ETrue;
1346 TMMFCapabilities capabilitiesSet;
1347 TBuf<KMaxSampleRateStringLength> stringSampleRateSet;
1348 TBuf<KMaxChannelsStringLength> stringChannelsSet;
1349 SampleRateFromTIntToTMMFSampleRate (iSampleRate, iESampleRate);
1350 capabilitiesSet.iRate = iESampleRate;
1351 capabilitiesSet.iChannels = iChannels;
1352 SampleRateFromTUintToString (capabilitiesSet.iRate, stringSampleRateSet);
1353 ChannelsFromTUintToString (capabilitiesSet.iChannels, stringChannelsSet);
1354 INFO_PRINTF3(_L("Settings for Sample rate an channel mode. %S %S"), &stringSampleRateSet, &stringChannelsSet);
1355 INFO_PRINTF1(_L("Calling CMMFDevSound::SetConfigL"));
1356 TRAPD(err, iMMFDevSound->SetConfigL(capabilitiesSet));
1357 if (err == KErrNotReady)
1359 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with the expected error = %d"), err);
1364 INFO_PRINTF2(_L("CMMFDevSound::SetConfigL left with error = %d"), err);
1365 ERR_PRINTF2(_L("Expected error value = %d"), KErrNotReady);
1366 StopTest(err, EFail);
1371 void RA3FDevSoundRecordCancelInitializeTest::InitializeComplete(TInt aError)
1373 ERR_PRINTF1(_L("DevSound called InitializeComplete after calling CMMFDevSound::CancelInitialize"));
1374 StopTest(aError, EFail);
1379 *========================================================================================================
1380 * MM-A3F-DEVSOUND-CHRTZ-INIT-0016
1382 RA3FDevSoundRecordInitializeThenPlayToneInitializeTest::RA3FDevSoundRecordInitializeThenPlayToneInitializeTest(const TDesC& aTestName)
1383 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
1387 RA3FDevSoundRecordInitializeThenPlayToneInitializeTest* RA3FDevSoundRecordInitializeThenPlayToneInitializeTest::NewL(const TDesC& aTestName)
1389 RA3FDevSoundRecordInitializeThenPlayToneInitializeTest* self = new (ELeave) RA3FDevSoundRecordInitializeThenPlayToneInitializeTest(aTestName);
1393 void RA3FDevSoundRecordInitializeThenPlayToneInitializeTest::DoKickoffTestL()
1396 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1398 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1399 StopTest(KErrNotFound);
1402 EncodingFromStringToTFourCC(fourccCode);
1405 void RA3FDevSoundRecordInitializeThenPlayToneInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1407 switch(iDevSoundState)
1411 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitializeThenPlayToneInitializeTest"),EFsmIncorrectErrorPassed));
1412 if(aDevSoundEvent == EEventInitialize)
1414 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1415 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1418 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1422 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1423 iDevSoundState = EStateInitializing;
1427 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1428 StopTest(aError, EFail);
1432 case EStateInitializing:
1434 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1438 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
1439 iReinitialized = ETrue;
1440 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
1441 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
1447 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1448 iDevSoundState = EStateInitializing;
1452 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
1456 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1458 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1463 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1464 StopTest(aError, EFail);
1470 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1471 StopTest(aError, EFail);
1478 *========================================================================================================
1479 * MM-A3F-DEVSOUND-CHRTZ-INIT-0017
1481 RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest::RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest(const TDesC& aTestName)
1482 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
1486 RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest* RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest::NewL(const TDesC& aTestName)
1488 RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest* self = new (ELeave) RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest(aTestName);
1492 void RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest::DoKickoffTestL()
1495 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1497 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1498 StopTest(KErrNotFound);
1501 EncodingFromStringToTFourCC(fourccCode);
1504 void RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1506 switch(iDevSoundState)
1510 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitializeThenPlayAudioInitializeTest"),EFsmIncorrectErrorPassed));
1511 if(aDevSoundEvent == EEventInitialize)
1513 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1514 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1517 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1521 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1522 iDevSoundState = EStateInitializing;
1526 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1527 StopTest(aError, EFail);
1531 case EStateInitializing:
1533 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1537 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
1538 iReinitialized = ETrue;
1539 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
1540 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
1546 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1547 iDevSoundState = EStateInitializing;
1551 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
1555 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1557 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1562 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1563 StopTest(aError, EFail);
1569 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1570 StopTest(aError, EFail);
1577 *========================================================================================================
1578 * MM-A3F-DEVSOUND-CHRTZ-INIT-0018
1580 RA3FDevSoundRecordInitializeToRecordAudioTwiceTest::RA3FDevSoundRecordInitializeToRecordAudioTwiceTest(const TDesC& aTestName)
1581 : RA3FDevSoundTestBase(aTestName), iReinitialized(EFalse)
1585 RA3FDevSoundRecordInitializeToRecordAudioTwiceTest* RA3FDevSoundRecordInitializeToRecordAudioTwiceTest::NewL(const TDesC& aTestName)
1587 RA3FDevSoundRecordInitializeToRecordAudioTwiceTest* self = new (ELeave) RA3FDevSoundRecordInitializeToRecordAudioTwiceTest(aTestName);
1591 void RA3FDevSoundRecordInitializeToRecordAudioTwiceTest::DoKickoffTestL()
1594 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
1596 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
1597 StopTest(KErrNotFound);
1600 EncodingFromStringToTFourCC(fourccCode);
1603 void RA3FDevSoundRecordInitializeToRecordAudioTwiceTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1605 switch(iDevSoundState)
1609 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitializeToRecordAudioTwiceTest"),EFsmIncorrectErrorPassed));
1610 if(aDevSoundEvent == EEventInitialize)
1612 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1613 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1616 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1620 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1621 iDevSoundState = EStateInitializing;
1625 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1626 StopTest(aError, EFail);
1630 case EStateInitializing:
1632 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1636 INFO_PRINTF1(_L("========== First initialization successfully completed =========="));
1637 iReinitialized = ETrue;
1638 INFO_PRINTF1(_L("Again calling CMMFDevSound::InitializeL"));
1639 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
1645 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1646 iDevSoundState = EStateInitializing;
1650 INFO_PRINTF1(_L("========== Second initialization successfully completed =========="));
1654 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1656 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1661 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1662 StopTest(aError, EFail);
1668 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1669 StopTest(aError, EFail);
1676 *========================================================================================================
1677 * MM-A3F-DEVSOUND-CHRTZ-INIT-0019
1679 RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest::RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest(const TDesC& aTestName)
1680 : RA3FDevSoundTestBase(aTestName)
1684 RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest* RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest::NewL(const TDesC& aTestName)
1686 RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest* self = new (ELeave) RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest(aTestName);
1690 void RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest::DoKickoffTestL()
1694 void RA3FDevSoundRecordInitializeNoFormatSpecificationPresentedTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1696 switch(iDevSoundState)
1700 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundReocordCancelInitializeNoFormatSpecificationPresentedTest"),EFsmIncorrectErrorPassed));
1701 if(aDevSoundEvent == EEventInitialize)
1703 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
1704 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateRecording));
1707 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
1711 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
1712 iDevSoundState = EStateInitializing;
1714 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1716 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1721 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1722 StopTest(aError, EFail);
1726 case EStateInitializing:
1728 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
1730 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
1733 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
1735 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
1740 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
1741 StopTest(aError, EFail);
1747 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1748 StopTest(aError, EFail);
1755 *========================================================================================================
1756 * MM-A3F-DEVSOUND-CHRTZ-INIT-0020
1758 RA3FDevSoundPlayDataWithoutInitializeTest::RA3FDevSoundPlayDataWithoutInitializeTest(const TDesC& aTestName)
1759 : RA3FDevSoundTestBase(aTestName)
1763 RA3FDevSoundPlayDataWithoutInitializeTest* RA3FDevSoundPlayDataWithoutInitializeTest::NewL(const TDesC& aTestName)
1765 RA3FDevSoundPlayDataWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayDataWithoutInitializeTest(aTestName);
1769 void RA3FDevSoundPlayDataWithoutInitializeTest::DoKickoffTestL()
1771 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
1774 void RA3FDevSoundPlayDataWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1776 switch(iDevSoundState)
1780 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayDataWithoutInitializeTest"),EFsmIncorrectErrorPassed));
1781 if(aDevSoundEvent == EEventInitialize)
1783 INFO_PRINTF1(_L("Call CMMFDevSound::PlayData without calling CMMFDevSound::InitializeL..."));
1784 iMMFDevSound->PlayData();
1785 StartTimer(KMicroSecsTwoSec);
1789 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1790 StopTest(aError, EFail);
1796 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1797 StopTest(aError, EFail);
1802 void RA3FDevSoundPlayDataWithoutInitializeTest::DoTimerCallback()
1805 ERR_PRINTF1(_L("Panic did not occur as expected when calling PlayData()."));
1806 StopTest(KErrNone, EFail);
1810 *========================================================================================================
1811 * MM-A3F-DEVSOUND-CHRTZ-INIT-0021
1813 RA3FDevSoundPlayDTMFStringWithoutInitializeTest::RA3FDevSoundPlayDTMFStringWithoutInitializeTest(const TDesC& aTestName)
1814 : RA3FDevSoundTestBase(aTestName), iDTMFString(KNullDesC)
1818 RA3FDevSoundPlayDTMFStringWithoutInitializeTest* RA3FDevSoundPlayDTMFStringWithoutInitializeTest::NewL(const TDesC& aTestName)
1820 RA3FDevSoundPlayDTMFStringWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayDTMFStringWithoutInitializeTest(aTestName);
1824 void RA3FDevSoundPlayDTMFStringWithoutInitializeTest::DoKickoffTestL()
1827 if(!GetStringFromConfig(iTestStepName, KDTMFString, DTMF))
1829 ERR_PRINTF2(KMsgErrorGetParameter, &KDTMFString);
1830 StopTest(KErrNotFound);
1833 iDTMFString.Copy(DTMF);
1836 void RA3FDevSoundPlayDTMFStringWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1838 switch(iDevSoundState)
1842 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayDTMFStringWithoutInitializeTest"),EFsmIncorrectErrorPassed));
1843 if(aDevSoundEvent == EEventInitialize)
1845 INFO_PRINTF1(_L("Call CMMFDevSound::PlayDTMFStringL..."));
1846 TRAPD(err, iMMFDevSound->PlayDTMFStringL(iDTMFString));
1847 if(err == KErrNotReady)
1849 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayDTMFStringL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
1850 StopTest(err, EPass);
1855 ERR_PRINTF2(_L("CMMFDevSound::PlayDTMFStringL without calling CMMFDevSound::InitializeL left with error = %d"), err);
1856 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
1857 StopTest(err, EFail);
1862 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1863 StopTest(aError, EFail);
1869 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1870 StopTest(aError, EFail);
1877 *========================================================================================================
1878 * MM-A3F-DEVSOUND-CHRTZ-INIT-0022
1880 RA3FDevSoundPlayDualToneWithoutInitializeTest::RA3FDevSoundPlayDualToneWithoutInitializeTest(const TDesC& aTestName)
1881 : RA3FDevSoundTestBase(aTestName), iFrequencyTone1(0), iFrequencyTone2(0)
1885 RA3FDevSoundPlayDualToneWithoutInitializeTest* RA3FDevSoundPlayDualToneWithoutInitializeTest::NewL(const TDesC& aTestName)
1887 RA3FDevSoundPlayDualToneWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayDualToneWithoutInitializeTest(aTestName);
1891 void RA3FDevSoundPlayDualToneWithoutInitializeTest::DoKickoffTestL()
1893 if(!GetIntFromConfig(iTestStepName, KDuration, iDuration))
1895 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration);
1896 StopTest(KErrNotFound);
1899 if(!GetIntFromConfig(iTestStepName, KFrequencyTone1, iFrequencyTone1))
1901 ERR_PRINTF2(KMsgErrorGetParameter, &KFrequencyTone1);
1902 StopTest(KErrNotFound);
1905 if(!GetIntFromConfig(iTestStepName, KFrequencyTone2, iFrequencyTone2))
1907 ERR_PRINTF2(KMsgErrorGetParameter, &KFrequencyTone2);
1908 StopTest(KErrNotFound);
1913 void RA3FDevSoundPlayDualToneWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1915 switch(iDevSoundState)
1919 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayDualToneWithoutInitializeTest"),EFsmIncorrectErrorPassed));
1920 if(aDevSoundEvent == EEventInitialize)
1922 INFO_PRINTF1(_L("Call CMMFDevSound::PlayDualToneL..."));
1923 TRAPD(err, iMMFDevSound->PlayDualToneL(iFrequencyTone1,iFrequencyTone2,iDuration));
1924 if(err == KErrNotReady)
1926 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayDualToneL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
1927 StopTest(err, EPass);
1932 ERR_PRINTF2(_L("CMMFDevSound::PlayDualToneL without calling CMMFDevSound::InitializeL left with error = %d"), err);
1933 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
1934 StopTest(err, EFail);
1939 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1940 StopTest(aError, EFail);
1946 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
1947 StopTest(aError, EFail);
1954 *========================================================================================================
1955 * MM-A3F-DEVSOUND-CHRTZ-INIT-0023
1957 RA3FDevSoundPlayFixedSequenceWithoutInitializeTest::RA3FDevSoundPlayFixedSequenceWithoutInitializeTest(const TDesC& aTestName)
1958 : RA3FDevSoundTestBase(aTestName)
1962 RA3FDevSoundPlayFixedSequenceWithoutInitializeTest* RA3FDevSoundPlayFixedSequenceWithoutInitializeTest::NewL(const TDesC& aTestName)
1964 RA3FDevSoundPlayFixedSequenceWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayFixedSequenceWithoutInitializeTest(aTestName);
1968 void RA3FDevSoundPlayFixedSequenceWithoutInitializeTest::DoKickoffTestL()
1972 void RA3FDevSoundPlayFixedSequenceWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
1974 switch(iDevSoundState)
1978 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayFixedSequenceWithoutInitializeTest"),EFsmIncorrectErrorPassed));
1979 if(aDevSoundEvent == EEventInitialize)
1981 INFO_PRINTF1(_L("Call CMMFDevSound::PlayFixedSequenceL..."));
1982 TRAPD(err, iMMFDevSound->PlayFixedSequenceL(0));
1983 if(err == KErrNotSupported)
1985 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayFixedSequenceL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
1986 StopTest(err, EPass);
1991 ERR_PRINTF2(_L("CMMFDevSound::PlayFixedSequenceL without calling CMMFDevSound::InitializeL left with error = %d"), err);
1992 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
1993 StopTest(err, EFail);
1998 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
1999 StopTest(aError, EFail);
2005 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2006 StopTest(aError, EFail);
2013 *========================================================================================================
2014 * MM-A3F-DEVSOUND-CHRTZ-INIT-0024
2016 RA3FDevSoundPlayInitWithoutInitializeTest::RA3FDevSoundPlayInitWithoutInitializeTest(const TDesC& aTestName)
2017 : RA3FDevSoundTestBase(aTestName)
2021 RA3FDevSoundPlayInitWithoutInitializeTest* RA3FDevSoundPlayInitWithoutInitializeTest::NewL(const TDesC& aTestName)
2023 RA3FDevSoundPlayInitWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayInitWithoutInitializeTest(aTestName);
2027 void RA3FDevSoundPlayInitWithoutInitializeTest::DoKickoffTestL()
2031 void RA3FDevSoundPlayInitWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2033 switch(iDevSoundState)
2037 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitWithoutInitializeTest"),EFsmIncorrectErrorPassed));
2038 if(aDevSoundEvent == EEventInitialize)
2040 INFO_PRINTF1(_L("Call CMMFDevSound::PlayInitL without calling CMMFDevSound::InitializeL..."));
2041 TRAPD(err,iMMFDevSound->PlayInitL());
2042 if(err == KErrNotReady)
2044 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayInitL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
2045 StopTest(err, EPass);
2050 ERR_PRINTF2(_L("CMMFDevSound::PlayInitL without calling CMMFDevSound::InitializeL left with error = %d"), err);
2051 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2052 StopTest(err, EFail);
2057 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2058 StopTest(aError, EFail);
2064 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2065 StopTest(aError, EFail);
2072 *========================================================================================================
2073 * MM-A3F-DEVSOUND-CHRTZ-INIT-0025
2075 RA3FDevSoundPlayToneWithoutInitializeTest::RA3FDevSoundPlayToneWithoutInitializeTest(const TDesC& aTestName)
2076 : RA3FDevSoundTestBase(aTestName), iFrequencyTone1(0)
2080 RA3FDevSoundPlayToneWithoutInitializeTest* RA3FDevSoundPlayToneWithoutInitializeTest::NewL(const TDesC& aTestName)
2082 RA3FDevSoundPlayToneWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayToneWithoutInitializeTest(aTestName);
2086 void RA3FDevSoundPlayToneWithoutInitializeTest::DoKickoffTestL()
2088 if(!GetIntFromConfig(iTestStepName, KDuration, iDuration))
2090 ERR_PRINTF2(KMsgErrorGetParameter, &KDuration);
2091 StopTest(KErrNotFound);
2094 if(!GetIntFromConfig(iTestStepName, KFrequencyTone1, iFrequencyTone1))
2096 ERR_PRINTF2(KMsgErrorGetParameter, &KFrequencyTone1);
2097 StopTest(KErrNotFound);
2102 void RA3FDevSoundPlayToneWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2104 switch(iDevSoundState)
2108 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayToneWithoutInitializeTest"),EFsmIncorrectErrorPassed));
2109 if(aDevSoundEvent == EEventInitialize)
2111 INFO_PRINTF1(_L("Call CMMFDevSound::PlayToneL..."));
2112 TRAPD(err, iMMFDevSound->PlayToneL(iFrequencyTone1, iDuration));
2113 if(err == KErrNotReady)
2115 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayToneL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
2116 StopTest(err, EPass);
2121 ERR_PRINTF2(_L("CMMFDevSound::PlayToneL without calling CMMFDevSound::InitializeL left with error = %d"), err);
2122 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2123 StopTest(err, EFail);
2128 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2129 StopTest(aError, EFail);
2135 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2136 StopTest(aError, EFail);
2143 *========================================================================================================
2144 * MM-A3F-DEVSOUND-CHRTZ-INIT-0026
2146 RA3FDevSoundPlayToneSequenceWithoutInitializeTest::RA3FDevSoundPlayToneSequenceWithoutInitializeTest(const TDesC& aTestName)
2147 : RA3FDevSoundTestBase(aTestName)
2151 RA3FDevSoundPlayToneSequenceWithoutInitializeTest* RA3FDevSoundPlayToneSequenceWithoutInitializeTest::NewL(const TDesC& aTestName)
2153 RA3FDevSoundPlayToneSequenceWithoutInitializeTest* self = new (ELeave) RA3FDevSoundPlayToneSequenceWithoutInitializeTest(aTestName);
2157 void RA3FDevSoundPlayToneSequenceWithoutInitializeTest::DoKickoffTestL()
2161 void RA3FDevSoundPlayToneSequenceWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2163 switch(iDevSoundState)
2167 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayToneSequenceWithoutInitializeTest"),EFsmIncorrectErrorPassed));
2168 if(aDevSoundEvent == EEventInitialize)
2170 TUint8* tablePointer = const_cast<TUint8*>( &(KFixedSequenceTestSequenceDataX[0] ));
2171 TPtrC8 KFixedSequenceData(tablePointer, sizeof(KFixedSequenceTestSequenceDataX));
2172 INFO_PRINTF1(_L("Call CMMFDevSound::PlayToneSequenceL..."));
2173 TRAPD(err, iMMFDevSound->PlayToneSequenceL(KFixedSequenceData));
2174 if(err == KErrNotReady)
2176 ERR_PRINTF2(_L("Calling CMMFDevSound::PlayToneSequenceL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
2177 StopTest(err, EPass);
2182 ERR_PRINTF2(_L("CMMFDevSound::PlayToneSequenceL without calling CMMFDevSound::InitializeL left with error = %d"), err);
2183 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2184 StopTest(err, EFail);
2189 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2190 StopTest(aError, EFail);
2196 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2197 StopTest(aError, EFail);
2204 *========================================================================================================
2205 * MM-A3F-DEVSOUND-CHRTZ-INIT-0027
2207 RA3FDevSoundRecordDataWithoutInitializeTest::RA3FDevSoundRecordDataWithoutInitializeTest(const TDesC& aTestName)
2208 : RA3FDevSoundTestBase(aTestName)
2212 RA3FDevSoundRecordDataWithoutInitializeTest* RA3FDevSoundRecordDataWithoutInitializeTest::NewL(const TDesC& aTestName)
2214 RA3FDevSoundRecordDataWithoutInitializeTest* self = new (ELeave) RA3FDevSoundRecordDataWithoutInitializeTest(aTestName);
2218 void RA3FDevSoundRecordDataWithoutInitializeTest::DoKickoffTestL()
2220 iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
2223 void RA3FDevSoundRecordDataWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2225 switch(iDevSoundState)
2229 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordDataWithoutInitializeTest"),EFsmIncorrectErrorPassed));
2230 if(aDevSoundEvent == EEventInitialize)
2232 INFO_PRINTF1(_L("Call CMMFDevSound::RecordData without calling CMMFDevSound::InitializeL..."));
2233 iMMFDevSound->RecordData();
2234 StartTimer(KMicroSecsTwoSec);
2238 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2239 StopTest(aError, EFail);
2245 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2246 StopTest(aError, EFail);
2251 void RA3FDevSoundRecordDataWithoutInitializeTest::DoTimerCallback()
2254 ERR_PRINTF1(_L("Panic did not occur as expected when calling RecordData()."));
2255 StopTest(KErrNone, EFail);
2259 *========================================================================================================
2260 * MM-A3F-DEVSOUND-CHRTZ-INIT-0028
2262 RA3FDevSoundRecordInitWithoutInitializeTest::RA3FDevSoundRecordInitWithoutInitializeTest(const TDesC& aTestName)
2263 : RA3FDevSoundTestBase(aTestName)
2267 RA3FDevSoundRecordInitWithoutInitializeTest* RA3FDevSoundRecordInitWithoutInitializeTest::NewL(const TDesC& aTestName)
2269 RA3FDevSoundRecordInitWithoutInitializeTest* self = new (ELeave) RA3FDevSoundRecordInitWithoutInitializeTest(aTestName);
2273 void RA3FDevSoundRecordInitWithoutInitializeTest::DoKickoffTestL()
2277 void RA3FDevSoundRecordInitWithoutInitializeTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2279 switch(iDevSoundState)
2283 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitWithoutInitializeTest"),EFsmIncorrectErrorPassed));
2284 if(aDevSoundEvent == EEventInitialize)
2286 INFO_PRINTF1(_L("Call CMMFDevSound::RecordInitL without calling CMMFDevSound::InitializeL..."));
2287 TRAPD(err,iMMFDevSound->RecordInitL());
2288 if(err == KErrNotReady)
2290 ERR_PRINTF2(_L("Calling CMMFDevSound::RecordInitL without calling CMMFDevSound::InitializeL left with expected error = %d"), err);
2291 StopTest(err, EPass);
2296 ERR_PRINTF2(_L("CMMFDevSound::RecordInitL without calling CMMFDevSound::InitializeL left with error = %d"), err);
2297 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2298 StopTest(err, EFail);
2303 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2304 StopTest(aError, EFail);
2310 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2311 StopTest(aError, EFail);
2318 *========================================================================================================
2319 * MM-A3F-DEVSOUND-CHRTZ-INIT-0029
2321 RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest::RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest(const TDesC& aTestName)
2322 : RA3FDevSoundTestBase(aTestName)
2326 RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest* RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest::NewL(const TDesC& aTestName)
2328 RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest* self = new (ELeave) RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest(aTestName);
2332 void RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest::DoKickoffTestL()
2336 void RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2338 switch(iDevSoundState)
2342 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneInitializationMoreThanOnceBeforeInitCompleteTest"),EFsmIncorrectErrorPassed));
2343 if(aDevSoundEvent == EEventInitialize)
2345 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
2346 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
2349 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2353 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice before init complete"));
2354 TRAP(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
2355 if(err != KErrNotReady)
2357 ERR_PRINTF2(_L("Calling CMMFDevSound::InitializeL more than once before init complete left with error = %d"), err);
2358 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2359 StopTest(err, EFail);
2363 INFO_PRINTF1(_L("Second call to CMMFDevSound::InitializeL leaves with KErrNotReady as expected"));
2365 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2366 iDevSoundState = EStateInitializing;
2370 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2371 StopTest(aError, EFail);
2375 case EStateInitializing:
2377 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2379 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2382 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2384 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2389 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2390 StopTest(aError, EFail);
2396 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2397 StopTest(aError, EFail);
2404 *========================================================================================================
2405 * MM-A3F-DEVSOUND-CHRTZ-INIT-0030
2407 RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest::RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest(const TDesC& aTestName)
2408 : RA3FDevSoundTestBase(aTestName)
2412 RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest* RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest::NewL(const TDesC& aTestName)
2414 RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest* self = new (ELeave) RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest(aTestName);
2418 void RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest::DoKickoffTestL()
2421 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
2423 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
2424 StopTest(KErrNotFound);
2427 EncodingFromStringToTFourCC(fourccCode);
2430 void RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2432 switch(iDevSoundState)
2436 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayInitializationMoreThanOnceBeforeInitCompleteTest"),EFsmIncorrectErrorPassed));
2437 if(aDevSoundEvent == EEventInitialize)
2439 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
2440 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
2443 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2447 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice before init complete"));
2448 TRAP(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
2449 if(err != KErrNotReady)
2451 ERR_PRINTF2(_L("Calling CMMFDevSound::InitializeL more than once before init complete left with error = %d"), err);
2452 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2453 StopTest(err, EFail);
2457 INFO_PRINTF1(_L("Second call to CMMFDevSound::InitializeL leaves with KErrNotReady as expected"));
2459 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2460 iDevSoundState = EStateInitializing;
2464 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2465 StopTest(aError, EFail);
2469 case EStateInitializing:
2471 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2473 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2476 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2478 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2483 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2484 StopTest(aError, EFail);
2490 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2491 StopTest(aError, EFail);
2498 *========================================================================================================
2499 * MM-A3F-DEVSOUND-CHRTZ-INIT-0031
2501 RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest::RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest(const TDesC& aTestName)
2502 : RA3FDevSoundTestBase(aTestName)
2506 RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest* RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest::NewL(const TDesC& aTestName)
2508 RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest* self = new (ELeave) RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest(aTestName);
2512 void RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest::DoKickoffTestL()
2515 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
2517 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
2518 StopTest(KErrNotFound);
2521 EncodingFromStringToTFourCC(fourccCode);
2524 void RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2526 switch(iDevSoundState)
2530 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordInitializationMoreThanOnceBeforeInitCompleteTest"),EFsmIncorrectErrorPassed));
2531 if(aDevSoundEvent == EEventInitialize)
2533 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL"));
2534 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
2537 INFO_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2541 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice before init complete"));
2542 TRAP(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
2543 if(err != KErrNotReady)
2545 ERR_PRINTF2(_L("Calling MMFDevSound::InitializeL more than once before init complete left with error = %d"), err);
2546 ERR_PRINTF2(_L("Expected error = %d"), KErrNotReady);
2547 StopTest(err, EFail);
2551 INFO_PRINTF1(_L("Second call to CMMFDevSound::InitializeL leaves with KErrNotReady as expected"));
2553 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2554 iDevSoundState = EStateInitializing;
2558 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2559 StopTest(aError, EFail);
2563 case EStateInitializing:
2565 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2567 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2570 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2572 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2577 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2578 StopTest(aError, EFail);
2584 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2585 StopTest(aError, EFail);
2592 *========================================================================================================
2593 * MM-A3F-DEVSOUND-CHRTZ-INIT-0032
2595 RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds::RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds(const TDesC& aTestName)
2596 : RA3FDevSoundTestBase(aTestName)
2600 RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds* RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds::NewL(const TDesC& aTestName)
2602 RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds* self = new (ELeave) RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds(aTestName);
2606 void RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds::DoKickoffTestL()
2610 void RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceeds::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2612 switch(iDevSoundState)
2616 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundToneFirstInitializationLeavesThenSecondSucceed"),EFsmIncorrectErrorPassed));
2617 if(aDevSoundEvent == EEventInitialize)
2619 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL to make it leave"));
2620 TRAPD(err, iMMFDevSound->InitializeL(*this, EMMFStateConverting));
2623 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2627 ERR_PRINTF1(_L("CMMFDevSound::InitializeL did not leave as expected"));
2628 StopTest(err, EFail);
2630 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice, but now using right parameters"));
2631 TRAP(err, iMMFDevSound->InitializeL(*this, EMMFStateTonePlaying));
2634 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2638 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2639 iDevSoundState = EStateInitializing;
2643 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2644 StopTest(aError, EFail);
2648 case EStateInitializing:
2650 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2652 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2655 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2657 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2662 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2663 StopTest(aError, EFail);
2669 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2670 StopTest(aError, EFail);
2677 *========================================================================================================
2678 * MM-A3F-DEVSOUND-CHRTZ-INIT-0033
2680 RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds::RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds(const TDesC& aTestName)
2681 : RA3FDevSoundTestBase(aTestName)
2685 RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds* RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds::NewL(const TDesC& aTestName)
2687 RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds* self = new (ELeave) RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds(aTestName);
2691 void RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds::DoKickoffTestL()
2694 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
2696 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
2697 StopTest(KErrNotFound);
2700 EncodingFromStringToTFourCC(fourccCode);
2703 void RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceeds::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2705 switch(iDevSoundState)
2709 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundPlayFirstInitializationLeavesThenSecondSucceed"),EFsmIncorrectErrorPassed));
2710 if(aDevSoundEvent == EEventInitialize)
2712 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL to make it leave"));
2713 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateConverting));
2716 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2720 ERR_PRINTF1(_L("CMMFDevSound::InitializeL did not leave as expected"));
2721 StopTest(err, EFail);
2723 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice, but now using right parameters"));
2724 TRAP(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStatePlaying));
2727 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2731 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2732 iDevSoundState = EStateInitializing;
2736 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2737 StopTest(aError, EFail);
2741 case EStateInitializing:
2743 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2745 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2748 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2750 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2755 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2756 StopTest(aError, EFail);
2762 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2763 StopTest(aError, EFail);
2770 *========================================================================================================
2771 * MM-A3F-DEVSOUND-CHRTZ-INIT-0034
2773 RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds::RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds(const TDesC& aTestName)
2774 : RA3FDevSoundTestBase(aTestName)
2778 RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds* RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds::NewL(const TDesC& aTestName)
2780 RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds* self = new (ELeave) RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds(aTestName);
2784 void RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds::DoKickoffTestL()
2787 if(!GetStringFromConfig(iTestStepName, KFourccCode, fourccCode))
2789 ERR_PRINTF2(KMsgErrorGetParameter, &KFourccCode);
2790 StopTest(KErrNotFound);
2793 EncodingFromStringToTFourCC(fourccCode);
2796 void RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceeds::Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError)
2798 switch(iDevSoundState)
2802 __ASSERT_ALWAYS((aError == KErrNone),Panic(_L("RA3FDevSoundRecordFirstInitializationLeavesThenSecondSucceed"),EFsmIncorrectErrorPassed));
2803 if(aDevSoundEvent == EEventInitialize)
2805 INFO_PRINTF1(_L("Calling CMMFDevSound::InitializeL to make it leave"));
2806 TRAPD(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateConverting));
2809 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2813 ERR_PRINTF1(_L("CMMFDevSound::InitializeL did not leave as expected"));
2814 StopTest(err, EFail);
2816 INFO_PRINTF1(_L("CMMFDevSound::InitializeL called twice, but now using right parameters"));
2817 TRAP(err, iMMFDevSound->InitializeL(*this, iFourCCCode, EMMFStateRecording));
2820 ERR_PRINTF2(_L("CMMFDevSound::InitializeL left with error = %d"), err);
2824 INFO_PRINTF1(_L("DevSound State: EStateInitializing"));
2825 iDevSoundState = EStateInitializing;
2829 ERR_PRINTF2(_L("DevSound EEventInitialize not received as expected. Received event: %d"), aDevSoundEvent);
2830 StopTest(aError, EFail);
2834 case EStateInitializing:
2836 if(aDevSoundEvent == EEventInitComplete && aError == KErrNone)
2838 INFO_PRINTF1(_L("========== Test Case Successfully Completed =========="));
2841 else if(aDevSoundEvent == EEventInitComplete && aError != KErrNone)
2843 ERR_PRINTF2(_L("DevSound called CMMFDevSound::InitializeComplete with error = %d"), aError);
2848 ERR_PRINTF2(_L("DevSound EEventInitComplete not received as expected. Received event: %d"), aDevSoundEvent);
2849 StopTest(aError, EFail);
2855 ERR_PRINTF2(_L("Invalid DevSound state received: %d"), iDevSoundState);
2856 StopTest(aError, EFail);