os/mm/devsound/a3fintegrationtest/src/tsi_a3f_devsound_testsuite.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/a3fintegrationtest/src/tsi_a3f_devsound_testsuite.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,195 @@
     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 +// This file contains the test suite class implementation for A3F DevSound Integration tests.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "tsi_a3f_devsound_testsuite.h"
    1.22 +#include "tsi_a3f_devsound_record.h"
    1.23 +#include "tsi_a3f_devsound_play.h"
    1.24 +#include "tsi_a3f_devsound_tone.h"
    1.25 +
    1.26 +/*
    1.27 + *
    1.28 + * NewTestSuiteL is exported at ordinal 1
    1.29 + * - this provides the interface to allow schedule test to create instances of this test suite
    1.30 + *
    1.31 + */
    1.32 +// Entry function - create a test suite object
    1.33 +EXPORT_C CTestSuiteA3FDevSound* CTestSuiteA3FDevSound::NewTestSuiteL()
    1.34 +	{
    1.35 +	return CTestSuiteA3FDevSound::NewL();
    1.36 +
    1.37 +	}
    1.38 +
    1.39 +/*
    1.40 + *
    1.41 + * NewL
    1.42 + *
    1.43 + */
    1.44 +CTestSuiteA3FDevSound* CTestSuiteA3FDevSound::NewL()
    1.45 +	{
    1.46 +	CTestSuiteA3FDevSound* result = new (ELeave) CTestSuiteA3FDevSound();
    1.47 +	CleanupStack::PushL(result);
    1.48 +	result->ConstructL();
    1.49 +	CleanupStack::Pop(result);
    1.50 +	return result;
    1.51 +
    1.52 +	}
    1.53 +
    1.54 +/*
    1.55 + *
    1.56 + * CTestSuiteA3FDevSound - Constructor
    1.57 + *
    1.58 + */
    1.59 +CTestSuiteA3FDevSound::CTestSuiteA3FDevSound()
    1.60 +	{
    1.61 +	iSuiteName = _L("TSI_A3F_DEVSOUND");
    1.62 +
    1.63 +	}
    1.64 +
    1.65 +/*
    1.66 + *
    1.67 + * ~CTestSuiteA3FDevSound - Destructor
    1.68 + *
    1.69 + */
    1.70 +CTestSuiteA3FDevSound::~CTestSuiteA3FDevSound()
    1.71 +	{
    1.72 +	}
    1.73 +
    1.74 +/*
    1.75 + * GetVersion
    1.76 + * - Get test suite version
    1.77 + *
    1.78 + */
    1.79 +TPtrC CTestSuiteA3FDevSound::GetVersion() const
    1.80 +	{
    1.81 +	_LIT(KTxtVersion, "1.0");
    1.82 +	return KTxtVersion();
    1.83 +
    1.84 +	}
    1.85 +
    1.86 +/*
    1.87 + *
    1.88 + * InitialiseL - Constructor for test suite
    1.89 + * - creates all the test steps and stores them inside CTestSuiteA3FDevSound
    1.90 + *
    1.91 + */
    1.92 +void CTestSuiteA3FDevSound::InitialiseL()
    1.93 +	{
    1.94 +	const TUint32 KMMFFourCCCodeInvalid = 0x414d5121;
    1.95 +	TFourCC fourCCCodePCM8(KMMFFourCCCodePCM8);
    1.96 +	TFourCC fourCCCodePCMU8(KMMFFourCCCodePCMU8);
    1.97 +	TFourCC fourCCCodePCM16(KMMFFourCCCodePCM16);
    1.98 +	TFourCC fourCCCodeMuLAW(KMMFFourCCCodeMuLAW);
    1.99 +	TFourCC fourCCCodeInvalid(KMMFFourCCCodeInvalid);
   1.100 +
   1.101 +	// to play AAC audio without OpenMAX IL HwDevice, use this FourCC code
   1.102 +	TFourCC fourCCCodeAAC(KMMFFourCCCodeAAC);
   1.103 +
   1.104 +	// to play AAC audio with OpenMAX IL HwDevice, use this FourCC code
   1.105 +	// note: IL HwDevice has been classified as AAC2 which is a test FourCC code and not a real one
   1.106 +	const TUint32 KMMFFourCCCodeAAC2 = 0x32434141; //('A','A','C','2')
   1.107 +	TFourCC fourCCCodeAAC2(KMMFFourCCCodeAAC2);
   1.108 +
   1.109 +	// DevSound PCM - Play test cases
   1.110 +
   1.111 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0001"), _L("SectionPCM-0001"), fourCCCodePCM16));
   1.112 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0002"), _L("SectionPCM-0002"), fourCCCodePCM16));
   1.113 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0003"), _L("SectionPCM-0003"), fourCCCodePCM16));
   1.114 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0004"), _L("SectionPCM-0004"), fourCCCodePCM16));
   1.115 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0005"), _L("SectionPCM-0005"), fourCCCodePCM16));
   1.116 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0006"), _L("SectionPCM-0006"), fourCCCodePCM16));
   1.117 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0007"), _L("SectionPCM-0007"), fourCCCodePCM16));
   1.118 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0008"), _L("SectionPCM-0008"), fourCCCodePCM16));
   1.119 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0009"), _L("SectionPCM-0009"), fourCCCodePCM16));
   1.120 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0010"), _L("SectionPCM-0010"), fourCCCodePCM16));
   1.121 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0011"), _L("SectionPCM-0011"), fourCCCodePCM16));
   1.122 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0012"), _L("SectionPCM-0012"), fourCCCodePCM16));
   1.123 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0013"), _L("SectionPCM-0013"), fourCCCodePCM16));
   1.124 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0014"), _L("SectionPCM-0014"), fourCCCodePCM16));
   1.125 +	AddTestStepL(RStepA3FDevSoundPlayEmpty::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0015"), _L("SectionPCM-0015"), fourCCCodePCM16));
   1.126 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0016"), _L("SectionPCM-0016"), fourCCCodePCM16));
   1.127 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0017"), _L("SectionPCM-0017"), fourCCCodeMuLAW));
   1.128 +	AddTestStepL(RStepA3FDevSoundPlayInvalidConfig::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0018"), _L("SectionPCM-0018"), fourCCCodePCM16));
   1.129 +	AddTestStepL(RStepA3FDevSoundPlayInvalidConfig::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0019"), _L("SectionPCM-0019"), fourCCCodePCM16));
   1.130 +	AddTestStepL(RStepA3FDevSoundPlayInvalidFourCC::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0020"), fourCCCodeInvalid));
   1.131 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0021"), _L("SectionPCM-0021"), fourCCCodePCM16));
   1.132 +	AddTestStepL(RStepA3FDevSoundPlayEOFPlayMultipleTimes::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0022"), _L("SectionPCM-0022")));
   1.133 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0023"), _L("SectionPCM-0023")));
   1.134 +	AddTestStepL(RStepA3FDevSoundPlayStopMultipleTimes::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0024"), _L("SectionPCM-0024"), fourCCCodePCM16));
   1.135 +	AddTestStepL(RStepA3FDevSoundReadConfigDuringPlay::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0025"), _L("SectionPCM-0025"), fourCCCodePCM16));
   1.136 +	AddTestStepL(RStepA3FDevSoundSetVolPlayStopGetVol::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0026"), _L("SectionPCM-0026"), fourCCCodePCM16));
   1.137 +	AddTestStepL(RStepA3FDevSoundFlushBuffersPaused::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0027"), _L("SectionPCM-0027"), fourCCCodePCM16));
   1.138 +	AddTestStepL(RStepA3FDevSoundInvalidStatePlay::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0028"), _L("SectionPCM-0028"), fourCCCodePCM16));
   1.139 +	AddTestStepL(RStepA3FDevSoundFlushBuffersPlaying::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0029"), _L("SectionPCM-0029"), fourCCCodePCM16));
   1.140 +	AddTestStepL(RStepA3FDevSoundInitializeWhilePlaying::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0030"), _L("SectionPCM-0030"), fourCCCodePCM16));
   1.141 +	AddTestStepL(RStepA3FDevSoundInitializeWithHwDeviceUID::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0031")));
   1.142 +	AddTestStepL(RStepA3FDevSoundSetBalanceDuringPlay::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0032"), _L("SectionPCM-0032"), fourCCCodePCM16));
   1.143 +	AddTestStepL(RStepA3FDevSoundGetSampleNumsAfterStop::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0033"), _L("SectionPCM-0033"), fourCCCodePCM16));
   1.144 +	AddTestStepL(RStepA3FDevSoundInititalizeDuringInitialize::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0034"), _L("SectionPCM-0034"), fourCCCodePCM16));
   1.145 +	AddTestStepL(RStepA3FDevSoundPlayInitDuringPlayInit::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0035"), _L("SectionPCM-0035"), fourCCCodePCM16));
   1.146 +	AddTestStepL(RStepA3FDevSoundVolumeCrop::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0036"), _L("SectionPCM-0036"), fourCCCodePCM16));
   1.147 +	AddTestStepL(RStepA3FDevSoundInitializeForConverting::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0037"), _L("SectionPCM-0037"), fourCCCodePCM16));
   1.148 +	AddTestStepL(RStepA3FDevSoundCancelInitializePlay::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0038"), _L("SectionPCM-0038"), fourCCCodePCM16));
   1.149 +	AddTestStepL(RStepA3FDevSoundNegCancelInitializePlay::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0039"), _L("SectionPCM-0039"), fourCCCodePCM16));
   1.150 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersInCreatedState::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0040")));
   1.151 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersInInitializedState::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0041"), _L("SectionPCM-0041"), fourCCCodePCM16));
   1.152 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersInInitializingState::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-I-0042"), _L("SectionPCM-0042"), fourCCCodePCM16));
   1.153 +
   1.154 +	// DevSound PCM - Long Play test cases
   1.155 +
   1.156 +	AddTestStepL(RStepA3FDevSoundPlaySimple::NewL(_L("MM-A3F-DEVSOUND-PLAY-PCM-LONG-I-0001"), _L("SectionPCM-Long-0001"), fourCCCodePCM16));
   1.157 +
   1.158 +	// DevSound PCM - Record test cases
   1.159 +
   1.160 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0001"), _L("SectionPCM-0001"), fourCCCodePCM16));
   1.161 +	AddTestStepL(RStepA3FDevSoundRecordMultipleTimes::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0002"), _L("SectionPCM-0002"), fourCCCodePCM16));
   1.162 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0003"), _L("SectionPCM-0003"), fourCCCodePCM16));
   1.163 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0004"), _L("SectionPCM-0004"), fourCCCodePCM16));
   1.164 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0005"), _L("SectionPCM-0005"), fourCCCodePCM16));
   1.165 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0006"), _L("SectionPCM-0006"), fourCCCodePCM16));
   1.166 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0007"), _L("SectionPCM-0007"), fourCCCodePCM16));
   1.167 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0008"), _L("SectionPCM-0008"), fourCCCodePCM16));
   1.168 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0009"), _L("SectionPCM-0009"), fourCCCodePCM16));
   1.169 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0010"), _L("SectionPCM-0010"), fourCCCodePCM16));
   1.170 +	AddTestStepL(RStepA3FDevSoundRecordSimple::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0011"), _L("SectionPCM-0011"), fourCCCodePCM16));
   1.171 +	AddTestStepL(RStepA3FDevSoundRecordAndPlay::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0012"), _L("SectionPCM-0012"), fourCCCodePCM16));
   1.172 +	AddTestStepL(RStepA3FDevSoundSetGainDuringRecord::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0013"), _L("SectionPCM-0013"), fourCCCodePCM8));
   1.173 +	AddTestStepL(RStepA3FDevSoundSetGainDuringRecord::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0014"), _L("SectionPCM-0014"), fourCCCodePCM16));
   1.174 +	AddTestStepL(RStepA3FDevSoundInvalidModeRecord::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0015"), fourCCCodePCM16));
   1.175 +	AddTestStepL(RStepA3FDevSoundInitializeWhileRecording::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0016"), fourCCCodePCM16));
   1.176 +	AddTestStepL(RStepA3FDevSoundCancelInitializeRecord::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0017"), _L("SectionPCM-0017"), fourCCCodePCM16));
   1.177 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersInitializedToRecord::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0018"), _L("SectionPCM-0018"), fourCCCodePCM16));
   1.178 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersWhileRecording::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-I-0019"), fourCCCodePCM16));
   1.179 +
   1.180 +	// DevSound PCM - Long Record test cases
   1.181 +
   1.182 +	AddTestStepL(RStepA3FDevSoundRecordLong::NewL(_L("MM-A3F-DEVSOUND-REC-PCM-LONG-I-0001"), _L("SectionPCM-Long-0001"), fourCCCodePCM16));
   1.183 +
   1.184 +	// DevSound - Tone test cases
   1.185 +
   1.186 +	AddTestStepL(RStepA3FDevSoundDTMFTonePlay::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0001")));
   1.187 +	AddTestStepL(RStepA3FDevSoundNormalAndDualTonePlay::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0002"), _L("SectionTONE-0002")));
   1.188 +	AddTestStepL(RStepA3FDevSoundNormalAndDualTonePlay::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0003"), _L("SectionTONE-0003")));
   1.189 +	AddTestStepL(RStepA3FDevSoundInitializeWhileTonePlaying::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0004")));
   1.190 +	AddTestStepL(RStepA3FDevSoundNotSupportedPlayFixedSeq::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0005")));
   1.191 +	AddTestStepL(RStepA3FDevSoundInvalidInitializeForTone::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0006")));
   1.192 +	AddTestStepL(RStepA3FDevSoundCancelInitializeTone::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0007"), _L("SectionTONE-0007")));
   1.193 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersInitializedForTone::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0008"), _L("SectionTONE-0008")));
   1.194 +	AddTestStepL(RStepA3FDevSoundEmptyBuffersWhileTonePlaying::NewL(_L("MM-A3F-DEVSOUND-TONE-I-0009")));
   1.195 +
   1.196 +	}
   1.197 +
   1.198 +// End of File