sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "teststepciilbcdecoderconfig.h" sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcDecoderConfig::DoTestStepL() sl@0: { sl@0: iTestStepResult = ETestSuiteError; sl@0: sl@0: INFO_PRINTF1(_L("Initializing test CI device")); sl@0: sl@0: if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0054-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0054L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0055-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0055L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0056-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0056L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0057-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0057L(); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcDecoderConfig::DoTestStep0054L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("IlbcDecoderIntfc - Instantiating")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcDecoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','7'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidIlbcDecoderIntfc sl@0: MIlbcDecoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcDecoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc instantiated successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MIlbcDecoderIntfc failed to retrieve the interface")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcDecoderConfig::DoTestStep0055L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcDecoderIntfc - SetDecoderMode")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcDecoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','7'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidIlbcDecoderIntfc sl@0: MIlbcDecoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcDecoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: MIlbcDecoderIntfc::TDecodeMode decodeMode = MIlbcDecoderIntfc::E30msFrame; sl@0: TInt setDecodeMode = MIlbcDecoderIntfc::E20msFrame; sl@0: sl@0: result = ptr->SetDecoderMode(decodeMode); // call method sl@0: sl@0: // This file is created by the test stub, the plugin device sl@0: _LIT(KFileName, "c:\\temp\\IlbcDecoderConfig.txt"); sl@0: sl@0: ReadFileL(KFileName, setDecodeMode); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: if (static_cast(setDecodeMode) == decodeMode) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::SetDecoderMode finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetDecoderMode failed with decodeMode %d"), decodeMode); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetDecoderMode failed with error %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcDecoderConfig::DoTestStep0056L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcDecoderIntfc - SetComfortNoiseGeneration")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcDecoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','7'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidIlbcDecoderIntfc sl@0: MIlbcDecoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcDecoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TBool cng = ETrue; sl@0: sl@0: result = ptr->SetComfortNoiseGeneration(cng); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration finished successfully")); sl@0: sl@0: result = ptr->GetComfortNoiseGeneration(cng); sl@0: sl@0: if ( (result == KErrNone) && cng) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration finished successfully")); sl@0: sl@0: result = ptr->SetComfortNoiseGeneration(EFalse); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration finished successfully")); sl@0: sl@0: result = ptr->GetComfortNoiseGeneration(cng); sl@0: sl@0: if ( (result == KErrNone) && !cng) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcDecoderConfig::DoTestStep0057L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcDecoderIntfc - GetComfortNoiseGeneration")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcDecoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','7'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidIlbcDecoderIntfc sl@0: MIlbcDecoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcDecoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TBool cng = ETrue; sl@0: sl@0: result = ptr->SetComfortNoiseGeneration(cng); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::SetCng finished successfully")); sl@0: sl@0: result = ptr->GetComfortNoiseGeneration(cng); sl@0: sl@0: if ( (result == KErrNone) && cng) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration finished successfully")); sl@0: sl@0: result = ptr->SetComfortNoiseGeneration(EFalse); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration finished successfully")); sl@0: sl@0: result = ptr->GetComfortNoiseGeneration(cng); sl@0: sl@0: if ( (result == KErrNone) && !cng) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcDecoderIntfc::GetComfortNoiseGeneration failed with result %d cng %d"), result, cng); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetComfortNoiseGeneration failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcDecoderIntfc::GetCng failed with result %d cng %d"), result, cng); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcDecoderIntfc::SetCng failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcDecoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: }