1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/SwCodecDevices/TSU_MMF_DeviceSuite.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,183 @@
1.4 +// Copyright (c) 2002-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 +// TSU_MMF_SwCodecDevicesSuite.cpp
1.18 +// This main DLL entry point for the TSU_MMF_SWCODECDEVICES.dll
1.19 +//
1.20 +//
1.21 +
1.22 +// EPOC includes
1.23 +#include <e32base.h>
1.24 +
1.25 +// Test system includes
1.26 +#include "TSU_MMF_DeviceSuite.h"
1.27 +#include "TSU_MMF_SWCODECDEVICES.h"
1.28 +#include "tsu_mmf_CodecTests.h"
1.29 +#include "TSU_MMF_SignConversionCodecs.h"
1.30 +#include "TSU_MMF_Loop.h"
1.31 +#include "TSU_MMF_Oom.h"
1.32 +//[ actual codec includes ]
1.33 +#include "MmfPcm16toAlawhwDevice.h"
1.34 +#include "MmfALawToPcm16HwDevice.h"
1.35 +#include "GSM610.H"
1.36 +#include "MmfImaAdpcmtopcm16hwdevice.h"
1.37 +#include "MmfMuLawToPcm16hwDevice.h"
1.38 +#include "mmfpcm16SwapEndianhwdevice.h"
1.39 +#include "mmfpcm16ToImaAdpcm.h"
1.40 +#include "mmfpcm16toMulawhwdevice.h"
1.41 +#include "mmfpcm16topcmU16BEHwDevice.h"
1.42 +#include "MMFpcm16ToPcmU8HwDevice.h"
1.43 +#include "MMFpcm16ToPcmU8HwDevice.h"
1.44 +#include "mmfpcmS16PcmS8HwDevice.h"
1.45 +#include "mmfpcmS16topcmU16Codec.h"
1.46 +#include "mmfpcmS8ToPcmS16HwDevice.h"
1.47 +#include "mmfpcmU16BeToPcmS16HwDevice.h"
1.48 +#include "mmfpcmU16TopcmS16HwDevice.h"
1.49 +#include "MMFpcmU8ToPcm16HwDevice.h"
1.50 +
1.51 +
1.52 +/**
1.53 + * NewTestSuite is exported at ordinal 1
1.54 + * this provides the interface to allow schedule test
1.55 + * to create instances of this test suite
1.56 + */
1.57 +EXPORT_C CTestSuite_MMF_SwCodecDevices* NewTestSuiteL()
1.58 + {
1.59 + CTestSuite_MMF_SwCodecDevices* result = new (ELeave) CTestSuite_MMF_SwCodecDevices;
1.60 + CleanupStack::PushL(result);
1.61 + result->ConstructL();
1.62 + CleanupStack::Pop(1, result); // result
1.63 + return result;
1.64 + }
1.65 +
1.66 +//destructor
1.67 +CTestSuite_MMF_SwCodecDevices::~CTestSuite_MMF_SwCodecDevices()
1.68 + {
1.69 + }
1.70 +
1.71 +//Get Test Suite version
1.72 +_LIT(KTxtVersion,"0.1");
1.73 +TPtrC CTestSuite_MMF_SwCodecDevices::GetVersion( void )
1.74 + {
1.75 + return KTxtVersion();
1.76 + }
1.77 +
1.78 +/**
1.79 + *
1.80 + * Add a test step into the suite
1.81 + * @param "CTestStep_MMF_SwCodecDevices* aPtrTestStep"
1.82 + * Test step pointer
1.83 + */
1.84 +void CTestSuite_MMF_SwCodecDevices::AddTestStepL( CTestStep_MMF_SwCodecDevices* aPtrTestStep )
1.85 + {
1.86 + // test steps contain a pointer back to the suite which owns them
1.87 + aPtrTestStep->SetSuite(this);
1.88 + // add the step using tyhe base class method
1.89 + CTestSuite::AddTestStepL(aPtrTestStep);
1.90 + }
1.91 +
1.92 +/**
1.93 + * Constructor for test suite
1.94 + * this creates all the test steps and
1.95 + * stores them inside CTestSuite_MMF_SWCODECDEVICES
1.96 + */
1.97 +void CTestSuite_MMF_SwCodecDevices::InitialiseL( void )
1.98 + {
1.99 + // store the name of this test suite
1.100 + InitSystemPath();
1.101 + iSuiteName = _L("TSU_MMF_SWCODECDEVICES");
1.102 +
1.103 + AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0001() );
1.104 + AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0002() );
1.105 + AddTestStepL( new(ELeave) CTest_MMF_SwCodecDevices_U_0003() );
1.106 + AddTestStepL( new(ELeave) CTestALawCodec_U_0004());
1.107 + AddTestStepL( new(ELeave) CTestMuLawCodec_U_0006());
1.108 +
1.109 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16SwapEndianCodec,TComparator,0,1,1>(0));
1.110 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToImaAdpcmCodec,TComparator>(1) );
1.111 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFImaAdpcmToPcm16Codec,TDbComparator<>,0,0,1>(2));
1.112 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToPcmU8Codec,TComparator>(3));
1.113 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcmU8ToPcm16Codec,TDbComparator<>,0,0,1>(4));
1.114 + AddTestStepL( new(ELeave) CTestStepCodecUnitTest<CMMFPcm16ToPcmU8Codec,TComparator>(5));
1.115 +
1.116 + AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16ToPcmU8Codec,CMMFPcm16ToPcmU8Generator,0>());
1.117 + AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm8ToPcm16Codec,CMMFPcm8ToPcm16Generator,1>());
1.118 + AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16SwapEndianCodec,CMMFPcmU16toPcmU16BGenerator,2>());
1.119 + AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcm16SwapEndianCodec,CMMFPcmU16BtoPcmU16Generator,3>());
1.120 + AddTestStepL( new(ELeave) CTestStepSignConversionTest<CMMFPcmU8ToPcm16Codec,CMMFPcmU8ToPcm16Generator,4>());
1.121 +
1.122 + AddTestStepL( new(ELeave) CTestIMaadCodec());
1.123 +
1.124 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToALawCodec>(0));
1.125 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFAlawToPcm16Codec>(1));
1.126 + AddTestStepL( new(ELeave) CTestStepGsm610ToPcm16OomTest(2));
1.127 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFImaAdpcmToPcm16Codec>(3));
1.128 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFMulawToPcm16Codec>(4));
1.129 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16SwapEndianCodec>(5));
1.130 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToImaAdpcmCodec>(6));
1.131 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToMuLawCodec>(7));
1.132 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16BECodec>(8));
1.133 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU8Codec>(9));
1.134 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcmS16ToPcmS8Codec>(10));
1.135 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16CodecCodec>(11));
1.136 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm8ToPcm16Codec>(12));
1.137 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcmU16BeToPcmS16Codec>(13));
1.138 + AddTestStepL( new(ELeave) CTestStepOomTest<CMMFPcm16ToPcmU16CodecCodec>(14));
1.139 + AddTestStepL( new(ELeave) CTestStepPcm16ToGsm610OomTest(15));
1.140 +
1.141 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToALawCodec>(0));
1.142 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFAlawToPcm16Codec>(1));
1.143 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFGsm610ToPcm16Codec>(2));
1.144 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFImaAdpcmToPcm16Codec>(3));
1.145 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFMulawToPcm16Codec>(4));
1.146 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16SwapEndianCodec>(5));
1.147 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToImaAdpcmCodec>(6));
1.148 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToMuLawCodec>(7));
1.149 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16BECodec>(8));
1.150 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU8Codec>(9));
1.151 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcmS16ToPcmS8Codec>(10));
1.152 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16CodecCodec>(11));
1.153 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm8ToPcm16Codec>(12));
1.154 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcmU16BeToPcmS16Codec>(13));
1.155 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToPcmU16CodecCodec>(14));
1.156 + AddTestStepL( new(ELeave) CTestStepLoopTest<CMMFPcm16ToGsm610Codec>(15));
1.157 +
1.158 + }
1.159 +
1.160 +/**
1.161 +*
1.162 +* InitSystemPath
1.163 +* This sets up the default path
1.164 +*
1.165 +*/
1.166 +void CTestSuite_MMF_SwCodecDevices::InitSystemPath()
1.167 + {
1.168 + _LIT(KAudioStremOutSourcePathOnC,"c:\\mm\\mmf\\testfiles\\SwCodecDevices\\");
1.169 +
1.170 + RFs fs;
1.171 + TUint att;
1.172 + TInt ret = fs.Connect();
1.173 + __ASSERT_ALWAYS(ret == KErrNone,User::Panic(_L("Sys path not setup"),ret));
1.174 +
1.175 + if (fs.Att(KAudioStremOutSourcePathOnC, att) == KErrNone)
1.176 + iDefaultPath = KAudioStremOutSourcePathOnC;
1.177 + else
1.178 + User::Panic(_L("Test files not found"),KErrNotFound);
1.179 +
1.180 + fs.Close();
1.181 + }
1.182 +
1.183 +const TDesC& CTestSuite_MMF_SwCodecDevices::DefaultPath() const
1.184 + {
1.185 + return iDefaultPath;
1.186 + }