os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcig729decoderconfig.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcig729decoderconfig.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,131 @@
     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 "teststepcig729decoderconfig.h"
    1.20 +
    1.21 +
    1.22 +TVerdict CTestStepCIG729DecoderConfig::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-0049-HP")) == 0)
    1.29 +		{
    1.30 +		iTestStepResult = DoTestStep0049L();
    1.31 +		}
    1.32 +	else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0050-HP")) == 0)
    1.33 +		{
    1.34 +		iTestStepResult = DoTestStep0050L();
    1.35 +		}
    1.36 +
    1.37 +	return iTestStepResult;
    1.38 +	}
    1.39 +
    1.40 +
    1.41 +TVerdict CTestStepCIG729DecoderConfig::DoTestStep0049L()
    1.42 +	{
    1.43 +	iTestStepResult = EFail;
    1.44 +	
    1.45 +	INFO_PRINTF1(_L("G729DecoderIntfc - Instantiating"));
    1.46 +
    1.47 +	//Initialize - with the UID of our test HwDevice
    1.48 +	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
    1.49 +	TUid testUID = {KUidG729DecoderConfigTestDevice}; 
    1.50 +	#else
    1.51 +	TFourCC testUID('T','0','0','9');
    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 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 +	// KUidG729DecoderIntfc
    1.66 +	MG729DecoderIntfc* ptr = static_cast <MG729DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG729DecoderIntfc));
    1.67 +
    1.68 +	if (ptr)
    1.69 +		{
    1.70 +		INFO_PRINTF1(_L("MG729DecoderIntfc instantiated successfully"));
    1.71 +
    1.72 +		iTestStepResult = EPass;
    1.73 +		}
    1.74 +	else
    1.75 +		{
    1.76 +		INFO_PRINTF1(_L("MG729DecoderIntfc failed to retrieve the interface"));
    1.77 +		iTestStepResult = EInconclusive;
    1.78 +		}
    1.79 +
    1.80 +	return iTestStepResult;
    1.81 +	}
    1.82 +
    1.83 +
    1.84 +TVerdict CTestStepCIG729DecoderConfig::DoTestStep0050L()
    1.85 +	{
    1.86 +	iTestStepResult = EFail;
    1.87 +	TInt result = KErrGeneral;
    1.88 +
    1.89 +	INFO_PRINTF1(_L("G729DecoderIntfc - BadLsfNextBuffer"));
    1.90 +
    1.91 +	//Initialize - with the UID of our test HwDevice
    1.92 +	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
    1.93 +	TUid testUID = {KUidG729DecoderConfigTestDevice}; 
    1.94 +	#else
    1.95 +	TFourCC testUID('T','0','0','9');
    1.96 +	#endif
    1.97 +	
    1.98 +	iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
    1.99 +
   1.100 +	if (iTestStepResult != EPass)
   1.101 +		{
   1.102 +		INFO_PRINTF1(_L("DevSound failed to instantiate test device"));
   1.103 +		return EInconclusive;
   1.104 +		}
   1.105 +
   1.106 +	// reset the value as previous test is pass
   1.107 +	iTestStepResult = EFail;  
   1.108 +
   1.109 +	// KUidG729DecoderIntfc
   1.110 +	MG729DecoderIntfc* ptr = static_cast <MG729DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG729DecoderIntfc));
   1.111 +
   1.112 +	if (ptr)
   1.113 +		{
   1.114 +		result = ptr->BadLsfNextBuffer(); // call method
   1.115 +		
   1.116 +		if (result == KErrNone)
   1.117 +			{
   1.118 +			INFO_PRINTF1(_L("MG729DecoderIntfc::BadLsfNextBuffer finished successfully"));
   1.119 +
   1.120 +			iTestStepResult = EPass;
   1.121 +			}
   1.122 +		else
   1.123 +			{
   1.124 +			ERR_PRINTF2(_L("MG729DecoderIntfc::BadLsfNextBuffer failed with result %d"), result);
   1.125 +			}
   1.126 +		}
   1.127 +	else
   1.128 +		{
   1.129 +		INFO_PRINTF1(_L("MG729DecoderIntfc failed to retrieve the interface"));
   1.130 +		iTestStepResult = EInconclusive;
   1.131 +		}
   1.132 +
   1.133 +	return iTestStepResult;
   1.134 +	}