sl@0
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __TSU_MMF_CODECTESTS_H__
|
sl@0
|
17 |
#define __TSU_MMF_CODECTESTS_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <testframework.h>
|
sl@0
|
20 |
#include <mmf/server/mmfcodec.h>
|
sl@0
|
21 |
#include <mmf/server/mmfbuffer.h>
|
sl@0
|
22 |
#include <mmf/server/mmfdatabuffer.h>
|
sl@0
|
23 |
#include <mmf/common/mmfutilities.h>
|
sl@0
|
24 |
#include <mmf/common/mmffourcc.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
#include <mmf/common/mmfcontroller.h>
|
sl@0
|
27 |
#include <mmf/common/mmfcontrollerpluginresolver.h>
|
sl@0
|
28 |
#include <mmf/plugin/mmfplugininterfaceuids.hrh>
|
sl@0
|
29 |
#include "TSU_MMF_ACOD.h"
|
sl@0
|
30 |
|
sl@0
|
31 |
const TInt KMaxMethods = 2;
|
sl@0
|
32 |
|
sl@0
|
33 |
class CTestSuite ;
|
sl@0
|
34 |
class CTestSuite_MMF_SwCodecDevices;
|
sl@0
|
35 |
|
sl@0
|
36 |
//[ comparator class used to compare results in a unit test ]
|
sl@0
|
37 |
class TComparator
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:
|
sl@0
|
40 |
virtual TBool CompareL( TUint8* aData, TUint8* aData2, TInt aLength );
|
sl@0
|
41 |
};
|
sl@0
|
42 |
|
sl@0
|
43 |
//[Comparator class used when the results differ]
|
sl@0
|
44 |
template <TInt T= -300>
|
sl@0
|
45 |
class TDbComparator : public TComparator
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
virtual TBool CompareL( TUint8* aData, TUint8* aData2, TInt aLength );
|
sl@0
|
49 |
};
|
sl@0
|
50 |
|
sl@0
|
51 |
|
sl@0
|
52 |
class TCodecUnitTestParams;
|
sl@0
|
53 |
template <class T, class Comparator, TInt a=0, TInt b=0, TInt c = 0>
|
sl@0
|
54 |
class CTestStepCodecUnitTest : public CTestStep_MMF_SwCodecDevices
|
sl@0
|
55 |
{
|
sl@0
|
56 |
public:
|
sl@0
|
57 |
CTestStepCodecUnitTest( TUint aTestIndex );
|
sl@0
|
58 |
virtual ~CTestStepCodecUnitTest();
|
sl@0
|
59 |
virtual enum TVerdict DoTestStepL();
|
sl@0
|
60 |
virtual TVerdict DoTestStepPreambleL(void);
|
sl@0
|
61 |
virtual TVerdict DoTestStepPostambleL(void);
|
sl@0
|
62 |
public:
|
sl@0
|
63 |
// set up typedef for pointer to dispatch function
|
sl@0
|
64 |
typedef void (CTestStepCodecUnitTest::*pCallBack)(CMMFDataBuffer* &aBuffer, const TDesC& aFile );
|
sl@0
|
65 |
typedef void (CTestStepCodecUnitTest::*pPrintFormatCallBack)(TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength);
|
sl@0
|
66 |
|
sl@0
|
67 |
virtual void ReadWavFileL( CMMFDataBuffer* &aBuffer, const TDesC& aFile );
|
sl@0
|
68 |
virtual void ReadAuFileL( CMMFDataBuffer* &aBuffer, const TDesC& aFile );
|
sl@0
|
69 |
TInt ReadIntB( RFile& aFile, TInt& aValue );
|
sl@0
|
70 |
TInt ComputeBuffersToProcess();
|
sl@0
|
71 |
TInt ReadInt( RFile& aFile, TInt& aValue );
|
sl@0
|
72 |
protected:
|
sl@0
|
73 |
virtual void Print8BitResults( TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength );
|
sl@0
|
74 |
virtual void Print16BitResults( TUint8* aRefCodedData, TUint8* aCodedData, TInt aDataLength );
|
sl@0
|
75 |
protected:
|
sl@0
|
76 |
const TCodecUnitTestParams *iTestParameters;
|
sl@0
|
77 |
Comparator iComparator;
|
sl@0
|
78 |
T* iCodecUnderTest; // The Codec Under Test
|
sl@0
|
79 |
CMMFDataBuffer* iSourceData; // reference source data
|
sl@0
|
80 |
CMMFDataBuffer* iCodedData; // coded data
|
sl@0
|
81 |
CMMFDataBuffer* iRefCodedData; // reference coded data
|
sl@0
|
82 |
RFs iFs; // file server
|
sl@0
|
83 |
pCallBack iReaders[KMaxMethods]; //[Configurable file readers]
|
sl@0
|
84 |
pPrintFormatCallBack iPrintFormats[KMaxMethods]; //[ configurable print formats ]
|
sl@0
|
85 |
};
|
sl@0
|
86 |
|
sl@0
|
87 |
#endif
|