sl@0: // Copyright (c) 2003-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: #ifndef __TSU_MMF_CODECTESTS_H__ sl@0: #define __TSU_MMF_CODECTESTS_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "TSU_MMF_ACOD.h" sl@0: sl@0: const TInt KMaxMethods = 2; sl@0: sl@0: class CTestSuite ; sl@0: class CTestSuite_MMF_SwCodecDevices; sl@0: sl@0: //[ comparator class used to compare results in a unit test ] sl@0: class TComparator sl@0: { sl@0: public: sl@0: virtual TBool CompareL( TUint8* aData, TUint8* aData2, TInt aLength ); sl@0: }; sl@0: sl@0: //[Comparator class used when the results differ] sl@0: template sl@0: class TDbComparator : public TComparator sl@0: { sl@0: public: sl@0: virtual TBool CompareL( TUint8* aData, TUint8* aData2, TInt aLength ); sl@0: }; sl@0: sl@0: sl@0: class TCodecUnitTestParams; sl@0: template sl@0: class CTestStepCodecUnitTest : public CTestStep_MMF_SwCodecDevices sl@0: { sl@0: public: sl@0: CTestStepCodecUnitTest( TUint aTestIndex ); sl@0: virtual ~CTestStepCodecUnitTest(); sl@0: virtual enum TVerdict DoTestStepL(); sl@0: virtual TVerdict DoTestStepPreambleL(void); sl@0: virtual TVerdict DoTestStepPostambleL(void); sl@0: public: sl@0: // set up typedef for pointer to dispatch function sl@0: typedef void (CTestStepCodecUnitTest::*pCallBack)(CMMFDataBuffer* &aBuffer, const TDesC& aFile ); sl@0: typedef void (CTestStepCodecUnitTest::*pPrintFormatCallBack)(TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength); sl@0: sl@0: virtual void ReadWavFileL( CMMFDataBuffer* &aBuffer, const TDesC& aFile ); sl@0: virtual void ReadAuFileL( CMMFDataBuffer* &aBuffer, const TDesC& aFile ); sl@0: TInt ReadIntB( RFile& aFile, TInt& aValue ); sl@0: TInt ComputeBuffersToProcess(); sl@0: TInt ReadInt( RFile& aFile, TInt& aValue ); sl@0: protected: sl@0: virtual void Print8BitResults( TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength ); sl@0: virtual void Print16BitResults( TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength ); sl@0: protected: sl@0: const TCodecUnitTestParams *iTestParameters; sl@0: Comparator iComparator; sl@0: T* iCodecUnderTest; // The Codec Under Test sl@0: CMMFDataBuffer* iSourceData; // reference source data sl@0: CMMFDataBuffer* iCodedData; // coded data sl@0: CMMFDataBuffer* iRefCodedData; // reference coded data sl@0: RFs iFs; // file server sl@0: pCallBack iReaders[KMaxMethods]; //[Configurable file readers] sl@0: pPrintFormatCallBack iPrintFormats[KMaxMethods]; //[ configurable print formats ] sl@0: }; sl@0: sl@0: #endif