os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepciunderflowautostopcontrol.cpp
First public contribution.
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 "teststepciunderflowautostopcontrol.h"
19 TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStepL()
21 iTestStepResult = ETestSuiteError;
23 INFO_PRINTF1(_L("Initializing test CI device"));
25 if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0091-HP")) == 0)
27 iTestStepResult = DoTestStep0091L();
29 else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0092-HP")) == 0)
31 iTestStepResult = DoTestStep0092L();
34 return iTestStepResult;
38 TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0091L()
40 iTestStepResult = EFail;
42 INFO_PRINTF1(_L("UnderflowAutoStopControl - Instantiating"));
44 //Initialize - with the UID of our test HwDevice
45 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
46 TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
48 TFourCC testUID('T','0','2','1');
51 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
53 if (iTestStepResult != EPass)
55 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
59 // reset the value as previous test is pass
60 iTestStepResult = EFail;
62 // KUidunderflowAutoStopControl
63 MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
67 INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl instantiated successfully"));
69 iTestStepResult = EPass;
73 ERR_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
76 return iTestStepResult;
80 TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0092L()
82 iTestStepResult = EFail;
83 TInt result = KErrGeneral;
85 INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl - SetConversionFormat"));
87 //Initialize - with the UID of our test HwDevice
88 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
89 TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
91 TFourCC testUID('T','0','2','1');
94 iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
96 if (iTestStepResult != EPass)
98 INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
102 // reset the value as previous test is pass
103 iTestStepResult = EFail;
105 // KUidUnderflowAutoStopControl
106 MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
110 result = ptr->MmuascTurnOffUnderflowAutoStop(); // call method
112 if (result == KErrNone)
114 INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop finished successfully"));
116 iTestStepResult = EPass;
120 ERR_PRINTF2(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop failed with error %d"), result);
125 INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
126 iTestStepResult = EInconclusive;
129 return iTestStepResult;