os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepciunderflowautostopcontrol.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepciunderflowautostopcontrol.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,130 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "teststepciunderflowautostopcontrol.h"
1.20 +
1.21 +
1.22 +TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStepL()
1.23 + {
1.24 + iTestStepResult = ETestSuiteError;
1.25 +
1.26 + INFO_PRINTF1(_L("Initializing test CI device"));
1.27 +
1.28 + if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0091-HP")) == 0)
1.29 + {
1.30 + iTestStepResult = DoTestStep0091L();
1.31 + }
1.32 + else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0092-HP")) == 0)
1.33 + {
1.34 + iTestStepResult = DoTestStep0092L();
1.35 + }
1.36 +
1.37 + return iTestStepResult;
1.38 + }
1.39 +
1.40 +
1.41 +TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0091L()
1.42 + {
1.43 + iTestStepResult = EFail;
1.44 +
1.45 + INFO_PRINTF1(_L("UnderflowAutoStopControl - Instantiating"));
1.46 +
1.47 + //Initialize - with the UID of our test HwDevice
1.48 + #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
1.49 + TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
1.50 + #else
1.51 + TFourCC testUID('T','0','2','1');
1.52 + #endif
1.53 +
1.54 + iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
1.55 +
1.56 + if (iTestStepResult != EPass)
1.57 + {
1.58 + INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
1.59 + return EInconclusive;
1.60 + }
1.61 +
1.62 + // reset the value as previous test is pass
1.63 + iTestStepResult = EFail;
1.64 +
1.65 + // KUidunderflowAutoStopControl
1.66 + MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
1.67 +
1.68 + if (ptr)
1.69 + {
1.70 + INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl instantiated successfully"));
1.71 +
1.72 + iTestStepResult = EPass;
1.73 + }
1.74 + else
1.75 + {
1.76 + ERR_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
1.77 + }
1.78 +
1.79 + return iTestStepResult;
1.80 + }
1.81 +
1.82 +
1.83 +TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0092L()
1.84 + {
1.85 + iTestStepResult = EFail;
1.86 + TInt result = KErrGeneral;
1.87 +
1.88 + INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl - SetConversionFormat"));
1.89 +
1.90 + //Initialize - with the UID of our test HwDevice
1.91 + #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
1.92 + TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
1.93 + #else
1.94 + TFourCC testUID('T','0','2','1');
1.95 + #endif
1.96 +
1.97 + iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
1.98 +
1.99 + if (iTestStepResult != EPass)
1.100 + {
1.101 + INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
1.102 + return EInconclusive;
1.103 + }
1.104 +
1.105 + // reset the value as previous test is pass
1.106 + iTestStepResult = EFail;
1.107 +
1.108 + // KUidUnderflowAutoStopControl
1.109 + MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
1.110 +
1.111 + if (ptr)
1.112 + {
1.113 + result = ptr->MmuascTurnOffUnderflowAutoStop(); // call method
1.114 +
1.115 + if (result == KErrNone)
1.116 + {
1.117 + INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop finished successfully"));
1.118 +
1.119 + iTestStepResult = EPass;
1.120 + }
1.121 + else
1.122 + {
1.123 + ERR_PRINTF2(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop failed with error %d"), result);
1.124 + }
1.125 + }
1.126 + else
1.127 + {
1.128 + INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
1.129 + iTestStepResult = EInconclusive;
1.130 + }
1.131 +
1.132 + return iTestStepResult;
1.133 + }