mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/src/TSU_MMF_DEVSOUND_SUITE.cpp
changeset 0 b8ed18f6c07b
child 6 fe9d1bf55678
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2002-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 // This main DLL entry point for the TSU_MMF_DEVSOUND_SUITE.dll
       
    15 // 
       
    16 //
       
    17 
       
    18 // System includes
       
    19 #include <e32base.h>
       
    20 
       
    21 // Test system includes
       
    22 #include "TSU_MMF_DEVSOUND_SUITE.h"
       
    23 #include "TSU_MMF_DEVSOUND_STEP.h"
       
    24 
       
    25 
       
    26 /** 
       
    27  *
       
    28  * NewTestSuiteL
       
    29  *	NewTestSuite is exported at ordinal 1
       
    30  *	this provides the interface to allow schedule test
       
    31  *	to create instances of this test suite
       
    32  * @result CTestSuiteDevSound*
       
    33  *
       
    34  */
       
    35 EXPORT_C CTestSuiteDevSound* NewTestSuiteL() 
       
    36 	{ 
       
    37 	CTestSuiteDevSound* result = new (ELeave) CTestSuiteDevSound;
       
    38 	CleanupStack::PushL(result);
       
    39 	result->ConstructL();
       
    40 	CleanupStack::Pop(); // result
       
    41 	return result;
       
    42 	}
       
    43 
       
    44 /**
       
    45  *
       
    46  * ~CTestSuiteDevSound
       
    47  *
       
    48  */
       
    49 CTestSuiteDevSound::~CTestSuiteDevSound() 
       
    50 	{}
       
    51 
       
    52 /**
       
    53  *
       
    54  * GetVersion
       
    55  *	Get Test Suite version
       
    56  * @result TPtrC
       
    57  *
       
    58  */
       
    59 TPtrC CTestSuiteDevSound::GetVersion( void ) const
       
    60 	{
       
    61 	_LIT(KTxtVersion,"1.08");
       
    62 	return KTxtVersion();
       
    63 	}
       
    64 
       
    65 
       
    66 /**
       
    67  *
       
    68  * AddTestStepL
       
    69  *	Add a test step into the suite
       
    70  * @param aPtrTestStep
       
    71  *	Test step pointer
       
    72  *
       
    73  */
       
    74 void CTestSuiteDevSound::AddTestStepL( CTestStepDevSound* aPtrTestStep )
       
    75 	{
       
    76 	// test steps contain a pointer back to the suite which owns them
       
    77 	aPtrTestStep->SetTestSuite(this);
       
    78 
       
    79 	// add the step using the base class method
       
    80 	CTestSuite::AddTestStepL(aPtrTestStep);
       
    81 	}
       
    82 
       
    83 /**
       
    84  *
       
    85  * InitialiseL
       
    86  *	Constructor for test suite
       
    87  *	this creates all the test steps and 
       
    88  *	stores them inside CTestSuiteDevSound
       
    89  *
       
    90  */
       
    91 void CTestSuiteDevSound::InitialiseL(void)
       
    92 	{
       
    93 	// store the name of this test suite 
       
    94 	iSuiteName = _L("TSU_MMF_DEVSOUND_SUITE");
       
    95 
       
    96 	//Initialize default pcm16 play
       
    97 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializePlay());
       
    98 	//Initialize with HwDevice uid play
       
    99 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeHwDeviceUidPlay());
       
   100 	//Initialize with fourCC play
       
   101 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeFourCCPlay());
       
   102 	//Initialize default pcm16 record 
       
   103 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeRecord());
       
   104 	//Initialize with HwDevice uid record
       
   105 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeHwDeviceUidRecord());
       
   106 	//Initialize with fourCC record
       
   107 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeFourCCRecord());
       
   108 	//Initialize with invalid fourCC code
       
   109 	AddTestStepL(new(ELeave) CTestStepDevSoundInitializeInvalidFourCC());
       
   110 	//Check Caps
       
   111 	AddTestStepL(new(ELeave) CTestStepDevSoundCheckCaps());
       
   112 	//Play Simple Tone
       
   113 	AddTestStepL(new(ELeave) CTestStepDevSoundSimpleTone());
       
   114 	//Play DTMF String
       
   115 	AddTestStepL(new(ELeave) CTestStepDevSoundDTMFTones());
       
   116 	//Play Three Simple Tones with 0, MaxVolume/2, and MaxVolume
       
   117 	AddTestStepL(new(ELeave) CTestStepDevSoundSimpleToneChangeVolume());
       
   118 	//Play DTMF String, Invalid Characters
       
   119 	AddTestStepL(new(ELeave) CTestStepDevSoundDTMFTonesInvalidStrings());
       
   120 	//Play Simple Tone, invalid Frequency
       
   121 	AddTestStepL(new(ELeave) CTestStepDevSoundSimpleToneInvalidFreq());
       
   122 	//Play Simple Tone, invalid Duration
       
   123 	AddTestStepL(new(ELeave) CTestStepDevSoundSimpleToneInvalidDuration());
       
   124 	//PlayInit
       
   125 	AddTestStepL(new(ELeave) CTestStepDevSoundPlayInit());
       
   126 	//Play 1 buffer of PCM, 16Bit, 8kHz, Mono, Raw, data
       
   127 	AddTestStepL(new(ELeave) CTestStepDevSoundPlay1BufferPCM16());
       
   128 	//Play 5 buffers of PCM, 16Bit, 8kHz, Mono, Raw, data
       
   129 	AddTestStepL(new(ELeave) CTestStepDevSoundPlay5BuffersPCM16());
       
   130 	//Play PCM, 16Bit, 8kHz, Mono, Raw, data until EOF
       
   131 	AddTestStepL(new(ELeave) CTestStepDevSoundPlayEOFPCM16());
       
   132 	//Play 1 buffer of PCM, 8Bit, 8kHz, Mono, Raw, data
       
   133 	AddTestStepL(new(ELeave) CTestStepDevSoundPlay1BufferPCM8());
       
   134 	//Play 5 buffers of PCM, 16Bit, 8kHz, Mono, Raw, data
       
   135 	AddTestStepL(new(ELeave) CTestStepDevSoundPlay5BuffersPCM8());
       
   136 	//Play PCM, 16Bit, 8kHz, Mono, Raw, data until EOF
       
   137 	AddTestStepL(new(ELeave) CTestStepDevSoundPlayEOFPCM8());
       
   138 	//Play Garbage until EOF
       
   139 	AddTestStepL(new(ELeave) CTestStepDevSoundPlayGarbageEOF());
       
   140 	//MaxGain test
       
   141 	AddTestStepL(new(ELeave) CTestStepDevSoundMaxGain());
       
   142 	//MaxVolume test
       
   143 	AddTestStepL(new(ELeave) CTestStepDevSoundMaxVolume());
       
   144 	//SetGain test
       
   145 	AddTestStepL(new(ELeave) CTestStepDevSoundSetGain());
       
   146 	//SetVolume test
       
   147 	AddTestStepL(new(ELeave) CTestStepDevSoundSetVolume());
       
   148 	//Record 1 buffer of PCM, 16Bit, 8kHz, Mono, Raw, data
       
   149 	AddTestStepL(new(ELeave) CTestStepDevSoundRecord1BufferPCM16());
       
   150 	//Record 10 buffers of PCM, 16Bit, 8kHz, Mono, Raw, data
       
   151 	AddTestStepL(new(ELeave) CTestStepDevSoundRecord10BuffersPCM16());
       
   152 	//Record 1 buffer of PCM, 8Bit, 8kHz, Mono, Raw, data
       
   153 	AddTestStepL(new(ELeave) CTestStepDevSoundRecord1BufferPCM8());
       
   154 	//Record 10 buffers of PCM, 8Bit, 8kHz, Mono, Raw, data
       
   155 	AddTestStepL(new(ELeave) CTestStepDevSoundRecord10BuffersPCM8());
       
   156 	//SetConfigL stereo
       
   157 	AddTestStepL(new(ELeave) CTestStepDevSoundSetConfigStereo());
       
   158 	//SetConfigL sample rate
       
   159 	AddTestStepL(new(ELeave) CTestStepDevSoundSetConfigSampleRate());
       
   160 	//GetSupportedInputDataTypesL test
       
   161 	AddTestStepL(new(ELeave) CTestStepDevSoundGetSupportedInputDataTypes());
       
   162 	//GetSupportedOutputDataTypesL test
       
   163 	AddTestStepL(new(ELeave) CTestStepDevSoundGetSupportedOutputDataTypes());
       
   164 	//GetSupportedInputDataTypesL OOM test
       
   165 	AddTestStepL(new(ELeave) CTestStepDevSoundGetSupportedInputDataTypesOOM());
       
   166 	//GetSupportedOutputDataTypesL OOM test
       
   167 	AddTestStepL(new(ELeave) CTestStepDevSoundGetSupportedOutputDataTypesOOM());
       
   168 	//RecordInit test with MultimediaDD capability
       
   169 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordInitNoUECap(ETrue));
       
   170 	//RecordInit test with no capabilities
       
   171 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordInitNoUECap(EFalse));
       
   172 	//RecordInit test with All capabilities
       
   173 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordInitWithUECap(ETrue));
       
   174 	//RecordInit test with UserEnvironment capability
       
   175 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordInitWithUECap(EFalse));
       
   176 	//RecordData test with All capabilities
       
   177 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordDataWithUECap(ETrue));
       
   178 	//RecordData test with UserEnvironment capability
       
   179 	AddTestStepL(new(ELeave) CTestStepDevSoundRecordDataWithUECap(EFalse));
       
   180 	//Test added as a part of DEF054803 - To check whether the sample rate is set to 8000Hz for tone play
       
   181 	AddTestStepL(new(ELeave) CTestStepDevSoundCheckSampleRateforTone());
       
   182 	//Tests added as a part of INC102615 - To check policy update after pause
       
   183 	CTestSuite::AddTestStepL(CTestStepDevSoundPlayPauseTone::NewL(this));
       
   184 	CTestSuite::AddTestStepL(CTestStepDevSoundPlayPauseTone2::NewL(this));
       
   185 	CTestSuite::AddTestStepL(CTestStepDevSoundPlayPauseTone3::NewL(this));
       
   186 	//Test added as a part of PDEF108583 - To check tone playing pre-emption
       
   187 	CTestSuite::AddTestStepL(RTestStepDevSoundToneTone::NewL(this));
       
   188 	//Test added as a part of PDEF108583 - To check recording pre-emption
       
   189 	CTestSuite::AddTestStepL(RTestStepDevSoundRecordRecord::NewL(this));
       
   190 	//Tests added as a part of INC111338 - To check continuing operation after loss and regain of policy
       
   191 	CTestSuite::AddTestStepL(RTestStepDevSoundToneReplay::NewL(this));
       
   192 	CTestSuite::AddTestStepL(RTestStepDevSoundRecordRerecord::NewL(this));
       
   193 	CTestSuite::AddTestStepL(RTestStepDevSoundPlayReplay::NewL(this));
       
   194 
       
   195 	//CustomInterface framework test
       
   196 	CTestSuite::AddTestStepL(RTestStepBasicCustomInterface::NewL());
       
   197 #ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
       
   198 	//PREQ1540 DevSound Server-Side alloc stress test via custom interface
       
   199 	CTestSuite::AddTestStepL(new(ELeave) CTestStepDevSoundServerSideAlloc());
       
   200 #endif
       
   201 	//CustomInterface framework test alloc
       
   202 	CTestSuite::AddTestStepL(RTestStepBasicCustomInterfaceAlloc::NewL());
       
   203 	//DevSound EmptyBuffers custom interface positive test
       
   204 	CTestSuite::AddTestStepL(new(ELeave) CTestStepDevSoundEmptyBuffersPos());
       
   205 	//DevSound EmptyBuffers custom interface negative test while recording
       
   206 	CTestSuite::AddTestStepL(new(ELeave) CTestStepDevSoundEmptyBuffersNeg1());
       
   207 	//DevSound EmptyBuffers custom interface negative test without starting playback
       
   208 	CTestSuite::AddTestStepL(new(ELeave) CTestStepDevSoundEmptyBuffersNeg2());
       
   209 	//DEF086171  - Possible memory leak within DevSound CI Framework 
       
   210 	CTestSuite::AddTestStepL(new(ELeave) CTestStepDevSoundCITest());
       
   211 	//PDEF121315:Cannot update the observer specified with InitializeL 
       
   212 	CTestSuite::AddTestStepL(RDevSoundMultiInitTest::NewL(_L("MM-MMF-DEVSOUND-U-0073-HP")));
       
   213 	//test case for PDEF117811 :Ref DevSound policy updating on error condition is inconsistent 
       
   214 	CTestSuite::AddTestStepL(RDevSoundPolicyUpdateTest::NewL(_L("MM-MMF-DEVSOUND-U-0074-HP")));
       
   215 
       
   216 	
       
   217 		
       
   218 
       
   219 	// New volume ramp tests
       
   220 	CTestSuite::AddTestStepL(RDevSoundDualToneVolumeRampTest::NewL(_L("MM-MMF-DEVSOUND-U-0075-HP")));
       
   221 	CTestSuite::AddTestStepL(RDevSoundDTMFStringVolumeRampTest::NewL(_L("MM-MMF-DEVSOUND-U-0076-HP")));
       
   222 	CTestSuite::AddTestStepL(RDevSoundToneSequenceVolumeRampTest::NewL(_L("MM-MMF-DEVSOUND-U-0077-HP")));
       
   223 	CTestSuite::AddTestStepL(RDevSoundDualToneSetVolumeRampWhilePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0078-HP")));
       
   224 	CTestSuite::AddTestStepL(RDevSoundDTMFStringSetVolumeRampWhilePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0079-HP")));
       
   225 	CTestSuite::AddTestStepL(RDevSoundToneSequenceSetVolumeRampWhilePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0080-HP")));
       
   226 	
       
   227 	// MM-MMF-DEVSOUND-U-0104-HP
       
   228 	CTestSuite::AddTestStepL(RTestStepRecordOverflow::NewL(_L("MM-MMF-DEVSOUND-U-0104-HP")));
       
   229 	
       
   230 	// TruePause is only available for A3F
       
   231 #ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
       
   232 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndResumePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0081-HP")));
       
   233 	CTestSuite::AddTestStepL(RA3FDevSoundPlayRejectionTestWhilePausing::NewL(_L("MM-MMF-DEVSOUND-U-0082-HP")));
       
   234 	CTestSuite::AddTestStepL(RA3FDevSoundPlayPreemptionTestWhilePausing::NewL(_L("MM-MMF-DEVSOUND-U-0083-HP")));
       
   235 	CTestSuite::AddTestStepL(RA3FDevSoundPlayPauseAndStopPlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0084-HP")));
       
   236 	CTestSuite::AddTestStepL(RA3FDevSoundPauseSetVolumeBalanceAndResumePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0085-HP")));
       
   237 	CTestSuite::AddTestStepL(RA3FDevSoundPauseSetConfigAndResumePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0086-HP")));
       
   238 
       
   239 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndResumeRecordingPCMTest::NewL(_L("MM-MMF-DEVSOUND-U-0088-HP")));
       
   240 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndResumeRecordingPCMDoNotWaitForLastBufferTest::NewL(_L("MM-MMF-DEVSOUND-U-0089-HP")));
       
   241 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndResumeRecordingNonPCMTest::NewL(_L("MM-MMF-DEVSOUND-U-0090-HP")));
       
   242 	CTestSuite::AddTestStepL(RA3FDevSoundPauseSetGainBalanceAndResumeRecordingPCMTest::NewL(_L("MM-MMF-DEVSOUND-U-0091-HP")));
       
   243 	CTestSuite::AddTestStepL(RA3FDevSoundPauseSetConfigAndResumeRecordingPCMTest::NewL(_L("MM-MMF-DEVSOUND-U-0092-HP")));
       
   244 		
       
   245 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayTonePauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0093-HP")));
       
   246 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayDualTonePauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0094-HP")));
       
   247 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayDTMFStringPauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0095-HP")));
       
   248 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayToneSequencePauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0096-HP")));
       
   249 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayToneSetVolumeBalancePauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0097-HP")));
       
   250 	CTestSuite::AddTestStepL(RA3FDevSoundTonePlayToneSequenceSetVolumeBalancePauseAndResume::NewL(_L("MM-MMF-DEVSOUND-U-0098-HP")));
       
   251 	CTestSuite::AddTestStepL(RA3FDevSoundPlayPauseFlushResumeTest::NewL(_L("MM-MMF-DEVSOUND-U-0099-HP")));
       
   252 	
       
   253 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndInitRecordingPCMTest::NewL(_L("MM-MMF-DEVSOUND-U-0105-HP")));
       
   254 	CTestSuite::AddTestStepL(RA3FDevSoundPauseAndResumeAndInitPlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0199-HP")));
       
   255 	//SMP: MultCustomInterface framework test
       
   256 	CTestSuite::AddTestStepL(RTestStepMultipleCustomInterface::NewL());	
       
   257 	
       
   258 #else
       
   259 	CTestSuite::AddTestStepL(RNonA3FDevSoundPauseAndResumePlayingTest::NewL(_L("MM-MMF-DEVSOUND-U-0087-HP")));
       
   260 #endif
       
   261 	}
       
   262