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 "teststepcisbcencoder.h" sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoder::CTestStepCISbcEncoder() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0020-HP"); sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: TVerdict CTestStepCISbcEncoder::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: sl@0: if (interface) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully retrieved the interface.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedFrequencies::CTestStepCISbcEncoderGetSupportedFrequencies() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0021-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedFrequencies::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Sampling Frequencies")); sl@0: sl@0: RArray frequencies; sl@0: CleanupClosePushL(frequencies); sl@0: TInt err = interface->GetSupportedSamplingFrequencies(frequencies); sl@0: sl@0: // Data is hard coded in the test HwDevice implementation sl@0: // to add 10 values from 0 to 9000 in intervals of 1000. sl@0: TBool validValues = ValidateArray(frequencies); sl@0: if (err == KErrNone && validValues) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the frequencies.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the frequencies")); sl@0: } sl@0: CleanupStack::PopAndDestroy(); // frequencies sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: INFO_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TBool CTestStepCISbcEncoderGetSupportedFrequencies::ValidateArray(const RArray& aArray) const sl@0: { sl@0: TBool iTestStepResult = ETrue; sl@0: sl@0: TInt count = aArray.Count(); sl@0: if (count != 10) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: else sl@0: { sl@0: TUint val = 0; sl@0: for (TInt i = 0; i < count; i++) sl@0: { sl@0: if (aArray[i] != val) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: break; sl@0: } sl@0: val += 1000; sl@0: } sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedSubbands::CTestStepCISbcEncoderGetSupportedSubbands() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0023-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedSubbands::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Number Of Subbands")); sl@0: sl@0: RArray subbands; sl@0: CleanupClosePushL(subbands); sl@0: TInt err = interface->GetSupportedNumOfSubbands(subbands); sl@0: sl@0: // Data is hard coded in the test HwDevice implementation sl@0: // to add 5 values from 100 to 500 in intervals of 100. sl@0: TBool validValues = ValidateArray(subbands); sl@0: if (err == KErrNone && validValues) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the subbands.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the subbands")); sl@0: } sl@0: CleanupStack::PopAndDestroy(); // subbands sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: INFO_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TBool CTestStepCISbcEncoderGetSupportedSubbands::ValidateArray(const RArray& aArray) const sl@0: { sl@0: TBool iTestStepResult = ETrue; sl@0: sl@0: TInt count = aArray.Count(); sl@0: if (count != 5) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: else sl@0: { sl@0: TUint val = 100; sl@0: for (TInt i = 0; i < count; i++) sl@0: { sl@0: if (aArray[i] != val) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: break; sl@0: } sl@0: val += 100; sl@0: } sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedNumOfBlocks::CTestStepCISbcEncoderGetSupportedNumOfBlocks() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0025-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedNumOfBlocks::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Number Of Supported Blocks")); sl@0: sl@0: RArray blocks; sl@0: CleanupClosePushL(blocks); sl@0: TInt err = interface->GetSupportedNumOfBlocks(blocks); sl@0: sl@0: // Data is hard coded in the test HwDevice implementation sl@0: // to add 10 values from 1 to 10 sl@0: TBool validValues = ValidateArray(blocks); sl@0: if (err == KErrNone && validValues) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the blocks.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the blocks")); sl@0: } sl@0: CleanupStack::PopAndDestroy(); // blocks sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: INFO_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TBool CTestStepCISbcEncoderGetSupportedNumOfBlocks::ValidateArray(const RArray& aArray) const sl@0: { sl@0: TBool iTestStepResult = ETrue; sl@0: sl@0: TInt count = aArray.Count(); sl@0: if (count != 10) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: else sl@0: { sl@0: TUint val = 1; sl@0: for (TInt i = 0; i < count; i++) sl@0: { sl@0: if (aArray[i] != val) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: break; sl@0: } sl@0: val++; sl@0: } sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedChannelModes::CTestStepCISbcEncoderGetSupportedChannelModes() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0022-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedChannelModes::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Channel Modes")); sl@0: sl@0: RArray modes; sl@0: CleanupClosePushL(modes); sl@0: TInt err = interface->GetSupportedChannelModes(modes); sl@0: sl@0: // Data is hard coded in the test HwDevice implementation sl@0: // to add the 4 available values sl@0: TBool validValues = ValidateArray(modes); sl@0: if (err == KErrNone && validValues) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the supported modes.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the supported modes")); sl@0: } sl@0: CleanupStack::PopAndDestroy(); // modes sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: INFO_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TBool CTestStepCISbcEncoderGetSupportedChannelModes::ValidateArray(const RArray& aArray) const sl@0: { sl@0: TBool iTestStepResult = ETrue; sl@0: sl@0: TInt count = aArray.Count(); sl@0: if (count != 4) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: else sl@0: { sl@0: if ((aArray[0] != MSbcEncoderIntfc::ESbcChannelMono) || sl@0: (aArray[1] != MSbcEncoderIntfc::ESbcChannelDual) || sl@0: (aArray[2] != MSbcEncoderIntfc::ESbcChannelStereo) || sl@0: (aArray[3] != MSbcEncoderIntfc::ESbcChannelJointStereo)) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedAllocationMethods::CTestStepCISbcEncoderGetSupportedAllocationMethods() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0024-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedAllocationMethods::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Allocation Methods")); sl@0: sl@0: RArray allocMethods; sl@0: CleanupClosePushL(allocMethods); sl@0: TInt err = interface->GetSupportedAllocationMethods(allocMethods); sl@0: sl@0: // Data is hard coded in the test HwDevice implementation sl@0: // to add the 2 available allocation methods sl@0: TBool validValues = ValidateArray(allocMethods); sl@0: if (err == KErrNone && validValues) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the allocation methods.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the allocation methods")); sl@0: } sl@0: CleanupStack::PopAndDestroy(); // allocMethods sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TBool CTestStepCISbcEncoderGetSupportedAllocationMethods::ValidateArray(const RArray< sl@0: MSbcEncoderIntfc::TSbcAllocationMethod>& sl@0: aArray) const sl@0: { sl@0: TBool iTestStepResult = ETrue; sl@0: sl@0: TInt count = aArray.Count(); sl@0: if (count != 2) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: else sl@0: { sl@0: if ((aArray[0] != MSbcEncoderIntfc::ESbcAllocationSNR) || sl@0: (aArray[1] != MSbcEncoderIntfc::ESbcAllocationLoudness)) sl@0: { sl@0: iTestStepResult = EFalse; sl@0: } sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSupportedBitpoolRange::CTestStepCISbcEncoderGetSupportedBitpoolRange() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0026-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSupportedBitpoolRange::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Bitpool Range")); sl@0: TUint minSize = 0; sl@0: TUint maxSize = 0; sl@0: TInt err = interface->GetSupportedBitpoolRange(minSize, maxSize); sl@0: sl@0: // Hard coded min and max values in the test device sl@0: if ((err == KErrNone) && sl@0: (minSize == 1) && sl@0: (maxSize == 2)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully got the bitpool range.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to get the bitpool range")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetFrequency::CTestStepCISbcEncoderGetSetFrequency(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0034-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0027-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetFrequency::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Sampling Frequency")); sl@0: sl@0: TUint frequency = 666; sl@0: interface->SetSamplingFrequency(frequency); sl@0: sl@0: TUint testFreq = 0; sl@0: TInt err = interface->GetSamplingFrequency(testFreq); sl@0: if (err == KErrNone && (frequency == testFreq)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the frequency.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the frequency.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the frequency")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the frequency")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetChannelMode::CTestStepCISbcEncoderGetSetChannelMode(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0035-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0028-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetChannelMode::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Channel Mode")); sl@0: MSbcEncoderIntfc::TSbcChannelMode channelMode = MSbcEncoderIntfc::ESbcChannelStereo; sl@0: interface->SetChannelMode(channelMode); sl@0: sl@0: MSbcEncoderIntfc::TSbcChannelMode testChannelMode = MSbcEncoderIntfc::ESbcChannelMono; sl@0: TInt err = interface->GetChannelMode(testChannelMode); sl@0: if ((err == KErrNone) && (channelMode == testChannelMode)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the channel mode.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the channel mode.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get channel mode")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set channel mode")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetNumOfSubbands::CTestStepCISbcEncoderGetSetNumOfSubbands(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0036-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0029-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetNumOfSubbands::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Number of Subbands")); sl@0: TUint numOfSubbands = 6; sl@0: interface->SetNumOfSubbands(numOfSubbands); sl@0: sl@0: TUint testSubbands = 0; sl@0: TInt err = interface->GetNumOfSubbands(testSubbands); sl@0: if (err == KErrNone && (testSubbands == numOfSubbands)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got subbands.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set subbands.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get subbands.")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set subbands.")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetNumOfBlocks::CTestStepCISbcEncoderGetSetNumOfBlocks(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0037-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0030-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetNumOfBlocks::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Number of Blocks")); sl@0: TUint numOfBlocks = 6; sl@0: interface->SetNumOfBlocks(numOfBlocks); sl@0: TUint testBlocks = 0; sl@0: TInt err = interface->GetNumOfBlocks(testBlocks); sl@0: if ((err == KErrNone) && (numOfBlocks == testBlocks)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the number of blocks.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the number of blocks.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the number of blocks.")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the number of blocks.")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetAllocationMethod::CTestStepCISbcEncoderGetSetAllocationMethod(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0038-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0031-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetAllocationMethod::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Allocation Method")); sl@0: MSbcEncoderIntfc::TSbcAllocationMethod allocationMethod = MSbcEncoderIntfc::ESbcAllocationLoudness; sl@0: interface->SetAllocationMethod(allocationMethod); sl@0: sl@0: MSbcEncoderIntfc::TSbcAllocationMethod testAllocationMethod; sl@0: TInt err = interface->GetAllocationMethod(testAllocationMethod); sl@0: if ((err == KErrNone) && (allocationMethod == testAllocationMethod)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the allocation method.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the allocation method.")); sl@0: } } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the allocation method.")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the allocation method.")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderGetSetBitpoolSize::CTestStepCISbcEncoderGetSetBitpoolSize(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0039-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0032-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderGetSetBitpoolSize::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the SBC Encoder's Bitpool Size")); sl@0: TUint bitpoolSize = 6; sl@0: interface->SetBitpoolSize(bitpoolSize); sl@0: sl@0: TUint testBitpoolSize = 0; sl@0: TInt err = interface->GetBitpoolSize(testBitpoolSize); sl@0: if ((err == KErrNone) && (bitpoolSize == testBitpoolSize)) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the bitpool size.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the bitpool size.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the bitpool size.")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the bitpool size.")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCISbcEncoderApplyConfig::CTestStepCISbcEncoderApplyConfig() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0033-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCISbcEncoderApplyConfig::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test SBC Encoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidSbcEncoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','3'); sl@0: #endif sl@0: sl@0: MSbcEncoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Applying the config to the SBC Encoder")); sl@0: TInt err = interface->ApplyConfig(); sl@0: if (err == KErrNone) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully applied the config.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF2(_L("Failed to apply the config, error: %d"), err); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: return iTestStepResult; sl@0: }