os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepciadvancedaacencodesettings.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/teststepciadvancedaacencodesettings.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,137 @@
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 "teststepciadvancedaacencodesettings.h"
1.20 +#include "cidefine.h"
1.21 +
1.22 +/*****************************************************************************/
1.23 +CTestStepCICreateAdvancedAacEncodeSettings::CTestStepCICreateAdvancedAacEncodeSettings()
1.24 + {
1.25 + iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0006-HP");
1.26 + }
1.27 +
1.28 +/*****************************************************************************/
1.29 +TVerdict CTestStepCICreateAdvancedAacEncodeSettings::DoTestStepL()
1.30 + {
1.31 + iTestStepResult = EFail;
1.32 +
1.33 + INFO_PRINTF1(_L("Initializing test CI device"));
1.34 +
1.35 + //Initialize - with the UID of our test HwDevice
1.36 + #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
1.37 + TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice};
1.38 + #else
1.39 + TFourCC testUID('T','0','0','5');
1.40 + #endif
1.41 +
1.42 + MMMFAdvancedAACEncodeSettings* interface = NULL;
1.43 + interface = static_cast<MMMFAdvancedAACEncodeSettings*>(
1.44 + InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings));
1.45 +
1.46 + if (interface)
1.47 + {
1.48 + iTestStepResult = EPass;
1.49 + INFO_PRINTF1(_L("Successfully retrieved the interface."));
1.50 + }
1.51 + else
1.52 + {
1.53 + iTestStepResult = EFail;
1.54 + ERR_PRINTF1(_L("Failed to retrieve the interface"));
1.55 + }
1.56 +
1.57 + return iTestStepResult;
1.58 + }
1.59 +
1.60 +/*****************************************************************************/
1.61 +CTestStepCIAdvancedAacEncodeSettings::CTestStepCIAdvancedAacEncodeSettings(TBool aIsGetTest)
1.62 + : iIsGetTest(aIsGetTest)
1.63 + {
1.64 + if (iIsGetTest)
1.65 + {
1.66 + iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0099-HP");
1.67 + }
1.68 + else
1.69 + {
1.70 + iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0007-HP");
1.71 + }
1.72 + }
1.73 +
1.74 +/*****************************************************************************/
1.75 +TVerdict CTestStepCIAdvancedAacEncodeSettings::DoTestStepL()
1.76 + {
1.77 + iTestStepResult = EFail;
1.78 +
1.79 + INFO_PRINTF1(_L("Initializing test CI device"));
1.80 +
1.81 + //Initialize - with the UID of our test HwDevice
1.82 + #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
1.83 + TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice};
1.84 + #else
1.85 + TFourCC testUID('T','0','0','5');
1.86 + #endif
1.87 +
1.88 + MMMFAdvancedAACEncodeSettings* interface = NULL;
1.89 + interface = static_cast<MMMFAdvancedAACEncodeSettings*>(
1.90 + InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings));
1.91 +
1.92 + if (interface)
1.93 + {
1.94 + MMMFAdvancedAACEncodeSettings::TAACBitrateMode bitrateMode = MMMFAdvancedAACEncodeSettings::EAACBitrateModeFixed;
1.95 + INFO_PRINTF1(_L("Calling test CI method"));
1.96 + TInt err = interface->SetAACEncodeBitrateMode(bitrateMode);
1.97 +
1.98 + if (iIsGetTest)
1.99 + {
1.100 + INFO_PRINTF1(_L("Testing GetAACEncodeBitrateMode"));
1.101 + }
1.102 + else
1.103 + {
1.104 + INFO_PRINTF1(_L("Testing SetAACEncodeBitrateMode"));
1.105 + }
1.106 +
1.107 + if (err == KErrNone)
1.108 + {
1.109 + // Successfully set the mode
1.110 + INFO_PRINTF1(_L("Set the mode successfully"));
1.111 +
1.112 + MMMFAdvancedAACEncodeSettings::TAACBitrateMode testMode;
1.113 +
1.114 + err = interface->GetAACEncodeBitrateMode(testMode);
1.115 +
1.116 + iTestStepResult = EFail;
1.117 + if ((err == KErrNone) && (testMode == bitrateMode))
1.118 + {
1.119 + INFO_PRINTF1(_L("Test CI method call was successful"));
1.120 + iTestStepResult = EPass;
1.121 + }
1.122 + else
1.123 + {
1.124 + ERR_PRINTF4(_L("Test CI method failed, error: %d, expected value: %d, actual value: %d"), \
1.125 + err, bitrateMode, testMode);
1.126 + }
1.127 + }
1.128 + else
1.129 + {
1.130 + ERR_PRINTF2(_L("Test CI method failed, error"), err);
1.131 + }
1.132 + }
1.133 + else
1.134 + {
1.135 + WARN_PRINTF1(_L("Failed to retrieve the custom interface."));
1.136 + iTestStepResult = EInconclusive;
1.137 + }
1.138 +
1.139 + return iTestStepResult;
1.140 + }