os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcig729decoderconfig.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "teststepcig729decoderconfig.h"
    17 
    18 
    19 TVerdict CTestStepCIG729DecoderConfig::DoTestStepL()
    20 	{
    21 	iTestStepResult = ETestSuiteError;
    22 
    23 	INFO_PRINTF1(_L("Initializing test CI device"));
    24 
    25 	if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0049-HP")) == 0)
    26 		{
    27 		iTestStepResult = DoTestStep0049L();
    28 		}
    29 	else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0050-HP")) == 0)
    30 		{
    31 		iTestStepResult = DoTestStep0050L();
    32 		}
    33 
    34 	return iTestStepResult;
    35 	}
    36 
    37 
    38 TVerdict CTestStepCIG729DecoderConfig::DoTestStep0049L()
    39 	{
    40 	iTestStepResult = EFail;
    41 	
    42 	INFO_PRINTF1(_L("G729DecoderIntfc - Instantiating"));
    43 
    44 	//Initialize - with the UID of our test HwDevice
    45 	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
    46 	TUid testUID = {KUidG729DecoderConfigTestDevice}; 
    47 	#else
    48 	TFourCC testUID('T','0','0','9');
    49 	#endif
    50 		
    51 	iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
    52 
    53 	if (iTestStepResult != EPass)
    54 		{
    55 		INFO_PRINTF1(_L("DevSound failed to instantiate test device"));
    56 		return EInconclusive;
    57 		}
    58 
    59 	// reset the value as previous test is pass
    60 	iTestStepResult = EFail;  
    61 
    62 	// KUidG729DecoderIntfc
    63 	MG729DecoderIntfc* ptr = static_cast <MG729DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG729DecoderIntfc));
    64 
    65 	if (ptr)
    66 		{
    67 		INFO_PRINTF1(_L("MG729DecoderIntfc instantiated successfully"));
    68 
    69 		iTestStepResult = EPass;
    70 		}
    71 	else
    72 		{
    73 		INFO_PRINTF1(_L("MG729DecoderIntfc failed to retrieve the interface"));
    74 		iTestStepResult = EInconclusive;
    75 		}
    76 
    77 	return iTestStepResult;
    78 	}
    79 
    80 
    81 TVerdict CTestStepCIG729DecoderConfig::DoTestStep0050L()
    82 	{
    83 	iTestStepResult = EFail;
    84 	TInt result = KErrGeneral;
    85 
    86 	INFO_PRINTF1(_L("G729DecoderIntfc - BadLsfNextBuffer"));
    87 
    88 	//Initialize - with the UID of our test HwDevice
    89 	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
    90 	TUid testUID = {KUidG729DecoderConfigTestDevice}; 
    91 	#else
    92 	TFourCC testUID('T','0','0','9');
    93 	#endif
    94 	
    95 	iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
    96 
    97 	if (iTestStepResult != EPass)
    98 		{
    99 		INFO_PRINTF1(_L("DevSound failed to instantiate test device"));
   100 		return EInconclusive;
   101 		}
   102 
   103 	// reset the value as previous test is pass
   104 	iTestStepResult = EFail;  
   105 
   106 	// KUidG729DecoderIntfc
   107 	MG729DecoderIntfc* ptr = static_cast <MG729DecoderIntfc*> (iMMFDevSound->CustomInterface(KUidG729DecoderIntfc));
   108 
   109 	if (ptr)
   110 		{
   111 		result = ptr->BadLsfNextBuffer(); // call method
   112 		
   113 		if (result == KErrNone)
   114 			{
   115 			INFO_PRINTF1(_L("MG729DecoderIntfc::BadLsfNextBuffer finished successfully"));
   116 
   117 			iTestStepResult = EPass;
   118 			}
   119 		else
   120 			{
   121 			ERR_PRINTF2(_L("MG729DecoderIntfc::BadLsfNextBuffer failed with result %d"), result);
   122 			}
   123 		}
   124 	else
   125 		{
   126 		INFO_PRINTF1(_L("MG729DecoderIntfc failed to retrieve the interface"));
   127 		iTestStepResult = EInconclusive;
   128 		}
   129 
   130 	return iTestStepResult;
   131 	}