0
|
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 file contains an example Test step implementation
|
|
15 |
// This demonstrates the various functions provided
|
|
16 |
// by the CTestStep base class which are available within
|
|
17 |
// a test step
|
|
18 |
//
|
|
19 |
//
|
|
20 |
|
|
21 |
// EPOC includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <e32test.h>
|
|
24 |
#include <e32keys.h>
|
|
25 |
#include <c32comm.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
#include <etel.h>
|
|
28 |
#include <etelmm.h>
|
|
29 |
#include <testframework.h>
|
|
30 |
|
|
31 |
//#include <MdaAudioSamplePlayer.h>
|
|
32 |
#include <mdaaudiosampleeditor.h>
|
|
33 |
//#include <MdaAudioTonePlayer.h>
|
|
34 |
|
|
35 |
// Test system includes
|
|
36 |
#include <testframework.h>
|
|
37 |
|
|
38 |
// Specific includes for this test suite
|
|
39 |
#include "TestStepUnitMMFAudClient.h"
|
|
40 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
41 |
|
|
42 |
// Specific includes for these test steps
|
|
43 |
#include "TestStepRecorder.h"
|
|
44 |
|
|
45 |
|
|
46 |
#include "MmfAudioController.h"
|
|
47 |
#include "mmfclientaudiorecorder.h"
|
|
48 |
//#include "MmfClientAudioPlayer.h"
|
|
49 |
//#include <mmffourcc.h>
|
|
50 |
//#include <mmfpaniccodes.h>
|
|
51 |
//#include <mmfFormatImplementationUIDs.hrh>
|
|
52 |
// --------------------------------------------
|
|
53 |
|
|
54 |
const TInt KTestRecordTime = 10000000; // 10 sec
|
|
55 |
const TInt KTestRecordTimeTolerance = 2000000; // 2 sec
|
|
56 |
const TInt KTestPointerValue = 0xdeadbeef;
|
|
57 |
const TInt KTestPointerRecorder1 = 0xdadadada;
|
|
58 |
const TInt KTestPointerRecorder2 = 0xbabababa;
|
|
59 |
|
|
60 |
_LIT(KTestRecordOne, "c:\\R1.wav");
|
|
61 |
_LIT(KTestRecordTwo, "c:\\R2.wav");
|
|
62 |
_LIT(KTestRecordThree, "c:\\R3.wav");
|
|
63 |
|
|
64 |
/**
|
|
65 |
*
|
|
66 |
* Static constructor for CTestStepRecorderRecord.
|
|
67 |
*
|
|
68 |
*
|
|
69 |
* @return "CTestStepRecorderRecord*"
|
|
70 |
* The constructed CTestStepRecorderRecord
|
|
71 |
*
|
|
72 |
* @xxxx
|
|
73 |
*
|
|
74 |
*/
|
|
75 |
CTestStepRecorderRecord* CTestStepRecorderRecord::NewL()
|
|
76 |
{
|
|
77 |
CTestStepRecorderRecord* self = new(ELeave) CTestStepRecorderRecord;
|
|
78 |
return self;
|
|
79 |
}
|
|
80 |
|
|
81 |
/**
|
|
82 |
*
|
|
83 |
* Test step constructor.
|
|
84 |
* Each test step initialises its own name.
|
|
85 |
*
|
|
86 |
* @xxxx
|
|
87 |
*
|
|
88 |
*/
|
|
89 |
CTestStepRecorderRecord::CTestStepRecorderRecord() : iError(0), iHasRecorded(EFalse)
|
|
90 |
{
|
|
91 |
// store the name of this test case
|
|
92 |
// this is the name that is used by the script file
|
|
93 |
iTestStepName = _L("MM-MMF-ACLNT-U-0207-CP");
|
|
94 |
}
|
|
95 |
|
|
96 |
/**
|
|
97 |
*
|
|
98 |
* Test step destructor.
|
|
99 |
*
|
|
100 |
* @xxxx
|
|
101 |
*
|
|
102 |
*/
|
|
103 |
CTestStepRecorderRecord::~CTestStepRecorderRecord()
|
|
104 |
{
|
|
105 |
}
|
|
106 |
|
|
107 |
/**
|
|
108 |
*
|
|
109 |
* Test step Preamble.
|
|
110 |
*
|
|
111 |
* @xxxx
|
|
112 |
*
|
|
113 |
*/
|
|
114 |
enum TVerdict CTestStepRecorderRecord::DoTestStepPreambleL(void)
|
|
115 |
{
|
|
116 |
enum TVerdict verdict = EPass;
|
|
117 |
// this installs the scheduler
|
|
118 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
119 |
|
|
120 |
// Printing to the console and log file
|
|
121 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0207-CP"));
|
|
122 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL"));
|
|
123 |
|
|
124 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord"), iFileName))
|
|
125 |
{
|
|
126 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
127 |
return EInconclusive;
|
|
128 |
}
|
|
129 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord2"), iFileName2))
|
|
130 |
{
|
|
131 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
132 |
return EInconclusive;
|
|
133 |
}
|
|
134 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord3"), iFileName3))
|
|
135 |
{
|
|
136 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
137 |
return EInconclusive;
|
|
138 |
}
|
|
139 |
|
|
140 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
141 |
verdict = EInconclusive;
|
|
142 |
|
|
143 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
144 |
return EFail; // check value in MoscoStateChangeEvent
|
|
145 |
|
|
146 |
// open an existing file to record and crop all its contents if any
|
|
147 |
iRecorder->OpenFileL(iFileName);
|
|
148 |
CActiveScheduler::Start();
|
|
149 |
if (iError)
|
|
150 |
{
|
|
151 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
152 |
return EFail;
|
|
153 |
}
|
|
154 |
|
|
155 |
if (iError != KErrNone ||
|
|
156 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
157 |
return EInconclusive;
|
|
158 |
|
|
159 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
160 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
161 |
iRecorder->SetPosition(*iBeginning);
|
|
162 |
iRecorder->CropL();
|
|
163 |
|
|
164 |
if ( iError != KErrNone ||
|
|
165 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
166 |
verdict = EInconclusive;
|
|
167 |
|
|
168 |
return verdict;
|
|
169 |
|
|
170 |
}
|
|
171 |
|
|
172 |
/**
|
|
173 |
*
|
|
174 |
* Test step Postamble.
|
|
175 |
*
|
|
176 |
* @xxxx
|
|
177 |
*
|
|
178 |
*/
|
|
179 |
enum TVerdict CTestStepRecorderRecord::DoTestStepPostambleL(void)
|
|
180 |
{
|
|
181 |
//delete the output file
|
|
182 |
CFileMan* fileMan;
|
|
183 |
iFs.Connect();
|
|
184 |
fileMan = CFileMan::NewL(iFs);
|
|
185 |
fileMan->Delete(iFileName);
|
|
186 |
iFs.Close();
|
|
187 |
delete fileMan;
|
|
188 |
fileMan = NULL;
|
|
189 |
|
|
190 |
delete iRecorder;
|
|
191 |
iRecorder = NULL;
|
|
192 |
//[ Destroy the scheduler ]
|
|
193 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
194 |
}
|
|
195 |
|
|
196 |
/**
|
|
197 |
*
|
|
198 |
* Callback Handle.
|
|
199 |
*
|
|
200 |
* @xxxx
|
|
201 |
*
|
|
202 |
*/
|
|
203 |
void CTestStepRecorderRecord::MoscoStateChangeEvent(CBase* aObject,
|
|
204 |
TInt /*aPreviousState*/,
|
|
205 |
TInt /*aCurrentState*/,
|
|
206 |
TInt aErrorCode)
|
|
207 |
{
|
|
208 |
if (aObject != REINTERPRET_CAST(CBase*, KTestPointerValue))
|
|
209 |
iError = KErrArgument;
|
|
210 |
else
|
|
211 |
iError = aErrorCode;
|
|
212 |
CActiveScheduler::Stop();
|
|
213 |
}
|
|
214 |
|
|
215 |
// this can return a TBool hasPlayed to prove that it has played
|
|
216 |
// but the EPlaying state seems to get preserved for some reason...
|
|
217 |
void CTestStepRecorderRecord::RecordAndStartSchedulerL()
|
|
218 |
{
|
|
219 |
iRecorder->RecordL();
|
|
220 |
CActiveScheduler::Start();
|
|
221 |
// record 2 secs, ...probably silence
|
|
222 |
User::After(2000000);
|
|
223 |
|
|
224 |
if (iRecorder->State() == CMdaAudioRecorderUtility::ERecording)
|
|
225 |
iHasRecorded = ETrue;
|
|
226 |
iRecorder->Stop();
|
|
227 |
User::LeaveIfError(iError);
|
|
228 |
}
|
|
229 |
|
|
230 |
/**
|
|
231 |
*
|
|
232 |
* Do the test step.
|
|
233 |
* Each test step must supply an implementation for DoTestStepL.
|
|
234 |
*
|
|
235 |
* @return "TVerdict"
|
|
236 |
* The result of the test step
|
|
237 |
*
|
|
238 |
* @xxxx
|
|
239 |
*
|
|
240 |
*/
|
|
241 |
TVerdict CTestStepRecorderRecord::DoTestStepL()
|
|
242 |
{
|
|
243 |
iTestStepResult = EPass;
|
|
244 |
TInt err = KErrNone;
|
|
245 |
|
|
246 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
247 |
|
|
248 |
// check result
|
|
249 |
if (iError != KErrNone ||
|
|
250 |
err != KErrNone ||
|
|
251 |
!iHasRecorded ||
|
|
252 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
253 |
return EFail;
|
|
254 |
|
|
255 |
iHasRecorded = EFalse;
|
|
256 |
iRecorder->Close();
|
|
257 |
delete iRecorder;
|
|
258 |
iRecorder = NULL;
|
|
259 |
|
|
260 |
/*
|
|
261 |
// record AU file //
|
|
262 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
263 |
return EInconclusive;
|
|
264 |
|
|
265 |
// open an existing file to record and crop all its contents if any
|
|
266 |
iRecorder->OpenFileL(iFileName2);
|
|
267 |
CActiveScheduler::Start();
|
|
268 |
if (iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
269 |
return EInconclusive;
|
|
270 |
|
|
271 |
iRecorder->SetGain(iRecorder->MaxGain()*.75);
|
|
272 |
iRecorder->SetPosition(*iBeginning);
|
|
273 |
iRecorder->CropL();
|
|
274 |
|
|
275 |
if ( iError != KErrNone ||
|
|
276 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
277 |
return EInconclusive;
|
|
278 |
|
|
279 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
280 |
|
|
281 |
// check result
|
|
282 |
if (iError != KErrNone ||
|
|
283 |
err != KErrNone ||
|
|
284 |
!iHasRecorded ||
|
|
285 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
286 |
return EFail;
|
|
287 |
|
|
288 |
iHasRecorded = EFalse;
|
|
289 |
iRecorder->Close();
|
|
290 |
delete iRecorder;
|
|
291 |
iRecorder = NULL;
|
|
292 |
|
|
293 |
// record RAW file //
|
|
294 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
295 |
return EInconclusive;
|
|
296 |
|
|
297 |
// open an existing file to record and crop all its contents if any
|
|
298 |
iRecorder->OpenFileL(iFileName3);
|
|
299 |
CActiveScheduler::Start();
|
|
300 |
if (iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
301 |
return EInconclusive;
|
|
302 |
|
|
303 |
iRecorder->SetGain(iRecorder->MaxGain()*.75);
|
|
304 |
iRecorder->SetPosition(*iBeginning);
|
|
305 |
iRecorder->CropL();
|
|
306 |
|
|
307 |
if ( iError != KErrNone ||
|
|
308 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
309 |
return EInconclusive;
|
|
310 |
|
|
311 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
312 |
|
|
313 |
// check result
|
|
314 |
if (iError != KErrNone ||
|
|
315 |
err != KErrNone ||
|
|
316 |
!iHasRecorded ||
|
|
317 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
318 |
return EFail;
|
|
319 |
|
|
320 |
iHasRecorded = EFalse;
|
|
321 |
iRecorder->Close();
|
|
322 |
delete iRecorder;
|
|
323 |
iRecorder = NULL;
|
|
324 |
*/
|
|
325 |
|
|
326 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
327 |
// test steps return a result
|
|
328 |
return iTestStepResult;
|
|
329 |
}
|
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
/**
|
|
334 |
*
|
|
335 |
* Static constructor for CTestStepRecorderRecordWav.
|
|
336 |
*
|
|
337 |
*
|
|
338 |
* @return "CTestStepRecorderRecordWav*"
|
|
339 |
* The constructed CTestStepRecorderRecordWav
|
|
340 |
*
|
|
341 |
* @xxxx
|
|
342 |
*
|
|
343 |
*/
|
|
344 |
CTestStepRecorderRecordWav* CTestStepRecorderRecordWav::NewL()
|
|
345 |
{
|
|
346 |
CTestStepRecorderRecordWav* self = new(ELeave) CTestStepRecorderRecordWav;
|
|
347 |
return self;
|
|
348 |
}
|
|
349 |
|
|
350 |
/**
|
|
351 |
*
|
|
352 |
* Test step constructor.
|
|
353 |
* Each test step initialises its own name.
|
|
354 |
*
|
|
355 |
* @xxxx
|
|
356 |
*
|
|
357 |
*/
|
|
358 |
CTestStepRecorderRecordWav::CTestStepRecorderRecordWav() : iError(0), iHasRecorded(EFalse)
|
|
359 |
{
|
|
360 |
// store the name of this test case
|
|
361 |
// this is the name that is used by the script file
|
|
362 |
iTestStepName = _L("MM-MMF-ACLNT-U-0269-HP");
|
|
363 |
}
|
|
364 |
|
|
365 |
/**
|
|
366 |
*
|
|
367 |
* Test step destructor.
|
|
368 |
*
|
|
369 |
* @xxxx
|
|
370 |
*
|
|
371 |
*/
|
|
372 |
CTestStepRecorderRecordWav::~CTestStepRecorderRecordWav()
|
|
373 |
{
|
|
374 |
}
|
|
375 |
|
|
376 |
/**
|
|
377 |
*
|
|
378 |
* Test step Preamble.
|
|
379 |
*
|
|
380 |
* @xxxx
|
|
381 |
*
|
|
382 |
*/
|
|
383 |
enum TVerdict CTestStepRecorderRecordWav::DoTestStepPreambleL(void)
|
|
384 |
{
|
|
385 |
enum TVerdict verdict = EPass;
|
|
386 |
// this installs the scheduler
|
|
387 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
388 |
|
|
389 |
// Printing to the console and log file
|
|
390 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0269-HP"));
|
|
391 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL with non existent wav file"));
|
|
392 |
|
|
393 |
// set the file name to something weird
|
|
394 |
iFileName.Set( _L("c:\\szhgefdsfe.wav"));
|
|
395 |
|
|
396 |
//[ ensure the file does not exist]
|
|
397 |
CFileMan* fileMan;
|
|
398 |
iFs.Connect();
|
|
399 |
fileMan = CFileMan::NewL(iFs);
|
|
400 |
fileMan->Delete(iFileName);
|
|
401 |
iFs.Close();
|
|
402 |
delete fileMan;
|
|
403 |
fileMan = NULL;
|
|
404 |
|
|
405 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
406 |
verdict = EInconclusive;
|
|
407 |
|
|
408 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
409 |
return EFail; // check value in MoscoStateChangeEvent
|
|
410 |
|
|
411 |
// open an existing file to record and crop all its contents if any
|
|
412 |
iRecorder->OpenFileL(iFileName);
|
|
413 |
CActiveScheduler::Start();
|
|
414 |
if (iError)
|
|
415 |
{
|
|
416 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
417 |
return EFail;
|
|
418 |
}
|
|
419 |
|
|
420 |
if (iError != KErrNone ||
|
|
421 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
422 |
return EInconclusive;
|
|
423 |
|
|
424 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
425 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
426 |
iRecorder->SetPosition(*iBeginning);
|
|
427 |
|
|
428 |
TRAPD( errorCode, iRecorder->CropL() );
|
|
429 |
|
|
430 |
if ( iError != KErrNone ||
|
|
431 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen ||
|
|
432 |
errorCode != KErrNone )
|
|
433 |
{
|
|
434 |
INFO_PRINTF3( _L("Failed after Crop in preamble: (iError, errorCode) %x, %x"), iError, errorCode );
|
|
435 |
verdict = EInconclusive;
|
|
436 |
}
|
|
437 |
|
|
438 |
return verdict;
|
|
439 |
|
|
440 |
}
|
|
441 |
|
|
442 |
/**
|
|
443 |
*
|
|
444 |
* Test step Postamble.
|
|
445 |
*
|
|
446 |
* @xxxx
|
|
447 |
*
|
|
448 |
*/
|
|
449 |
enum TVerdict CTestStepRecorderRecordWav::DoTestStepPostambleL(void)
|
|
450 |
{
|
|
451 |
//delete the output file
|
|
452 |
CFileMan* fileMan;
|
|
453 |
iFs.Connect();
|
|
454 |
fileMan = CFileMan::NewL(iFs);
|
|
455 |
fileMan->Delete(iFileName);
|
|
456 |
iFs.Close();
|
|
457 |
delete fileMan;
|
|
458 |
fileMan = NULL;
|
|
459 |
|
|
460 |
delete iRecorder;
|
|
461 |
iRecorder = NULL;
|
|
462 |
//[ Destroy the scheduler ]
|
|
463 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
464 |
}
|
|
465 |
|
|
466 |
/**
|
|
467 |
*
|
|
468 |
* Callback Handle.
|
|
469 |
*
|
|
470 |
* @xxxx
|
|
471 |
*
|
|
472 |
*/
|
|
473 |
void CTestStepRecorderRecordWav::MoscoStateChangeEvent(CBase* aObject,
|
|
474 |
TInt /*aPreviousState*/,
|
|
475 |
TInt /*aCurrentState*/,
|
|
476 |
TInt aErrorCode)
|
|
477 |
{
|
|
478 |
if (aObject != REINTERPRET_CAST(CBase*, KTestPointerValue))
|
|
479 |
iError = KErrArgument;
|
|
480 |
else
|
|
481 |
iError = aErrorCode;
|
|
482 |
CActiveScheduler::Stop();
|
|
483 |
}
|
|
484 |
|
|
485 |
// this can return a TBool hasPlayed to prove that it has played
|
|
486 |
// but the EPlaying state seems to get preserved for some reason...
|
|
487 |
void CTestStepRecorderRecordWav::RecordAndStartSchedulerL()
|
|
488 |
{
|
|
489 |
iRecorder->RecordL();
|
|
490 |
CActiveScheduler::Start();
|
|
491 |
// record 2 secs, ...probably silence
|
|
492 |
User::After(2000000);
|
|
493 |
|
|
494 |
if (iRecorder->State() == CMdaAudioRecorderUtility::ERecording)
|
|
495 |
iHasRecorded = ETrue;
|
|
496 |
iRecorder->Stop();
|
|
497 |
User::LeaveIfError(iError);
|
|
498 |
}
|
|
499 |
|
|
500 |
/**
|
|
501 |
*
|
|
502 |
* Do the test step.
|
|
503 |
* Each test step must supply an implementation for DoTestStepL.
|
|
504 |
*
|
|
505 |
* @return "TVerdict"
|
|
506 |
* The result of the test step
|
|
507 |
*
|
|
508 |
* @xxxx
|
|
509 |
*
|
|
510 |
*/
|
|
511 |
TVerdict CTestStepRecorderRecordWav::DoTestStepL()
|
|
512 |
{
|
|
513 |
iTestStepResult = EPass;
|
|
514 |
TInt err = KErrNone;
|
|
515 |
|
|
516 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
517 |
|
|
518 |
// check result
|
|
519 |
if (iError != KErrNone ||
|
|
520 |
err != KErrNone ||
|
|
521 |
!iHasRecorded ||
|
|
522 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
523 |
return EFail;
|
|
524 |
|
|
525 |
iHasRecorded = EFalse;
|
|
526 |
iRecorder->Close();
|
|
527 |
delete iRecorder;
|
|
528 |
iRecorder = NULL;
|
|
529 |
|
|
530 |
|
|
531 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
532 |
// test steps return a result
|
|
533 |
return iTestStepResult;
|
|
534 |
}
|
|
535 |
|
|
536 |
|
|
537 |
|
|
538 |
/**
|
|
539 |
*
|
|
540 |
* CTestStepRecorderRecordAu
|
|
541 |
*
|
|
542 |
*/
|
|
543 |
|
|
544 |
CTestStepRecorderRecordAu::CTestStepRecorderRecordAu()
|
|
545 |
{
|
|
546 |
// store the name of this test case
|
|
547 |
// this is the name that is used by the script file
|
|
548 |
iTestStepName = _L("MM-MMF-ACLNT-U-0270-HP");
|
|
549 |
}
|
|
550 |
|
|
551 |
/**
|
|
552 |
*
|
|
553 |
* Static constructor for CTestStepRecorderRecordAu.
|
|
554 |
*
|
|
555 |
*
|
|
556 |
* @return "CTestStepRecorderRecordAu*"
|
|
557 |
* The constructed CTestStepRecorderRecordAu
|
|
558 |
*
|
|
559 |
* @xxxx
|
|
560 |
*
|
|
561 |
*/
|
|
562 |
CTestStepRecorderRecordAu* CTestStepRecorderRecordAu::NewL()
|
|
563 |
{
|
|
564 |
CTestStepRecorderRecordAu* self = new(ELeave) CTestStepRecorderRecordAu();
|
|
565 |
return self;
|
|
566 |
}
|
|
567 |
|
|
568 |
/**
|
|
569 |
*
|
|
570 |
* Test step Preamble.
|
|
571 |
*
|
|
572 |
* @xxxx
|
|
573 |
*
|
|
574 |
*/
|
|
575 |
enum TVerdict CTestStepRecorderRecordAu::DoTestStepPreambleL(void)
|
|
576 |
{
|
|
577 |
enum TVerdict verdict = EPass;
|
|
578 |
// this installs the scheduler
|
|
579 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
580 |
|
|
581 |
// Printing to the console and log file
|
|
582 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0270-HP"));
|
|
583 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL with non existent wav file"));
|
|
584 |
|
|
585 |
// set the file name to something weird
|
|
586 |
iFileName.Set( _L("c:\\szhgefdsfe.au"));
|
|
587 |
|
|
588 |
//[ ensure the file does not exist]
|
|
589 |
CFileMan* fileMan;
|
|
590 |
iFs.Connect();
|
|
591 |
fileMan = CFileMan::NewL(iFs);
|
|
592 |
fileMan->Delete(iFileName);
|
|
593 |
iFs.Close();
|
|
594 |
delete fileMan;
|
|
595 |
fileMan = NULL;
|
|
596 |
|
|
597 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
598 |
verdict = EInconclusive;
|
|
599 |
|
|
600 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
601 |
return EFail; // check value in MoscoStateChangeEvent
|
|
602 |
|
|
603 |
// open an existing file to record and crop all its contents if any
|
|
604 |
iRecorder->OpenFileL(iFileName);
|
|
605 |
CActiveScheduler::Start();
|
|
606 |
if (iError)
|
|
607 |
{
|
|
608 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
609 |
return EFail;
|
|
610 |
}
|
|
611 |
|
|
612 |
if (iError != KErrNone ||
|
|
613 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
614 |
return EInconclusive;
|
|
615 |
|
|
616 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
617 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
618 |
iRecorder->SetPosition(*iBeginning);
|
|
619 |
|
|
620 |
iRecorder->CropL(); //debug code remove
|
|
621 |
|
|
622 |
TRAPD( errorCode, iRecorder->CropL() );
|
|
623 |
|
|
624 |
if ( iError != KErrNone ||
|
|
625 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen ||
|
|
626 |
errorCode != KErrNone )
|
|
627 |
{
|
|
628 |
INFO_PRINTF3(_L("Test Failed after Crop operation in preamble: (iError, errorCode) (%X, %X)"),iError, errorCode );
|
|
629 |
verdict = EInconclusive;
|
|
630 |
}
|
|
631 |
|
|
632 |
return verdict;
|
|
633 |
|
|
634 |
}
|
|
635 |
|
|
636 |
|
|
637 |
CTestStepRecorderRecordRaw::CTestStepRecorderRecordRaw()
|
|
638 |
{
|
|
639 |
// store the name of this test case
|
|
640 |
// this is the name that is used by the script file
|
|
641 |
iTestStepName = _L("MM-MMF-ACLNT-U-0271-CP");
|
|
642 |
}
|
|
643 |
|
|
644 |
|
|
645 |
/**
|
|
646 |
*
|
|
647 |
* Test step Preamble.
|
|
648 |
*
|
|
649 |
* @xxxx
|
|
650 |
*
|
|
651 |
*/
|
|
652 |
enum TVerdict CTestStepRecorderRecordRaw::DoTestStepPreambleL(void)
|
|
653 |
{
|
|
654 |
enum TVerdict verdict = EPass;
|
|
655 |
// this installs the scheduler
|
|
656 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
657 |
|
|
658 |
// Printing to the console and log file
|
|
659 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0271-CP"));
|
|
660 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL with non existent raw file"));
|
|
661 |
|
|
662 |
// set the file name to something weird
|
|
663 |
iFileName.Set( _L("c:\\szhgefdsfe.raw"));
|
|
664 |
|
|
665 |
//[ ensure the file does not exist]
|
|
666 |
CFileMan* fileMan;
|
|
667 |
iFs.Connect();
|
|
668 |
fileMan = CFileMan::NewL(iFs);
|
|
669 |
fileMan->Delete(iFileName);
|
|
670 |
iFs.Close();
|
|
671 |
delete fileMan;
|
|
672 |
fileMan = NULL;
|
|
673 |
|
|
674 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
675 |
verdict = EInconclusive;
|
|
676 |
|
|
677 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
678 |
return EFail; // check value in MoscoStateChangeEvent
|
|
679 |
|
|
680 |
// open an existing file to record and crop all its contents if any
|
|
681 |
iRecorder->OpenFileL(iFileName);
|
|
682 |
CActiveScheduler::Start();
|
|
683 |
if (iError)
|
|
684 |
{
|
|
685 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
686 |
return EFail;
|
|
687 |
}
|
|
688 |
|
|
689 |
if (iError != KErrNone ||
|
|
690 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
691 |
return EInconclusive;
|
|
692 |
|
|
693 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
694 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
695 |
iRecorder->SetPosition(*iBeginning);
|
|
696 |
TRAPD( errorCode, iRecorder->CropL())
|
|
697 |
if ( iError != KErrNone ||
|
|
698 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen ||
|
|
699 |
errorCode != KErrNone )
|
|
700 |
{
|
|
701 |
INFO_PRINTF3(_L("Test Failed after Crop operation in preamble: (iError, errorCode)(%X, %X)"),iError, errorCode );
|
|
702 |
verdict = EInconclusive;
|
|
703 |
}
|
|
704 |
|
|
705 |
return verdict;
|
|
706 |
|
|
707 |
}
|
|
708 |
|
|
709 |
|
|
710 |
/**
|
|
711 |
*
|
|
712 |
* Static constructor for CTestStepRecorderRecordAu.
|
|
713 |
*
|
|
714 |
*
|
|
715 |
* @return "CTestStepRecorderRecordRaw*"
|
|
716 |
* The constructed CTestStepRecorderRecordRaw
|
|
717 |
*
|
|
718 |
* @xxxx
|
|
719 |
*
|
|
720 |
*/
|
|
721 |
CTestStepRecorderRecordRaw* CTestStepRecorderRecordRaw::NewL()
|
|
722 |
{
|
|
723 |
CTestStepRecorderRecordRaw* self = new(ELeave) CTestStepRecorderRecordRaw;
|
|
724 |
return self;
|
|
725 |
}
|
|
726 |
|
|
727 |
|
|
728 |
/**
|
|
729 |
*
|
|
730 |
* CTestStepRecorderRecordWavGsm
|
|
731 |
*/
|
|
732 |
|
|
733 |
CTestStepRecorderRecordWavGsm::CTestStepRecorderRecordWavGsm()
|
|
734 |
{
|
|
735 |
// store the name of this test case
|
|
736 |
// this is the name that is used by the script file
|
|
737 |
iTestStepName = _L("MM-MMF-ACLNT-U-0275-HP");
|
|
738 |
}
|
|
739 |
|
|
740 |
/**
|
|
741 |
*
|
|
742 |
* Static constructor for CTestStepRecorderRecordWavGsm.
|
|
743 |
*
|
|
744 |
*
|
|
745 |
* @return "CTestStepRecorderRecordWavGsm*"
|
|
746 |
* The constructed CTestStepRecorderRecordWavGsm
|
|
747 |
*
|
|
748 |
* @xxxx
|
|
749 |
*
|
|
750 |
*/
|
|
751 |
CTestStepRecorderRecordWavGsm* CTestStepRecorderRecordWavGsm::NewL()
|
|
752 |
{
|
|
753 |
CTestStepRecorderRecordWavGsm* self = new(ELeave) CTestStepRecorderRecordWavGsm();
|
|
754 |
return self;
|
|
755 |
}
|
|
756 |
|
|
757 |
/**
|
|
758 |
*
|
|
759 |
* Test step Preamble.
|
|
760 |
*
|
|
761 |
* @xxxx
|
|
762 |
*
|
|
763 |
*/
|
|
764 |
enum TVerdict CTestStepRecorderRecordWavGsm::DoTestStepPreambleL(void)
|
|
765 |
{
|
|
766 |
enum TVerdict verdict = EPass;
|
|
767 |
// this installs the scheduler
|
|
768 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
769 |
|
|
770 |
// Printing to the console and log file
|
|
771 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0275-HP"));
|
|
772 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL with non existent wav Gsm file"));
|
|
773 |
|
|
774 |
// set the file name to something weird
|
|
775 |
iFileName.Set( _L("c:\\asmeraGSM610.wav"));
|
|
776 |
|
|
777 |
//[ ensure the file does not exist]
|
|
778 |
CFileMan* fileMan;
|
|
779 |
iFs.Connect();
|
|
780 |
fileMan = CFileMan::NewL(iFs);
|
|
781 |
fileMan->Delete(iFileName);
|
|
782 |
iFs.Close();
|
|
783 |
delete fileMan;
|
|
784 |
fileMan = NULL;
|
|
785 |
|
|
786 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
787 |
{
|
|
788 |
verdict = EInconclusive;
|
|
789 |
}
|
|
790 |
|
|
791 |
TInt result = SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue));
|
|
792 |
|
|
793 |
if (result != KErrNone)
|
|
794 |
{
|
|
795 |
INFO_PRINTF2(_L("SetAudRecorderParent returned %d"), result);
|
|
796 |
return EFail; // check value in MoscoStateChangeEvent
|
|
797 |
}
|
|
798 |
|
|
799 |
|
|
800 |
// open an existing file to record and crop all its contents if any
|
|
801 |
TRAPD( errorCode, iRecorder->OpenFileL(iFileName,
|
|
802 |
TUid::Uid(KMmfUidControllerAudio),
|
|
803 |
TUid::Null(),
|
|
804 |
TUid::Uid(KMmfUidFormatWAVWrite),
|
|
805 |
TFourCC(KMMFFourCCCodeGSM610)) );
|
|
806 |
CActiveScheduler::Start();
|
|
807 |
|
|
808 |
if (iError)
|
|
809 |
{
|
|
810 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
811 |
return EFail;
|
|
812 |
}
|
|
813 |
|
|
814 |
if (iError != KErrNone ||
|
|
815 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
816 |
return EInconclusive;
|
|
817 |
|
|
818 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
819 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
820 |
iRecorder->SetPosition(*iBeginning);
|
|
821 |
|
|
822 |
if ( errorCode != KErrNone || iError != KErrNone || iRecorder->State() != CMdaAudioRecorderUtility::EOpen )
|
|
823 |
{
|
|
824 |
INFO_PRINTF3(_L("Test Failed after open operation in preamble: (iError, errorCode) (%d, %d)"),iError, errorCode );
|
|
825 |
verdict = EInconclusive;
|
|
826 |
}
|
|
827 |
|
|
828 |
return verdict;
|
|
829 |
|
|
830 |
}
|
|
831 |
|
|
832 |
/**
|
|
833 |
*
|
|
834 |
* Do the test step.
|
|
835 |
* Each test step must supply an implementation for DoTestStepL.
|
|
836 |
*
|
|
837 |
* @return "TVerdict"
|
|
838 |
* The result of the test step
|
|
839 |
*
|
|
840 |
* @xxxx
|
|
841 |
*
|
|
842 |
*/
|
|
843 |
TVerdict CTestStepRecorderRecordWavGsm::DoTestStepL()
|
|
844 |
{
|
|
845 |
iTestStepResult = EPass;
|
|
846 |
TInt err = KErrNone;
|
|
847 |
TInt count;
|
|
848 |
|
|
849 |
for (count = 0; count < 3; count++)
|
|
850 |
{
|
|
851 |
iHasRecorded = EFalse;
|
|
852 |
|
|
853 |
TRAP( err, iRecorder->RecordL() );
|
|
854 |
|
|
855 |
User::After(KTestRecordTime);
|
|
856 |
|
|
857 |
if (iRecorder->State() == CMdaAudioRecorderUtility::ERecording)
|
|
858 |
{
|
|
859 |
iHasRecorded = ETrue;
|
|
860 |
}
|
|
861 |
|
|
862 |
iRecorder->Stop();
|
|
863 |
CActiveScheduler::Start();
|
|
864 |
}
|
|
865 |
|
|
866 |
TInt recordedDuration;
|
|
867 |
TInt expectedDuration;
|
|
868 |
|
|
869 |
recordedDuration = iRecorder->Duration().Int64() + (KTestRecordTimeTolerance * count);
|
|
870 |
expectedDuration = KTestRecordTime * count;
|
|
871 |
|
|
872 |
if ( iHasRecorded && (recordedDuration < expectedDuration) )
|
|
873 |
{
|
|
874 |
INFO_PRINTF4(_L("Test failed Recorded: %d and Expected: %d duration mismatch. iHasRecorded %d"),
|
|
875 |
recordedDuration, expectedDuration, iHasRecorded);
|
|
876 |
return EFail;
|
|
877 |
}
|
|
878 |
|
|
879 |
// check result
|
|
880 |
if (iError != KErrNone || err != KErrNone || !iHasRecorded ||
|
|
881 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
882 |
{
|
|
883 |
INFO_PRINTF3(_L("Test Failed to record: (iError, errorCode) (%d, %d)"),iError, err);
|
|
884 |
return EFail;
|
|
885 |
}
|
|
886 |
|
|
887 |
iHasRecorded = EFalse;
|
|
888 |
iRecorder->Close();
|
|
889 |
delete iRecorder;
|
|
890 |
iRecorder = NULL;
|
|
891 |
|
|
892 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
893 |
// test steps return a result
|
|
894 |
return iTestStepResult;
|
|
895 |
}
|
|
896 |
|
|
897 |
|
|
898 |
/**
|
|
899 |
*
|
|
900 |
* CTestStepRecorderRecordWavGsmFail
|
|
901 |
*/
|
|
902 |
|
|
903 |
CTestStepRecorderRecordWavGsmFail::CTestStepRecorderRecordWavGsmFail()
|
|
904 |
{
|
|
905 |
// store the name of this test case
|
|
906 |
// this is the name that is used by the script file
|
|
907 |
iTestStepName = _L("MM-MMF-ACLNT-U-0276-HP");
|
|
908 |
}
|
|
909 |
|
|
910 |
/**
|
|
911 |
*
|
|
912 |
* Static constructor for CTestStepRecorderRecordWavGsmFail.
|
|
913 |
*
|
|
914 |
*
|
|
915 |
* @return "CTestStepRecorderRecordWavGsmFail*"
|
|
916 |
* The constructed CTestStepRecorderRecordWavGsmFail
|
|
917 |
*
|
|
918 |
* @xxxx
|
|
919 |
*
|
|
920 |
*/
|
|
921 |
CTestStepRecorderRecordWavGsmFail* CTestStepRecorderRecordWavGsmFail::NewL()
|
|
922 |
{
|
|
923 |
CTestStepRecorderRecordWavGsmFail* self = new(ELeave) CTestStepRecorderRecordWavGsmFail();
|
|
924 |
return self;
|
|
925 |
}
|
|
926 |
|
|
927 |
/**
|
|
928 |
*
|
|
929 |
* Test step Preamble.
|
|
930 |
*
|
|
931 |
* @xxxx
|
|
932 |
*
|
|
933 |
*/
|
|
934 |
enum TVerdict CTestStepRecorderRecordWavGsmFail::DoTestStepPreambleL(void)
|
|
935 |
{
|
|
936 |
enum TVerdict verdict = EPass;
|
|
937 |
// this installs the scheduler
|
|
938 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
939 |
|
|
940 |
// Printing to the console and log file
|
|
941 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0276-HP"));
|
|
942 |
INFO_PRINTF1(_L("This is a test to append to a corrupted wav Gsm file"));
|
|
943 |
|
|
944 |
// set the file name
|
|
945 |
_LIT(KSoundFile, "c:\\mm\\mmf\\testfiles\\aclnt\\corruptedGsm610Mono8khz.wav");
|
|
946 |
|
|
947 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
948 |
{
|
|
949 |
verdict = EInconclusive;
|
|
950 |
}
|
|
951 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
952 |
return EFail; // check value in MoscoStateChangeEvent
|
|
953 |
|
|
954 |
// open an existing file to record and crop all its contents if any
|
|
955 |
iRecorder->OpenFileL(KSoundFile);
|
|
956 |
CActiveScheduler::Start();
|
|
957 |
|
|
958 |
if (iError)
|
|
959 |
{
|
|
960 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
961 |
return EFail;
|
|
962 |
}
|
|
963 |
|
|
964 |
if (iError != KErrNone || iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
965 |
{
|
|
966 |
return EInconclusive;
|
|
967 |
}
|
|
968 |
|
|
969 |
TRAPD(errorCode, iRecorder->PlayL());
|
|
970 |
CActiveScheduler::Start(); // state change call back
|
|
971 |
|
|
972 |
if (errorCode != KErrNone || iError == KErrCorrupt || (iRecorder->State() != CMdaAudioRecorderUtility::EPlaying) )
|
|
973 |
{
|
|
974 |
INFO_PRINTF4(_L("Test Failed attempting to paly: (iError, errorCode, State) (%d, %d, %d)"),
|
|
975 |
iError, errorCode, iRecorder->State() );
|
|
976 |
return EFail;
|
|
977 |
}
|
|
978 |
|
|
979 |
CActiveScheduler::Start(); // PlayL()
|
|
980 |
iRecorder->Stop();
|
|
981 |
|
|
982 |
|
|
983 |
// open an existing file to record and crop all its contents if any
|
|
984 |
iRecorder->OpenFileL(KSoundFile,
|
|
985 |
TUid::Uid(KMmfUidControllerAudio),
|
|
986 |
TUid::Null(),
|
|
987 |
TUid::Uid(KMmfUidFormatWAVWrite),
|
|
988 |
TFourCC(KMMFFourCCCodeGSM610) );
|
|
989 |
CActiveScheduler::Start();
|
|
990 |
|
|
991 |
if (iError)
|
|
992 |
{
|
|
993 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
994 |
return EFail;
|
|
995 |
}
|
|
996 |
|
|
997 |
if ( errorCode != KErrNone || iError != KErrNone || iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
998 |
{
|
|
999 |
INFO_PRINTF3(_L("Test Failed in CTestStepRecorderRecordWavGsmFail::DoTestStepPreambleL: (iError, errorCode) (%d, %d)"),iError, errorCode );
|
|
1000 |
verdict = EInconclusive;
|
|
1001 |
}
|
|
1002 |
|
|
1003 |
return verdict;
|
|
1004 |
|
|
1005 |
}
|
|
1006 |
|
|
1007 |
/**
|
|
1008 |
*
|
|
1009 |
* Do the test step.
|
|
1010 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1011 |
*
|
|
1012 |
* @return "TVerdict"
|
|
1013 |
* The result of the test step
|
|
1014 |
*
|
|
1015 |
* @xxxx
|
|
1016 |
*
|
|
1017 |
*/
|
|
1018 |
TVerdict CTestStepRecorderRecordWavGsmFail::DoTestStepL()
|
|
1019 |
{
|
|
1020 |
iTestStepResult = EPass;
|
|
1021 |
TInt err = KErrNone;
|
|
1022 |
|
|
1023 |
|
|
1024 |
TRAP( err, iRecorder->RecordL() );
|
|
1025 |
CActiveScheduler::Start();
|
|
1026 |
|
|
1027 |
iRecorder->Stop();
|
|
1028 |
|
|
1029 |
if (iError == KErrCorrupt)
|
|
1030 |
{
|
|
1031 |
iError = KErrNone;
|
|
1032 |
iTestStepResult = EPass;
|
|
1033 |
}
|
|
1034 |
|
|
1035 |
// check result
|
|
1036 |
if (iError != KErrNone ||
|
|
1037 |
err != KErrNone ||
|
|
1038 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1039 |
return EFail;
|
|
1040 |
|
|
1041 |
iHasRecorded = EFalse;
|
|
1042 |
iRecorder->Close();
|
|
1043 |
delete iRecorder;
|
|
1044 |
iRecorder = NULL;
|
|
1045 |
|
|
1046 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1047 |
// test steps return a result
|
|
1048 |
return iTestStepResult;
|
|
1049 |
}
|
|
1050 |
|
|
1051 |
/**
|
|
1052 |
*
|
|
1053 |
* Static constructor for CTestStepRecorderRecordPause.
|
|
1054 |
*
|
|
1055 |
*
|
|
1056 |
* @return "CTestStepRecorderRecordPause*"
|
|
1057 |
* The constructed CTestStepRecorderRecordPause
|
|
1058 |
*
|
|
1059 |
* @xxxx
|
|
1060 |
*
|
|
1061 |
*/
|
|
1062 |
CTestStepRecorderRecordPause* CTestStepRecorderRecordPause::NewL(const TDesC& aTestName)
|
|
1063 |
{
|
|
1064 |
CTestStepRecorderRecordPause* self = new(ELeave) CTestStepRecorderRecordPause(aTestName);
|
|
1065 |
return self;
|
|
1066 |
}
|
|
1067 |
|
|
1068 |
/**
|
|
1069 |
*
|
|
1070 |
* Test step constructor.
|
|
1071 |
* Each test step initialises its own name.
|
|
1072 |
*
|
|
1073 |
* @xxxx
|
|
1074 |
*
|
|
1075 |
*/
|
|
1076 |
CTestStepRecorderRecordPause::CTestStepRecorderRecordPause(const TDesC& aTestName) : iError(0), iHasRecorded(EFalse)
|
|
1077 |
{
|
|
1078 |
// store the name of this test case
|
|
1079 |
|
|
1080 |
// this is the name that is used by the script file
|
|
1081 |
//iTestStepName = _L("MM-MMF-ACLNT-U-0210-CP");
|
|
1082 |
//iTestStepName = _L("MM-MMF-ACLNT-U-0211-CP");
|
|
1083 |
iTestStepName = aTestName;
|
|
1084 |
}
|
|
1085 |
|
|
1086 |
/**
|
|
1087 |
*
|
|
1088 |
* Test step destructor.
|
|
1089 |
*
|
|
1090 |
* @xxxx
|
|
1091 |
*
|
|
1092 |
*/
|
|
1093 |
CTestStepRecorderRecordPause::~CTestStepRecorderRecordPause()
|
|
1094 |
{
|
|
1095 |
}
|
|
1096 |
|
|
1097 |
/**
|
|
1098 |
*
|
|
1099 |
* Test step Preamble.
|
|
1100 |
*
|
|
1101 |
* @xxxx
|
|
1102 |
*
|
|
1103 |
*/
|
|
1104 |
enum TVerdict CTestStepRecorderRecordPause::DoTestStepPreambleL(void)
|
|
1105 |
{
|
|
1106 |
enum TVerdict verdict = EPass;
|
|
1107 |
// this installs the scheduler
|
|
1108 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1109 |
|
|
1110 |
// Printing to the console and log file
|
|
1111 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::RecordL"));
|
|
1112 |
|
|
1113 |
_LIT(K210Test,"MM-MMF-ACLNT-U-0210-CP");
|
|
1114 |
_LIT(K211Test,"MM-MMF-ACLNT-U-0211-CP"); // Test step added for DEF140670
|
|
1115 |
|
|
1116 |
if(iTestStepName == K210Test)
|
|
1117 |
{
|
|
1118 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord"), iFileName))
|
|
1119 |
{
|
|
1120 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1121 |
return EInconclusive;
|
|
1122 |
}
|
|
1123 |
}
|
|
1124 |
else if(iTestStepName == K211Test)
|
|
1125 |
{
|
|
1126 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord1"), iFileName))
|
|
1127 |
{
|
|
1128 |
return EInconclusive;
|
|
1129 |
}
|
|
1130 |
}
|
|
1131 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord2"), iFileName2))
|
|
1132 |
{
|
|
1133 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1134 |
return EInconclusive;
|
|
1135 |
}
|
|
1136 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameToRecord3"), iFileName3))
|
|
1137 |
{
|
|
1138 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1139 |
return EInconclusive;
|
|
1140 |
}
|
|
1141 |
|
|
1142 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
1143 |
verdict = EInconclusive;
|
|
1144 |
|
|
1145 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
1146 |
return EFail; // check value in MoscoStateChangeEvent
|
|
1147 |
|
|
1148 |
// open an existing file to record and crop all its contents if any
|
|
1149 |
iRecorder->OpenFileL(iFileName);
|
|
1150 |
CActiveScheduler::Start();
|
|
1151 |
if (iError)
|
|
1152 |
{
|
|
1153 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
1154 |
return EFail;
|
|
1155 |
}
|
|
1156 |
|
|
1157 |
if (iError != KErrNone ||
|
|
1158 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1159 |
return EInconclusive;
|
|
1160 |
|
|
1161 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
1162 |
iBeginning = new TTimeIntervalMicroSeconds(0);
|
|
1163 |
iRecorder->SetPosition(*iBeginning);
|
|
1164 |
iRecorder->CropL();
|
|
1165 |
|
|
1166 |
if ( iError != KErrNone ||
|
|
1167 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1168 |
verdict = EInconclusive;
|
|
1169 |
|
|
1170 |
return verdict;
|
|
1171 |
|
|
1172 |
}
|
|
1173 |
|
|
1174 |
/**
|
|
1175 |
*
|
|
1176 |
* Test step Postamble.
|
|
1177 |
*
|
|
1178 |
* @xxxx
|
|
1179 |
*
|
|
1180 |
*/
|
|
1181 |
enum TVerdict CTestStepRecorderRecordPause::DoTestStepPostambleL(void)
|
|
1182 |
{
|
|
1183 |
//delete the output file
|
|
1184 |
CFileMan* fileMan;
|
|
1185 |
iFs.Connect();
|
|
1186 |
fileMan = CFileMan::NewL(iFs);
|
|
1187 |
fileMan->Delete(iFileName);
|
|
1188 |
iFs.Close();
|
|
1189 |
delete fileMan;
|
|
1190 |
fileMan = NULL;
|
|
1191 |
|
|
1192 |
delete iRecorder;
|
|
1193 |
iRecorder = NULL;
|
|
1194 |
//[ Destroy the scheduler ]
|
|
1195 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1196 |
}
|
|
1197 |
|
|
1198 |
/**
|
|
1199 |
*
|
|
1200 |
* Callback Handle.
|
|
1201 |
*
|
|
1202 |
* @xxxx
|
|
1203 |
*
|
|
1204 |
*/
|
|
1205 |
void CTestStepRecorderRecordPause::MoscoStateChangeEvent(CBase* aObject,
|
|
1206 |
TInt /*aPreviousState*/,
|
|
1207 |
TInt /*aCurrentState*/,
|
|
1208 |
TInt aErrorCode)
|
|
1209 |
{
|
|
1210 |
if (aObject != REINTERPRET_CAST(CBase*, KTestPointerValue))
|
|
1211 |
iError = KErrArgument;
|
|
1212 |
else
|
|
1213 |
iError = aErrorCode;
|
|
1214 |
CActiveScheduler::Stop();
|
|
1215 |
}
|
|
1216 |
|
|
1217 |
|
|
1218 |
// this can return a TBool hasPlayed to prove that it has played
|
|
1219 |
// but the EPlaying state seems to get preserved for some reason...
|
|
1220 |
void CTestStepRecorderRecordPause::RecordAndStartSchedulerL()
|
|
1221 |
{
|
|
1222 |
iRecorder->RecordL();
|
|
1223 |
CActiveScheduler::Start();
|
|
1224 |
// record 2 secs, ...probably silence
|
|
1225 |
User::After(10000000);
|
|
1226 |
|
|
1227 |
// Stop the recording
|
|
1228 |
iRecorder->Stop();
|
|
1229 |
User::After(2000000);
|
|
1230 |
iRecorder->RecordL();
|
|
1231 |
|
|
1232 |
User::After(10000000);
|
|
1233 |
|
|
1234 |
|
|
1235 |
if (iRecorder->State() == CMdaAudioRecorderUtility::ERecording)
|
|
1236 |
iHasRecorded = ETrue;
|
|
1237 |
iRecorder->Stop();
|
|
1238 |
}
|
|
1239 |
|
|
1240 |
/**
|
|
1241 |
*
|
|
1242 |
* Do the test step.
|
|
1243 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1244 |
*
|
|
1245 |
* @return "TVerdict"
|
|
1246 |
* The result of the test step
|
|
1247 |
*
|
|
1248 |
* @xxxx
|
|
1249 |
*
|
|
1250 |
*/
|
|
1251 |
TVerdict CTestStepRecorderRecordPause::DoTestStepL()
|
|
1252 |
{
|
|
1253 |
iTestStepResult = EPass;
|
|
1254 |
TInt err = KErrNone;
|
|
1255 |
|
|
1256 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
1257 |
|
|
1258 |
// check result
|
|
1259 |
if (iError != KErrNone ||
|
|
1260 |
err != KErrNone ||
|
|
1261 |
!iHasRecorded ||
|
|
1262 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1263 |
return EFail;
|
|
1264 |
|
|
1265 |
iHasRecorded = EFalse;
|
|
1266 |
iRecorder->Close();
|
|
1267 |
delete iRecorder;
|
|
1268 |
iRecorder = NULL;
|
|
1269 |
|
|
1270 |
/*
|
|
1271 |
// record AU file //
|
|
1272 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
1273 |
return EInconclusive;
|
|
1274 |
|
|
1275 |
// open an existing file to record and crop all its contents if any
|
|
1276 |
iRecorder->OpenFileL(iFileName2);
|
|
1277 |
CActiveScheduler::Start();
|
|
1278 |
if (iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1279 |
return EInconclusive;
|
|
1280 |
|
|
1281 |
iRecorder->SetGain(iRecorder->MaxGain()*.75);
|
|
1282 |
iRecorder->SetPosition(*iBeginning);
|
|
1283 |
iRecorder->CropL();
|
|
1284 |
|
|
1285 |
if ( iError != KErrNone ||
|
|
1286 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1287 |
return EInconclusive;
|
|
1288 |
|
|
1289 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
1290 |
|
|
1291 |
// check result
|
|
1292 |
if (iError != KErrNone ||
|
|
1293 |
err != KErrNone ||
|
|
1294 |
!iHasRecorded ||
|
|
1295 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1296 |
return EFail;
|
|
1297 |
|
|
1298 |
iHasRecorded = EFalse;
|
|
1299 |
iRecorder->Close();
|
|
1300 |
delete iRecorder;
|
|
1301 |
iRecorder = NULL;
|
|
1302 |
|
|
1303 |
// record RAW file //
|
|
1304 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
1305 |
return EInconclusive;
|
|
1306 |
|
|
1307 |
// open an existing file to record and crop all its contents if any
|
|
1308 |
iRecorder->OpenFileL(iFileName3);
|
|
1309 |
CActiveScheduler::Start();
|
|
1310 |
if (iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1311 |
return EInconclusive;
|
|
1312 |
|
|
1313 |
iRecorder->SetGain(iRecorder->MaxGain()*.75);
|
|
1314 |
iRecorder->SetPosition(*iBeginning);
|
|
1315 |
iRecorder->CropL();
|
|
1316 |
|
|
1317 |
if ( iError != KErrNone ||
|
|
1318 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1319 |
return EInconclusive;
|
|
1320 |
|
|
1321 |
TRAP( err, RecordAndStartSchedulerL() );
|
|
1322 |
|
|
1323 |
// check result
|
|
1324 |
if (iError != KErrNone ||
|
|
1325 |
err != KErrNone ||
|
|
1326 |
!iHasRecorded ||
|
|
1327 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
1328 |
return EFail;
|
|
1329 |
|
|
1330 |
iHasRecorded = EFalse;
|
|
1331 |
iRecorder->Close();
|
|
1332 |
delete iRecorder;
|
|
1333 |
iRecorder = NULL;
|
|
1334 |
*/
|
|
1335 |
|
|
1336 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1337 |
// test steps return a result
|
|
1338 |
return iTestStepResult;
|
|
1339 |
}
|
|
1340 |
|
|
1341 |
/**
|
|
1342 |
*
|
|
1343 |
* Static constructor for CTestStepRecorderError.
|
|
1344 |
*
|
|
1345 |
*
|
|
1346 |
* @return "CTestStepRecorderError*"
|
|
1347 |
* The constructed CTestStepRecorderError
|
|
1348 |
*
|
|
1349 |
* @xxxx
|
|
1350 |
*
|
|
1351 |
*/
|
|
1352 |
CTestStepRecorderError* CTestStepRecorderError::NewL()
|
|
1353 |
{
|
|
1354 |
CTestStepRecorderError* self = new(ELeave) CTestStepRecorderError;
|
|
1355 |
CleanupStack::PushL(self);
|
|
1356 |
self->ConstructL();
|
|
1357 |
CleanupStack::Pop(); // self
|
|
1358 |
return self;
|
|
1359 |
}
|
|
1360 |
|
|
1361 |
/**
|
|
1362 |
*
|
|
1363 |
* Static constructor for CTestStepRecorderError.
|
|
1364 |
*
|
|
1365 |
*
|
|
1366 |
* @return "CTestStepRecorderError*"
|
|
1367 |
* The constructed CTestStepRecorderError
|
|
1368 |
*
|
|
1369 |
* @xxxx
|
|
1370 |
*
|
|
1371 |
*/
|
|
1372 |
void CTestStepRecorderError::ConstructL()
|
|
1373 |
{
|
|
1374 |
//[ lets initialise the dispatch table
|
|
1375 |
//with a default method for now ]
|
|
1376 |
ASSERT( TestStateTerminal < KMaxMethods );
|
|
1377 |
|
|
1378 |
iStates[TestStateIdle] = &CTestStepRecorderError::IdleStateChangeEventL;
|
|
1379 |
iStates[TestStateOne] = &CTestStepRecorderError::StateOneChangeEventL;
|
|
1380 |
iStates[TestStateTwo] = &CTestStepRecorderError::StateTwoChangeEventL;
|
|
1381 |
iStates[TestStateThree] = &CTestStepRecorderError::StateThreeChangeEventL;
|
|
1382 |
iStates[TestStateFour] = &CTestStepRecorderError::StateFourChangeEventL;
|
|
1383 |
iStates[TestStateTerminal] = &CTestStepRecorderError::StateTerminalChangeEventL;
|
|
1384 |
|
|
1385 |
//[ set the initial state to idle ]
|
|
1386 |
iTestState = TestStateIdle;
|
|
1387 |
}
|
|
1388 |
|
|
1389 |
/**
|
|
1390 |
* Enters here as iRecorder goes from ENotReady to EOpen
|
|
1391 |
*
|
|
1392 |
* Set the priority of iRecorder to EMdaPriorityMin
|
|
1393 |
* Set the parent of iRecorderHighPriority to be KTestPointerRecorder2 so we can distinguish state changes
|
|
1394 |
*
|
|
1395 |
* Next state TestStateOne
|
|
1396 |
*/
|
|
1397 |
void CTestStepRecorderError::IdleStateChangeEventL(CBase* aObject,
|
|
1398 |
TInt aPreviousState,
|
|
1399 |
TInt aCurrentState,
|
|
1400 |
TInt aErrorCode )
|
|
1401 |
{
|
|
1402 |
//[ precondition the state is valid ]
|
|
1403 |
ASSERT(IsValidState() );
|
|
1404 |
|
|
1405 |
//This is state change from iRecorder
|
|
1406 |
if(REINTERPRET_CAST(void*,aObject) != REINTERPRET_CAST(void*,KTestPointerRecorder1))
|
|
1407 |
{
|
|
1408 |
INFO_PRINTF2( _L("IdleStateChangeEventL error from wrong object 0x%x"), aObject);
|
|
1409 |
iTestStepResult = EFail;
|
|
1410 |
CActiveScheduler::Stop();
|
|
1411 |
}
|
|
1412 |
|
|
1413 |
//Correct state change
|
|
1414 |
if((aPreviousState != CMdaAudioClipUtility::ENotReady) ||
|
|
1415 |
(aCurrentState != CMdaAudioClipUtility::EOpen))
|
|
1416 |
{
|
|
1417 |
INFO_PRINTF1( _L("IdleStateChangeEventL incorrect state change"));
|
|
1418 |
iTestStepResult = EFail;
|
|
1419 |
CActiveScheduler::Stop();
|
|
1420 |
}
|
|
1421 |
|
|
1422 |
|
|
1423 |
//[fail if there was an error]
|
|
1424 |
if(aErrorCode != KErrNone)
|
|
1425 |
{
|
|
1426 |
INFO_PRINTF2( _L("IdleStateChangeEventL error %d"),aErrorCode);
|
|
1427 |
iTestStepResult = EFail;
|
|
1428 |
CActiveScheduler::Stop();
|
|
1429 |
}
|
|
1430 |
|
|
1431 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioRecord2"), iFileName2))
|
|
1432 |
{
|
|
1433 |
INFO_PRINTF1( _L("IdleStateChangeEventL couldn't get filename from config AudioRecord2"));
|
|
1434 |
iTestStepResult = EInconclusive;
|
|
1435 |
CActiveScheduler::Stop();
|
|
1436 |
}
|
|
1437 |
|
|
1438 |
|
|
1439 |
if (SetAudRecorderParent(iRecorderHighPriority, REINTERPRET_CAST(CMdaAudioRecorderUtility*,KTestPointerRecorder2 )) != KErrNone)
|
|
1440 |
{
|
|
1441 |
INFO_PRINTF1( _L("IdleStateChangeEventL failed to set parent"));
|
|
1442 |
iTestStepResult = EFail;
|
|
1443 |
CActiveScheduler::Stop();
|
|
1444 |
}
|
|
1445 |
|
|
1446 |
|
|
1447 |
//[ open the second recorder and update state ]
|
|
1448 |
// open an existing file to record and crop all its contents if any
|
|
1449 |
iRecorderHighPriority->OpenFileL(iFileName2);
|
|
1450 |
|
|
1451 |
//[lets do some configuration on the first recorder]
|
|
1452 |
iRecorder->SetGain(iRecorder->MaxGain()/2);
|
|
1453 |
iRecorder->SetPriority( EMdaPriorityMin, EMdaPriorityPreferenceNone );
|
|
1454 |
iRecorder->SetPosition(TTimeIntervalMicroSeconds(0));
|
|
1455 |
|
|
1456 |
//[ update the state ]
|
|
1457 |
TestState newState = TestStateOne;
|
|
1458 |
SetState( newState );
|
|
1459 |
|
|
1460 |
//[ post condition state is valid ]
|
|
1461 |
ASSERT(IsValidState() );
|
|
1462 |
}
|
|
1463 |
|
|
1464 |
/**
|
|
1465 |
* Enters here as iRecorderHighPriority goes from ENotReady to EOpen
|
|
1466 |
*
|
|
1467 |
* Set the priority of iRecorderHighPriority to EMdaPriorityMax
|
|
1468 |
* Start recording to iRecorder
|
|
1469 |
*
|
|
1470 |
* Next state TestStateTwo
|
|
1471 |
*
|
|
1472 |
*/
|
|
1473 |
void CTestStepRecorderError::StateOneChangeEventL(CBase* aObject,
|
|
1474 |
TInt aPreviousState,
|
|
1475 |
TInt aCurrentState,
|
|
1476 |
TInt aErrorCode )
|
|
1477 |
{
|
|
1478 |
//[ precondition state is valid ]
|
|
1479 |
ASSERT( IsValidState() );
|
|
1480 |
|
|
1481 |
//[fail if there was an error]
|
|
1482 |
if(aErrorCode != KErrNone)
|
|
1483 |
{
|
|
1484 |
INFO_PRINTF2( _L("StateOneChangeEventL error %d"),aErrorCode);
|
|
1485 |
iTestStepResult = EFail;
|
|
1486 |
CActiveScheduler::Stop();
|
|
1487 |
}
|
|
1488 |
|
|
1489 |
|
|
1490 |
//This is state change from iRecorderHighPriority
|
|
1491 |
if(REINTERPRET_CAST(void*,aObject) != REINTERPRET_CAST(void*,KTestPointerRecorder2))
|
|
1492 |
{
|
|
1493 |
INFO_PRINTF2( _L("StateOneChangeEventL error from wrong object 0x%x"), aObject);
|
|
1494 |
iTestStepResult = EFail;
|
|
1495 |
CActiveScheduler::Stop();
|
|
1496 |
}
|
|
1497 |
|
|
1498 |
//Correct state change
|
|
1499 |
if((aPreviousState != CMdaAudioClipUtility::ENotReady) ||
|
|
1500 |
(aCurrentState != CMdaAudioClipUtility::EOpen))
|
|
1501 |
{
|
|
1502 |
INFO_PRINTF1( _L("StateOneChangeEventL incorrect state change"));
|
|
1503 |
iTestStepResult = EFail;
|
|
1504 |
CActiveScheduler::Stop();
|
|
1505 |
}
|
|
1506 |
|
|
1507 |
|
|
1508 |
|
|
1509 |
|
|
1510 |
//[ start recording with recorder 1]
|
|
1511 |
iRecorder->RecordL();
|
|
1512 |
User::After(2500000);
|
|
1513 |
|
|
1514 |
//[lets do some configuration on the first recorder]
|
|
1515 |
iRecorderHighPriority->SetGain(iRecorder->MaxGain()/2);
|
|
1516 |
iRecorderHighPriority->SetPriority( EMdaPriorityMax, EMdaPriorityPreferenceNone );
|
|
1517 |
iRecorderHighPriority->SetPosition(TTimeIntervalMicroSeconds(0));
|
|
1518 |
|
|
1519 |
TestState newState = TestStateTwo;
|
|
1520 |
//[ update the state ]
|
|
1521 |
SetState(newState);
|
|
1522 |
|
|
1523 |
//[ post condition state is valid ]
|
|
1524 |
ASSERT( IsValidState() );
|
|
1525 |
}
|
|
1526 |
|
|
1527 |
/**
|
|
1528 |
*
|
|
1529 |
* Enters here as iRecorder goes from EOpen to ERecording
|
|
1530 |
*
|
|
1531 |
* Start recording to iRecorderHighPriority
|
|
1532 |
*
|
|
1533 |
* Next state TestStateThree
|
|
1534 |
*
|
|
1535 |
*/
|
|
1536 |
void CTestStepRecorderError::StateTwoChangeEventL(CBase* aObject,
|
|
1537 |
TInt aPreviousState,
|
|
1538 |
TInt aCurrentState,
|
|
1539 |
TInt aErrorCode )
|
|
1540 |
{
|
|
1541 |
//[ precondition state is valid ]
|
|
1542 |
ASSERT( IsValidState() );
|
|
1543 |
|
|
1544 |
//[fail if there was an error]
|
|
1545 |
if(aErrorCode != KErrNone)
|
|
1546 |
{
|
|
1547 |
INFO_PRINTF2( _L("StateTwoChangeEventL error %d"),aErrorCode);
|
|
1548 |
iTestStepResult = EFail;
|
|
1549 |
CActiveScheduler::Stop();
|
|
1550 |
}
|
|
1551 |
|
|
1552 |
//This is state change from iRecorder
|
|
1553 |
if(REINTERPRET_CAST(void*,aObject) != REINTERPRET_CAST(void*,KTestPointerRecorder1))
|
|
1554 |
{
|
|
1555 |
INFO_PRINTF2( _L("StateTwoChangeEventL error from wrong object 0x%x"), aObject);
|
|
1556 |
iTestStepResult = EFail;
|
|
1557 |
CActiveScheduler::Stop();
|
|
1558 |
}
|
|
1559 |
|
|
1560 |
//Correct state change
|
|
1561 |
if((aPreviousState != CMdaAudioClipUtility::EOpen) ||
|
|
1562 |
(aCurrentState != CMdaAudioClipUtility::ERecording))
|
|
1563 |
{
|
|
1564 |
INFO_PRINTF1( _L("StateTwoChangeEventL incorrect state change"));
|
|
1565 |
iTestStepResult = EFail;
|
|
1566 |
CActiveScheduler::Stop();
|
|
1567 |
}
|
|
1568 |
|
|
1569 |
|
|
1570 |
|
|
1571 |
//[ start recording with recorder 1]
|
|
1572 |
iRecorderHighPriority->RecordL();
|
|
1573 |
|
|
1574 |
//[ update state ]
|
|
1575 |
TestState newState = TestStateThree;
|
|
1576 |
SetState(newState);
|
|
1577 |
|
|
1578 |
//[ post condition state is valid ]
|
|
1579 |
ASSERT( IsValidState() );
|
|
1580 |
}
|
|
1581 |
|
|
1582 |
/**
|
|
1583 |
* Enters here because of two reasons:-
|
|
1584 |
*
|
|
1585 |
* 1. iRecorder goes from ERecording to EOpen as it has been thrown off by
|
|
1586 |
* iRecorderHighPriority starting to record
|
|
1587 |
*
|
|
1588 |
* aErrorCode == KErrInUse
|
|
1589 |
*
|
|
1590 |
* 2. iRecorderHighPriority goes from EOpen to ERecording
|
|
1591 |
* aErrorCode == KErrNone
|
|
1592 |
*
|
|
1593 |
*
|
|
1594 |
* Next state TestStateTerminal
|
|
1595 |
*
|
|
1596 |
*/
|
|
1597 |
void CTestStepRecorderError::StateThreeChangeEventL(CBase* aObject,
|
|
1598 |
TInt aPreviousState,
|
|
1599 |
TInt aCurrentState,
|
|
1600 |
TInt aErrorCode )
|
|
1601 |
{
|
|
1602 |
//[does nothing for now ]
|
|
1603 |
//[ precondition state is valid ]
|
|
1604 |
ASSERT( IsValidState() );
|
|
1605 |
|
|
1606 |
|
|
1607 |
//This is a state change from iRecorder
|
|
1608 |
if(REINTERPRET_CAST(void*,aObject) == REINTERPRET_CAST(void*,KTestPointerRecorder1))
|
|
1609 |
{
|
|
1610 |
if( aErrorCode != KErrInUse )
|
|
1611 |
{
|
|
1612 |
INFO_PRINTF2( _L("StateThreeChangeEventL incorrect error received %d"), aErrorCode);
|
|
1613 |
iTestStepResult = EFail;
|
|
1614 |
CActiveScheduler::Stop();
|
|
1615 |
}
|
|
1616 |
|
|
1617 |
//Correct state change
|
|
1618 |
if((aPreviousState != CMdaAudioClipUtility::ERecording) ||
|
|
1619 |
(aCurrentState != CMdaAudioClipUtility::EOpen))
|
|
1620 |
{
|
|
1621 |
INFO_PRINTF1( _L("StateThreeChangeEventL incorrect state change"));
|
|
1622 |
iTestStepResult = EFail;
|
|
1623 |
CActiveScheduler::Stop();
|
|
1624 |
}
|
|
1625 |
}
|
|
1626 |
//This is a state change from iRecorderHighPriority
|
|
1627 |
else if(REINTERPRET_CAST(void*,aObject) == REINTERPRET_CAST(void*,KTestPointerRecorder2))
|
|
1628 |
{
|
|
1629 |
//Correct state change
|
|
1630 |
if((aPreviousState != CMdaAudioClipUtility::EOpen) ||
|
|
1631 |
(aCurrentState != CMdaAudioClipUtility::ERecording))
|
|
1632 |
{
|
|
1633 |
INFO_PRINTF1( _L("StateThreeChangeEventL incorrect state change"));
|
|
1634 |
iTestStepResult = EFail;
|
|
1635 |
CActiveScheduler::Stop();
|
|
1636 |
}
|
|
1637 |
}
|
|
1638 |
else
|
|
1639 |
{
|
|
1640 |
INFO_PRINTF1( _L("StateThreeChangeEventL state change from unknown object"));
|
|
1641 |
iTestStepResult = EFail;
|
|
1642 |
CActiveScheduler::Stop();
|
|
1643 |
}
|
|
1644 |
|
|
1645 |
|
|
1646 |
//[Set state]
|
|
1647 |
TestState newState = TestStateTerminal;
|
|
1648 |
SetState(newState);
|
|
1649 |
|
|
1650 |
//[ post condition state is valid ]
|
|
1651 |
ASSERT( IsValidState() );
|
|
1652 |
}
|
|
1653 |
|
|
1654 |
/**
|
|
1655 |
* Un used state
|
|
1656 |
*
|
|
1657 |
* @xxxx
|
|
1658 |
*
|
|
1659 |
*/
|
|
1660 |
void CTestStepRecorderError::StateFourChangeEventL(CBase* /*aObject*/,
|
|
1661 |
TInt /*aPreviousState*/,
|
|
1662 |
TInt /*aCurrentState*/,
|
|
1663 |
TInt /*aErrorCode*/ )
|
|
1664 |
{
|
|
1665 |
//[ precondition state is valid ]
|
|
1666 |
ASSERT( IsValidState() );
|
|
1667 |
|
|
1668 |
|
|
1669 |
//[Update next State]
|
|
1670 |
TestState newState = TestStateTerminal;
|
|
1671 |
SetState(newState);
|
|
1672 |
|
|
1673 |
//[ post condition state is valid ]
|
|
1674 |
ASSERT( IsValidState() );
|
|
1675 |
}
|
|
1676 |
|
|
1677 |
|
|
1678 |
/**
|
|
1679 |
* Enters here because of two reasons:-
|
|
1680 |
*
|
|
1681 |
* 1. iRecorder goes from ERecording to EOpen as it has been thrown off by
|
|
1682 |
* iRecorderHighPriority starting to record
|
|
1683 |
*
|
|
1684 |
* aErrorCode == KErrInUse
|
|
1685 |
*
|
|
1686 |
* 2. iRecorderHighPriority goes from EOpen to ERecording
|
|
1687 |
* aErrorCode == KErrNone
|
|
1688 |
*
|
|
1689 |
* Which one is the other to that which occured in StateThreeChangeEventL
|
|
1690 |
* as there is a possible race condition on which event we receive first
|
|
1691 |
*
|
|
1692 |
*/
|
|
1693 |
void CTestStepRecorderError::StateTerminalChangeEventL(CBase* aObject,
|
|
1694 |
TInt aPreviousState,
|
|
1695 |
TInt aCurrentState,
|
|
1696 |
TInt aErrorCode )
|
|
1697 |
{
|
|
1698 |
//[ pre condition state is valid ]
|
|
1699 |
ASSERT( IsValidState() );
|
|
1700 |
|
|
1701 |
//This is a state change from iRecorder
|
|
1702 |
if(REINTERPRET_CAST(void*,aObject) == REINTERPRET_CAST(void*,KTestPointerRecorder1))
|
|
1703 |
{
|
|
1704 |
if( aErrorCode != KErrInUse )
|
|
1705 |
{
|
|
1706 |
INFO_PRINTF2( _L("StateTerminalChangeEventL incorrect error received %d"), aErrorCode);
|
|
1707 |
iTestStepResult = EFail;
|
|
1708 |
CActiveScheduler::Stop();
|
|
1709 |
}
|
|
1710 |
|
|
1711 |
//Correct state change
|
|
1712 |
if((aPreviousState != CMdaAudioClipUtility::ERecording) ||
|
|
1713 |
(aCurrentState != CMdaAudioClipUtility::EOpen))
|
|
1714 |
{
|
|
1715 |
INFO_PRINTF1( _L("StateTerminalChangeEventL incorrect state change"));
|
|
1716 |
iTestStepResult = EFail;
|
|
1717 |
CActiveScheduler::Stop();
|
|
1718 |
}
|
|
1719 |
}
|
|
1720 |
//This is a state change from iRecorderHighPriority
|
|
1721 |
else if(REINTERPRET_CAST(void*,aObject) == REINTERPRET_CAST(void*,KTestPointerRecorder2))
|
|
1722 |
{
|
|
1723 |
//Correct state change
|
|
1724 |
if((aPreviousState != CMdaAudioClipUtility::EOpen) ||
|
|
1725 |
(aCurrentState != CMdaAudioClipUtility::ERecording))
|
|
1726 |
{
|
|
1727 |
INFO_PRINTF1( _L("StateTerminalChangeEventL incorrect state change"));
|
|
1728 |
iTestStepResult = EFail;
|
|
1729 |
CActiveScheduler::Stop();
|
|
1730 |
}
|
|
1731 |
}
|
|
1732 |
else
|
|
1733 |
{
|
|
1734 |
INFO_PRINTF1( _L("StateTerminalChangeEventL state change from unknown object"));
|
|
1735 |
iTestStepResult = EFail;
|
|
1736 |
CActiveScheduler::Stop();
|
|
1737 |
}
|
|
1738 |
|
|
1739 |
//[ stop recording with recorder 1]
|
|
1740 |
INFO_PRINTF1( _L("Stopping iRecorderHighPriority"));
|
|
1741 |
|
|
1742 |
iRecorderHighPriority->Stop();
|
|
1743 |
|
|
1744 |
INFO_PRINTF1( _L("iRecorderHighPriority stopped"));
|
|
1745 |
|
|
1746 |
|
|
1747 |
CActiveScheduler::Stop();
|
|
1748 |
|
|
1749 |
//[ post condition state is valid ]
|
|
1750 |
ASSERT( IsValidState() );
|
|
1751 |
}
|
|
1752 |
|
|
1753 |
|
|
1754 |
/**
|
|
1755 |
*
|
|
1756 |
* Test step constructor.
|
|
1757 |
* Each test step initialises its own name.
|
|
1758 |
*
|
|
1759 |
* @xxxx
|
|
1760 |
*
|
|
1761 |
*/
|
|
1762 |
void CTestStepRecorderError::PrintState(CBase* aObject,
|
|
1763 |
TInt aPreviousState,
|
|
1764 |
TInt aCurrentState,
|
|
1765 |
TInt aErrorCode )
|
|
1766 |
{
|
|
1767 |
INFO_PRINTF6( _L("Object %x aPrevState %d CurrentState %d, ErrorCode %d FsmState %d"), aObject, aPreviousState, aCurrentState, aErrorCode, iTestState );
|
|
1768 |
}
|
|
1769 |
|
|
1770 |
|
|
1771 |
/**
|
|
1772 |
*
|
|
1773 |
* Test step constructor.
|
|
1774 |
* Each test step initialises its own name.
|
|
1775 |
*
|
|
1776 |
* @xxxx
|
|
1777 |
*
|
|
1778 |
*/
|
|
1779 |
TBool CTestStepRecorderError::IsValidState() const
|
|
1780 |
{
|
|
1781 |
// provide implementation here
|
|
1782 |
TBool result = ETrue;
|
|
1783 |
if( (iTestState < TestStateIdle ) || ( iTestState > TestStateTerminal ) )
|
|
1784 |
{
|
|
1785 |
result = EFalse;
|
|
1786 |
}
|
|
1787 |
return result;
|
|
1788 |
}
|
|
1789 |
|
|
1790 |
/**
|
|
1791 |
*
|
|
1792 |
* Test step constructor.
|
|
1793 |
* Each test step initialises its own name.
|
|
1794 |
*
|
|
1795 |
* @xxxx
|
|
1796 |
*
|
|
1797 |
*/
|
|
1798 |
CTestStepRecorderError::TestState CTestStepRecorderError::GetTestState() const
|
|
1799 |
{
|
|
1800 |
return iTestState;
|
|
1801 |
}
|
|
1802 |
|
|
1803 |
/**
|
|
1804 |
*
|
|
1805 |
* Test step constructor.
|
|
1806 |
* Each test step initialises its own name.
|
|
1807 |
*
|
|
1808 |
* @xxxx
|
|
1809 |
*
|
|
1810 |
*/
|
|
1811 |
void CTestStepRecorderError::SetState( CTestStepRecorderError::TestState& aState )
|
|
1812 |
{
|
|
1813 |
iTestState = aState ;
|
|
1814 |
}
|
|
1815 |
|
|
1816 |
|
|
1817 |
/**
|
|
1818 |
*
|
|
1819 |
* Test step constructor.
|
|
1820 |
* Each test step initialises its own name.
|
|
1821 |
*
|
|
1822 |
* @xxxx
|
|
1823 |
*
|
|
1824 |
*/
|
|
1825 |
CTestStepRecorderError::CTestStepRecorderError() : iError(0), iHasRecorded(EFalse)
|
|
1826 |
{
|
|
1827 |
// store the name of this test case
|
|
1828 |
// this is the name that is used by the script file
|
|
1829 |
iTestStepName = _L("MM-MMF-ACLNT-U-0014-CP");
|
|
1830 |
}
|
|
1831 |
|
|
1832 |
/**
|
|
1833 |
*
|
|
1834 |
* Test step destructor.
|
|
1835 |
*
|
|
1836 |
* @xxxx
|
|
1837 |
*
|
|
1838 |
*/
|
|
1839 |
CTestStepRecorderError::~CTestStepRecorderError()
|
|
1840 |
{
|
|
1841 |
}
|
|
1842 |
|
|
1843 |
/**
|
|
1844 |
*
|
|
1845 |
* Test step Preamble.
|
|
1846 |
*
|
|
1847 |
* @xxxx
|
|
1848 |
*
|
|
1849 |
*/
|
|
1850 |
enum TVerdict CTestStepRecorderError::DoTestStepPreambleL(void)
|
|
1851 |
{
|
|
1852 |
|
|
1853 |
enum TVerdict verdict = EPass;
|
|
1854 |
// this installs the scheduler
|
|
1855 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1856 |
|
|
1857 |
return verdict;
|
|
1858 |
}
|
|
1859 |
|
|
1860 |
/**
|
|
1861 |
*
|
|
1862 |
* Test step Postamble.
|
|
1863 |
*
|
|
1864 |
* @xxxx
|
|
1865 |
*
|
|
1866 |
*/
|
|
1867 |
enum TVerdict CTestStepRecorderError::DoTestStepPostambleL(void)
|
|
1868 |
{
|
|
1869 |
//delete the output file
|
|
1870 |
CFileMan* fileMan;
|
|
1871 |
iFs.Connect();
|
|
1872 |
fileMan = CFileMan::NewL(iFs);
|
|
1873 |
iFs.Close();
|
|
1874 |
delete fileMan;
|
|
1875 |
fileMan = NULL;
|
|
1876 |
|
|
1877 |
delete iRecorder;
|
|
1878 |
iRecorder = NULL;
|
|
1879 |
|
|
1880 |
delete iRecorderHighPriority;
|
|
1881 |
iRecorderHighPriority = NULL;
|
|
1882 |
|
|
1883 |
//[ Destroy the scheduler ]
|
|
1884 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1885 |
}
|
|
1886 |
|
|
1887 |
/**
|
|
1888 |
*
|
|
1889 |
* Callback Handle.
|
|
1890 |
*
|
|
1891 |
* @xxxx
|
|
1892 |
*
|
|
1893 |
*/
|
|
1894 |
void CTestStepRecorderError::MoscoStateChangeEvent(CBase* aObject,
|
|
1895 |
TInt aPreviousState,
|
|
1896 |
TInt aCurrentState,
|
|
1897 |
TInt aErrorcCode)
|
|
1898 |
{
|
|
1899 |
//[ precondition state is valid ]
|
|
1900 |
ASSERT( IsValidState());
|
|
1901 |
|
|
1902 |
//[ print incoming state ]
|
|
1903 |
PrintState( aObject, aPreviousState, aCurrentState, aErrorcCode );
|
|
1904 |
|
|
1905 |
INFO_PRINTF2(_L("Dispatching into state %d"), iTestState);
|
|
1906 |
|
|
1907 |
|
|
1908 |
//dispatch the reponse
|
|
1909 |
(this->*iStates[iTestState])( aObject, aPreviousState, aCurrentState, aErrorcCode );
|
|
1910 |
|
|
1911 |
//[ post condition state is valid ]
|
|
1912 |
ASSERT( IsValidState());
|
|
1913 |
}
|
|
1914 |
|
|
1915 |
/**
|
|
1916 |
*
|
|
1917 |
* IsValidTestState()
|
|
1918 |
*
|
|
1919 |
*/
|
|
1920 |
|
|
1921 |
|
|
1922 |
// this can return a TBool hasPlayed to prove that it has played
|
|
1923 |
// but the EPlaying state seems to get preserved for some reason...
|
|
1924 |
void CTestStepRecorderError::RecordAndStartSchedulerL()
|
|
1925 |
{
|
|
1926 |
//[ This method has been deprecated ]
|
|
1927 |
ASSERT(0);
|
|
1928 |
}
|
|
1929 |
|
|
1930 |
/**
|
|
1931 |
*
|
|
1932 |
* Do the test step.
|
|
1933 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1934 |
*
|
|
1935 |
* @return "TVerdict"
|
|
1936 |
* The result of the test step
|
|
1937 |
*
|
|
1938 |
* @xxxx
|
|
1939 |
*
|
|
1940 |
*/
|
|
1941 |
|
|
1942 |
TInt aFunction(TAny* /*aPtr*/)
|
|
1943 |
{
|
|
1944 |
return 0;
|
|
1945 |
}
|
|
1946 |
|
|
1947 |
TVerdict CTestStepRecorderError::DoTestStepL()
|
|
1948 |
{
|
|
1949 |
//[temporary contruction to test the fsm ]
|
|
1950 |
iTestStepResult = EPass;
|
|
1951 |
|
|
1952 |
// Printing to the console and log file
|
|
1953 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0014-CP"));
|
|
1954 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility on error"));
|
|
1955 |
|
|
1956 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
1957 |
return EInconclusive;
|
|
1958 |
|
|
1959 |
if ( (iRecorderHighPriority = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
1960 |
return EInconclusive;
|
|
1961 |
|
|
1962 |
//[ copy files from back up file ]
|
|
1963 |
//[ ensure files do not exist ]
|
|
1964 |
iFs.Connect();
|
|
1965 |
CFileMan* fileMan = CFileMan::NewL(iFs);
|
|
1966 |
CleanupStack::PushL(fileMan);
|
|
1967 |
|
|
1968 |
fileMan->Delete( KTestRecordTwo );
|
|
1969 |
fileMan->Delete( KTestRecordOne );
|
|
1970 |
User::LeaveIfError(fileMan->Copy( KTestRecordThree, KTestRecordTwo ));
|
|
1971 |
User::LeaveIfError(fileMan->Copy( KTestRecordThree, KTestRecordOne ));
|
|
1972 |
CleanupStack::PopAndDestroy(fileMan);
|
|
1973 |
|
|
1974 |
//set up file name
|
|
1975 |
|
|
1976 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioRecord1"), iFileName))
|
|
1977 |
{
|
|
1978 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1979 |
return EInconclusive;
|
|
1980 |
}
|
|
1981 |
|
|
1982 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*,KTestPointerRecorder1 )) != KErrNone)
|
|
1983 |
return EInconclusive;; // check value in MoscoStateChangeEvent
|
|
1984 |
|
|
1985 |
iRecorder->OpenFileL(iFileName);
|
|
1986 |
CActiveScheduler::Start();
|
|
1987 |
|
|
1988 |
//[ if we got here we are ok ]
|
|
1989 |
|
|
1990 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1991 |
// test steps return a result
|
|
1992 |
return iTestStepResult;
|
|
1993 |
}
|
|
1994 |
|
|
1995 |
|
|
1996 |
/**
|
|
1997 |
*
|
|
1998 |
* Static constructor for CTestStepRecorderMaxWriteLength.
|
|
1999 |
*
|
|
2000 |
*
|
|
2001 |
* @return "CTestStepRecorderMaxWriteLength*"
|
|
2002 |
* The constructed CTestStepRecorderMaxWriteLength
|
|
2003 |
*
|
|
2004 |
* @xxxx
|
|
2005 |
*
|
|
2006 |
*/
|
|
2007 |
CTestStepRecorderMaxWriteLength* CTestStepRecorderMaxWriteLength::NewL()
|
|
2008 |
{
|
|
2009 |
CTestStepRecorderMaxWriteLength* self = new(ELeave) CTestStepRecorderMaxWriteLength;
|
|
2010 |
return self;
|
|
2011 |
}
|
|
2012 |
|
|
2013 |
/**
|
|
2014 |
*
|
|
2015 |
* Test step constructor.
|
|
2016 |
* Each test step initialises its own name.
|
|
2017 |
*
|
|
2018 |
* @xxxx
|
|
2019 |
*
|
|
2020 |
*/
|
|
2021 |
CTestStepRecorderMaxWriteLength::CTestStepRecorderMaxWriteLength() : iError(0)
|
|
2022 |
{
|
|
2023 |
// store the name of this test case
|
|
2024 |
// this is the name that is used by the script file
|
|
2025 |
iTestStepName = _L("MM-MMF-ACLNT-U-0290-HP");
|
|
2026 |
}
|
|
2027 |
|
|
2028 |
/**
|
|
2029 |
*
|
|
2030 |
* Test step destructor.
|
|
2031 |
*
|
|
2032 |
* @xxxx
|
|
2033 |
*
|
|
2034 |
*/
|
|
2035 |
CTestStepRecorderMaxWriteLength::~CTestStepRecorderMaxWriteLength()
|
|
2036 |
{
|
|
2037 |
}
|
|
2038 |
|
|
2039 |
/**
|
|
2040 |
*
|
|
2041 |
* Test step Preamble.
|
|
2042 |
*
|
|
2043 |
* @xxxx
|
|
2044 |
*
|
|
2045 |
*/
|
|
2046 |
enum TVerdict CTestStepRecorderMaxWriteLength::DoTestStepPreambleL(void)
|
|
2047 |
{
|
|
2048 |
enum TVerdict verdict = EPass;
|
|
2049 |
// this installs the scheduler
|
|
2050 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
2051 |
|
|
2052 |
// Printing to the console and log file
|
|
2053 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0290-HP"));
|
|
2054 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::SetMaxWriteLength with argument = -1"));
|
|
2055 |
|
|
2056 |
// set the file name to something weird
|
|
2057 |
iFileName.Set( _L("c:\\szhgefdsfe.wav"));
|
|
2058 |
|
|
2059 |
//[ ensure the file does not exist]
|
|
2060 |
|
|
2061 |
if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
|
|
2062 |
verdict = EInconclusive;
|
|
2063 |
|
|
2064 |
if (SetAudRecorderParent(iRecorder, REINTERPRET_CAST(CMdaAudioRecorderUtility*, KTestPointerValue)) != KErrNone)
|
|
2065 |
return EFail; // check value in MoscoStateChangeEvent
|
|
2066 |
|
|
2067 |
// open an existing file to record and crop all its contents if any
|
|
2068 |
iRecorder->OpenFileL(iFileName);
|
|
2069 |
CActiveScheduler::Start();
|
|
2070 |
if (iError)
|
|
2071 |
{
|
|
2072 |
INFO_PRINTF2(_L("open returned %d"), iError);
|
|
2073 |
return EFail;
|
|
2074 |
}
|
|
2075 |
|
|
2076 |
if (iError != KErrNone ||
|
|
2077 |
iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
|
|
2078 |
return EInconclusive;
|
|
2079 |
|
|
2080 |
// if it gets here "-1" is accepted
|
|
2081 |
return verdict;
|
|
2082 |
}
|
|
2083 |
|
|
2084 |
/**
|
|
2085 |
*
|
|
2086 |
* Test step Postamble.
|
|
2087 |
*
|
|
2088 |
* @xxxx
|
|
2089 |
*
|
|
2090 |
*/
|
|
2091 |
enum TVerdict CTestStepRecorderMaxWriteLength::DoTestStepPostambleL(void)
|
|
2092 |
{
|
|
2093 |
//delete the output file
|
|
2094 |
CFileMan* fileMan;
|
|
2095 |
iFs.Connect();
|
|
2096 |
fileMan = CFileMan::NewL(iFs);
|
|
2097 |
fileMan->Delete(iFileName);
|
|
2098 |
iFs.Close();
|
|
2099 |
delete fileMan;
|
|
2100 |
fileMan = NULL;
|
|
2101 |
|
|
2102 |
delete iRecorder;
|
|
2103 |
iRecorder = NULL;
|
|
2104 |
//[ Destroy the scheduler ]
|
|
2105 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2106 |
}
|
|
2107 |
|
|
2108 |
/**
|
|
2109 |
*
|
|
2110 |
* Callback Handle.
|
|
2111 |
*
|
|
2112 |
* @xxxx
|
|
2113 |
*
|
|
2114 |
*/
|
|
2115 |
void CTestStepRecorderMaxWriteLength::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
2116 |
TInt /*aPreviousState*/,
|
|
2117 |
TInt /*aCurrentState*/,
|
|
2118 |
TInt /*aErrorCode*/)
|
|
2119 |
{
|
|
2120 |
CActiveScheduler::Stop();
|
|
2121 |
}
|
|
2122 |
|
|
2123 |
|
|
2124 |
/**
|
|
2125 |
*
|
|
2126 |
* Do the test step.
|
|
2127 |
* Each test step must supply an implementation for DoTestStepL.
|
|
2128 |
*
|
|
2129 |
* @return "TVerdict"
|
|
2130 |
* The result of the test step
|
|
2131 |
*
|
|
2132 |
* @xxxx
|
|
2133 |
*
|
|
2134 |
*/
|
|
2135 |
TVerdict CTestStepRecorderMaxWriteLength::DoTestStepL()
|
|
2136 |
{
|
|
2137 |
iTestStepResult = EPass;
|
|
2138 |
|
|
2139 |
// set some limit on bytes to record
|
|
2140 |
iRecorder->SetMaxWriteLength(10024);
|
|
2141 |
|
|
2142 |
// reset the record limit.
|
|
2143 |
// This is the function WHICH is being tested
|
|
2144 |
iRecorder->SetMaxWriteLength(-1);
|
|
2145 |
|
|
2146 |
iRecorder->Close();
|
|
2147 |
|
|
2148 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
2149 |
// test steps return a result
|
|
2150 |
return iTestStepResult;
|
|
2151 |
}
|
|
2152 |
|
|
2153 |
#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
2154 |
_LIT(KRecorderThread1,"RecorderThread1");
|
|
2155 |
_LIT(KRecorderThread2,"RecorderThread2");
|
|
2156 |
_LIT(KRecorderThread3,"RecorderThread3");
|
|
2157 |
const TInt KDefaultHeapSize=0x100000;
|
|
2158 |
#endif
|
|
2159 |
|
|
2160 |
// factory function
|
|
2161 |
CRecordAudio* CRecordAudio::NewL()
|
|
2162 |
{
|
|
2163 |
CRecordAudio* self = new (ELeave) CRecordAudio();
|
|
2164 |
CleanupStack::PushL(self);
|
|
2165 |
self->ConstructL();
|
|
2166 |
CleanupStack::Pop(self);
|
|
2167 |
return self;
|
|
2168 |
}
|
|
2169 |
|
|
2170 |
// Destructor
|
|
2171 |
CRecordAudio::~CRecordAudio()
|
|
2172 |
{
|
|
2173 |
if (iUtility)
|
|
2174 |
{
|
|
2175 |
// if it exists, always stop the utility - null action if not running
|
|
2176 |
iUtility->Stop();
|
|
2177 |
delete iUtility;
|
|
2178 |
}
|
|
2179 |
}
|
|
2180 |
|
|
2181 |
// 2nd phase constructor
|
|
2182 |
void CRecordAudio::ConstructL()
|
|
2183 |
{
|
|
2184 |
iUtility = CMdaAudioRecorderUtility::NewL(*this);
|
|
2185 |
iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
|
|
2186 |
}
|
|
2187 |
|
|
2188 |
// constructor
|
|
2189 |
CRecordAudio::CRecordAudio()
|
|
2190 |
{
|
|
2191 |
}
|
|
2192 |
|
|
2193 |
void CRecordAudio::RecordL(const TDesC& aFileName, TInt aPriority)
|
|
2194 |
{
|
|
2195 |
// Note: in this scenario, the calling code can handle the leave here
|
|
2196 |
// but alternatively we would have to trap and (using one-shot AO) arrange
|
|
2197 |
// for the callback to be subsequently called.
|
|
2198 |
iUtility->SetPriority(aPriority, EMdaPriorityPreferenceNone);
|
|
2199 |
iUtility->OpenFileL(aFileName);
|
|
2200 |
}
|
|
2201 |
|
|
2202 |
void CRecordAudio::MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
|
|
2203 |
{
|
|
2204 |
__ASSERT_DEBUG(aObject==iUtility, User::Invariant());
|
|
2205 |
aObject = aObject; // shutup warning
|
|
2206 |
|
|
2207 |
iError = aErrorCode;
|
|
2208 |
|
|
2209 |
if (iError==KErrNone)
|
|
2210 |
{
|
|
2211 |
// only interested in some state transitions...
|
|
2212 |
if (aPreviousState==CMdaAudioRecorderUtility::ENotReady &&
|
|
2213 |
aCurrentState==CMdaAudioRecorderUtility::EOpen)
|
|
2214 |
{
|
|
2215 |
// have opened the file
|
|
2216 |
iUtility->RecordL();
|
|
2217 |
}
|
|
2218 |
else if (aPreviousState==CMdaAudioRecorderUtility::EOpen &&
|
|
2219 |
aCurrentState==CMdaAudioRecorderUtility::ERecording)
|
|
2220 |
{
|
|
2221 |
//start a timer
|
|
2222 |
TCallBack callback (TimerCallback, this);
|
|
2223 |
const TInt KWaitTime = 2000000; // 2s
|
|
2224 |
iTimer->Start(KWaitTime, 0, callback);
|
|
2225 |
}
|
|
2226 |
}
|
|
2227 |
else
|
|
2228 |
{
|
|
2229 |
if (aPreviousState==CMdaAudioRecorderUtility::ERecording &&
|
|
2230 |
aCurrentState==CMdaAudioRecorderUtility::EOpen)
|
|
2231 |
{
|
|
2232 |
iTimer->Cancel();
|
|
2233 |
CActiveScheduler::Stop();
|
|
2234 |
}
|
|
2235 |
}
|
|
2236 |
}
|
|
2237 |
|
|
2238 |
// having opened the file, give settings and then start to record
|
|
2239 |
void CRecordAudio::OnOpenL()
|
|
2240 |
{
|
|
2241 |
iUtility->RecordL();
|
|
2242 |
}
|
|
2243 |
|
|
2244 |
// timer callback
|
|
2245 |
TInt CRecordAudio::TimerCallback(TAny* aPtr)
|
|
2246 |
{
|
|
2247 |
static_cast<CRecordAudio*>(aPtr)->DoTimerCallback();
|
|
2248 |
return KErrNone;
|
|
2249 |
}
|
|
2250 |
|
|
2251 |
void CRecordAudio::DoTimerCallback()
|
|
2252 |
{
|
|
2253 |
iTimer->Cancel(); // only really wanted a one-shot
|
|
2254 |
iUtility->Stop();
|
|
2255 |
CActiveScheduler::Stop();
|
|
2256 |
}
|
|
2257 |
|
|
2258 |
RAudioConcurrentRecTest* RAudioConcurrentRecTest::NewL(const TDesC& aStepName, TInt aRecPriority1, TInt aRecPriority2, TInt aRecPriority3)
|
|
2259 |
{
|
|
2260 |
RAudioConcurrentRecTest* self = new (ELeave) RAudioConcurrentRecTest(aStepName, aRecPriority1, aRecPriority2, aRecPriority3);
|
|
2261 |
return self;
|
|
2262 |
}
|
|
2263 |
|
|
2264 |
RAudioConcurrentRecTest::RAudioConcurrentRecTest(const TDesC& aStepName, TInt aRecPriority1, TInt aRecPriority2, TInt aRecPriority3)
|
|
2265 |
:iRecPriority1(aRecPriority1), iRecPriority2(aRecPriority2), iRecPriority3(aRecPriority3)
|
|
2266 |
{
|
|
2267 |
iTestStepName = aStepName;
|
|
2268 |
}
|
|
2269 |
|
|
2270 |
TInt StartThreadL(TAny* aData)
|
|
2271 |
{
|
|
2272 |
TInt* priority = static_cast<TInt*> (aData);
|
|
2273 |
// Create active scheduler (to run active objects)
|
|
2274 |
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
|
|
2275 |
CleanupStack::PushL(scheduler);
|
|
2276 |
CActiveScheduler::Install(scheduler);
|
|
2277 |
|
|
2278 |
CRecordAudio* recorder = CRecordAudio::NewL();
|
|
2279 |
CleanupStack::PushL(recorder);
|
|
2280 |
|
|
2281 |
TBuf<50> fileName;
|
|
2282 |
fileName.Append(_L("c:\\"));
|
|
2283 |
fileName.Append(RThread().Name());
|
|
2284 |
fileName.Append(_L(".wav"));
|
|
2285 |
RFs fs;
|
|
2286 |
User::LeaveIfError(fs.Connect());
|
|
2287 |
CleanupClosePushL(fs);
|
|
2288 |
fs.Delete(fileName); // ensure we start with no file. Ignore errors.
|
|
2289 |
|
|
2290 |
recorder->RecordL(fileName, *priority);
|
|
2291 |
CActiveScheduler::Start();
|
|
2292 |
fs.Delete(fileName); // ensure we start with no file. Ignore errors.
|
|
2293 |
TInt err = recorder->Error();
|
|
2294 |
CleanupStack::PopAndDestroy(3,scheduler);
|
|
2295 |
return err;
|
|
2296 |
}
|
|
2297 |
|
|
2298 |
TInt StartThread(TAny* aData)
|
|
2299 |
{
|
|
2300 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
2301 |
TInt result=KErrNone;
|
|
2302 |
TRAPD(error, result = StartThreadL(aData));
|
|
2303 |
delete cleanup;
|
|
2304 |
if(error)
|
|
2305 |
{
|
|
2306 |
return error;
|
|
2307 |
}
|
|
2308 |
else if(result)
|
|
2309 |
{
|
|
2310 |
return result;
|
|
2311 |
}
|
|
2312 |
else
|
|
2313 |
{
|
|
2314 |
return KErrNone;
|
|
2315 |
}
|
|
2316 |
}
|
|
2317 |
|
|
2318 |
// start test
|
|
2319 |
void RAudioConcurrentRecTest::KickoffTestL()
|
|
2320 |
{
|
|
2321 |
INFO_PRINTF1( _L("DEF121928:This test creates three threads and starts recording concurrently from all the three threads"));
|
|
2322 |
INFO_PRINTF4( _L("RecorderUtility1 has Priority[%d] RecorderUtility2 has Priority[%d] RecorderUtility3 has Priority[%d]"), iRecPriority1, iRecPriority2, iRecPriority3);
|
|
2323 |
|
|
2324 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
2325 |
INFO_PRINTF1( _L("This test is only for A3F: Just making it pass without testing on old devsound"));
|
|
2326 |
StopTest(KErrNone);
|
|
2327 |
#else
|
|
2328 |
User::LeaveIfError(iThread1.Create(KRecorderThread1, StartThread, KDefaultStackSize, KDefaultHeapSize, KDefaultHeapSize, &iRecPriority1));
|
|
2329 |
User::LeaveIfError(iThread2.Create(KRecorderThread2, StartThread, KDefaultStackSize, KDefaultHeapSize, KDefaultHeapSize, &iRecPriority2));
|
|
2330 |
User::LeaveIfError(iThread3.Create(KRecorderThread3, StartThread, KDefaultStackSize, KDefaultHeapSize, KDefaultHeapSize, &iRecPriority3));
|
|
2331 |
|
|
2332 |
TRequestStatus status1;
|
|
2333 |
TRequestStatus status2;
|
|
2334 |
TRequestStatus status3;
|
|
2335 |
iThread1.Logon(status1);
|
|
2336 |
iThread2.Logon(status2);
|
|
2337 |
iThread3.Logon(status3);
|
|
2338 |
iThread1.Resume();
|
|
2339 |
iThread2.Resume();
|
|
2340 |
iThread3.Resume();
|
|
2341 |
User::WaitForRequest(status1);
|
|
2342 |
User::WaitForRequest(status2);
|
|
2343 |
User::WaitForRequest(status3);
|
|
2344 |
|
|
2345 |
INFO_PRINTF2( _L("Thread1 is terminated with error[%d]"), status1.Int());
|
|
2346 |
INFO_PRINTF2( _L("Thread2 is terminated with error[%d]"), status2.Int());
|
|
2347 |
INFO_PRINTF2( _L("Thread3 is terminated with error[%d]"), status3.Int());
|
|
2348 |
|
|
2349 |
TVerdict result = EPass;
|
|
2350 |
//Check first that the thread with the max priority is successful
|
|
2351 |
if(status1.Int() != KErrNone && iRecPriority1 == EMdaPriorityMax)
|
|
2352 |
{
|
|
2353 |
INFO_PRINTF1( _L("Thread1 has failed to record inspite of having EMdaPriorityMax"));
|
|
2354 |
result = EFail;
|
|
2355 |
}
|
|
2356 |
if(status2.Int() != KErrNone && iRecPriority2 == EMdaPriorityMax)
|
|
2357 |
{
|
|
2358 |
INFO_PRINTF1( _L("Thread2 has failed to record inspite of having EMdaPriorityMax"));
|
|
2359 |
result = EFail;
|
|
2360 |
}
|
|
2361 |
if(status3.Int() != KErrNone && iRecPriority3 == EMdaPriorityMax)
|
|
2362 |
{
|
|
2363 |
INFO_PRINTF1( _L("Thread3 has failed to record inspite of having EMdaPriorityMax"));
|
|
2364 |
result = EFail;
|
|
2365 |
}
|
|
2366 |
//Check if the lower priority gets the KErrInUse
|
|
2367 |
if(status1.Int()!= KErrInUse && (iRecPriority1== EMdaPriorityMin || iRecPriority1== EMdaPriorityNormal))
|
|
2368 |
{
|
|
2369 |
INFO_PRINTF1( _L("Thread1 has failed to receive KErrInUse inspite of having EMdaPriorityMin or EMdaPriorityNormal"));
|
|
2370 |
result = EFail;
|
|
2371 |
}
|
|
2372 |
if(status2.Int()!= KErrInUse && (iRecPriority2== EMdaPriorityMin || iRecPriority2== EMdaPriorityNormal))
|
|
2373 |
{
|
|
2374 |
INFO_PRINTF1( _L("Thread2 has failed to receive KErrInUse inspite of having EMdaPriorityMin or EMdaPriorityNormal"));
|
|
2375 |
result = EFail;
|
|
2376 |
}
|
|
2377 |
if(status3.Int()!= KErrInUse && (iRecPriority3== EMdaPriorityMin || iRecPriority3== EMdaPriorityNormal))
|
|
2378 |
{
|
|
2379 |
INFO_PRINTF1( _L("Thread1 has failed to receive KErrInUse inspite of having EMdaPriorityMin or EMdaPriorityNormal"));
|
|
2380 |
result = EFail;
|
|
2381 |
}
|
|
2382 |
StopTest(KErrNone, result);
|
|
2383 |
#endif
|
|
2384 |
}
|
|
2385 |
|
|
2386 |
// cleanup at end
|
|
2387 |
void RAudioConcurrentRecTest::CloseTest()
|
|
2388 |
{
|
|
2389 |
iThread1.Close();
|
|
2390 |
iThread2.Close();
|
|
2391 |
iThread3.Close();
|
|
2392 |
}
|
|
2393 |
|
|
2394 |
// factory function
|
|
2395 |
CRecorder* CRecorder::NewL(MRecordAudioObserver* aObserver)
|
|
2396 |
{
|
|
2397 |
CRecorder* self = new (ELeave) CRecorder(aObserver);
|
|
2398 |
CleanupStack::PushL(self);
|
|
2399 |
self->ConstructL();
|
|
2400 |
CleanupStack::Pop(self);
|
|
2401 |
return self;
|
|
2402 |
}
|
|
2403 |
|
|
2404 |
// Destructor
|
|
2405 |
CRecorder::~CRecorder()
|
|
2406 |
{
|
|
2407 |
if (iUtility)
|
|
2408 |
{
|
|
2409 |
// if it exists, always stop the utility - null action if not running
|
|
2410 |
iUtility->Stop();
|
|
2411 |
delete iUtility;
|
|
2412 |
}
|
|
2413 |
}
|
|
2414 |
|
|
2415 |
// 2nd phase constructor
|
|
2416 |
void CRecorder::ConstructL()
|
|
2417 |
{
|
|
2418 |
iUtility = CMdaAudioRecorderUtility::NewL(*this);
|
|
2419 |
iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
|
|
2420 |
}
|
|
2421 |
|
|
2422 |
// constructor
|
|
2423 |
CRecorder::CRecorder(MRecordAudioObserver* aObserver)
|
|
2424 |
:iObserver(aObserver)
|
|
2425 |
{
|
|
2426 |
}
|
|
2427 |
|
|
2428 |
void CRecorder::RecordL(const TDesC& aFileName, TInt aPriority)
|
|
2429 |
{
|
|
2430 |
iUtility->SetPriority(aPriority, EMdaPriorityPreferenceNone);
|
|
2431 |
const TUid KPanicControllerUid = {0x10286661};
|
|
2432 |
iUtility->OpenFileL(aFileName, KPanicControllerUid);
|
|
2433 |
}
|
|
2434 |
|
|
2435 |
void CRecorder::MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
|
|
2436 |
{
|
|
2437 |
__ASSERT_DEBUG(aObject==iUtility, User::Invariant());
|
|
2438 |
aObject = aObject; // shutup warning
|
|
2439 |
|
|
2440 |
iError = aErrorCode;
|
|
2441 |
|
|
2442 |
if (iError==KErrNone)
|
|
2443 |
{
|
|
2444 |
// only interested in some state transitions...
|
|
2445 |
if (aPreviousState==CMdaAudioRecorderUtility::ENotReady &&
|
|
2446 |
aCurrentState==CMdaAudioRecorderUtility::EOpen)
|
|
2447 |
{
|
|
2448 |
// have opened the file
|
|
2449 |
iUtility->RecordL();
|
|
2450 |
}
|
|
2451 |
else if (aPreviousState==CMdaAudioRecorderUtility::EOpen &&
|
|
2452 |
aCurrentState==CMdaAudioRecorderUtility::ERecording)
|
|
2453 |
{
|
|
2454 |
//start a timer
|
|
2455 |
TCallBack callback (TimerCallback, this);
|
|
2456 |
const TInt KWaitTime = 2000000; // 2s
|
|
2457 |
iTimer->Start(KWaitTime, 0, callback);
|
|
2458 |
}
|
|
2459 |
}
|
|
2460 |
else
|
|
2461 |
{
|
|
2462 |
if (aPreviousState==CMdaAudioRecorderUtility::ERecording &&
|
|
2463 |
aCurrentState==CMdaAudioRecorderUtility::EOpen)
|
|
2464 |
{
|
|
2465 |
iTimer->Cancel();
|
|
2466 |
}
|
|
2467 |
iObserver->RecordError(iError);
|
|
2468 |
}
|
|
2469 |
}
|
|
2470 |
|
|
2471 |
// having opened the file, give settings and then start to record
|
|
2472 |
void CRecorder::OnOpenL()
|
|
2473 |
{
|
|
2474 |
iUtility->RecordL();
|
|
2475 |
}
|
|
2476 |
|
|
2477 |
// timer callback
|
|
2478 |
TInt CRecorder::TimerCallback(TAny* aPtr)
|
|
2479 |
{
|
|
2480 |
static_cast<CRecorder*>(aPtr)->DoTimerCallback();
|
|
2481 |
return KErrNone;
|
|
2482 |
}
|
|
2483 |
|
|
2484 |
void CRecorder::DoTimerCallback()
|
|
2485 |
{
|
|
2486 |
iTimer->Cancel(); // only really wanted a one-shot
|
|
2487 |
iUtility->Stop();
|
|
2488 |
iObserver->RecordError(KErrNone);
|
|
2489 |
}
|
|
2490 |
|
|
2491 |
RAudioRecPanicTest* RAudioRecPanicTest::NewL(const TDesC& aStepName, const TDesC& aFileName)
|
|
2492 |
{
|
|
2493 |
RAudioRecPanicTest* self = new (ELeave) RAudioRecPanicTest(aStepName, aFileName);
|
|
2494 |
return self;
|
|
2495 |
}
|
|
2496 |
|
|
2497 |
RAudioRecPanicTest::RAudioRecPanicTest(const TDesC& aStepName, const TDesC& aFileName) :
|
|
2498 |
iRecorder(NULL),
|
|
2499 |
iFileName (aFileName)
|
|
2500 |
{
|
|
2501 |
iTestStepName = aStepName;
|
|
2502 |
}
|
|
2503 |
|
|
2504 |
// start test
|
|
2505 |
void RAudioRecPanicTest::KickoffTestL()
|
|
2506 |
{
|
|
2507 |
INFO_PRINTF1(_L("DEF127630:Fix for INC108007 appears to close "));
|
|
2508 |
// re-initialise data - orphan any pointer, as would relate to
|
|
2509 |
// previous run's heap
|
|
2510 |
iRecorder = NULL;
|
|
2511 |
|
|
2512 |
User::LeaveIfError(iFs.Connect());
|
|
2513 |
iFs.Delete(iFileName); // ensure we start with no file. Ignore errors.
|
|
2514 |
|
|
2515 |
iRecorder = CRecorder::NewL(this);
|
|
2516 |
iSuite->Log(ESevrInfo, _L("Recording Started...."));
|
|
2517 |
iRecorder->RecordL(iFileName, EMdaPriorityNormal);
|
|
2518 |
}
|
|
2519 |
|
|
2520 |
// cleanup at end
|
|
2521 |
void RAudioRecPanicTest::CloseTest()
|
|
2522 |
{
|
|
2523 |
delete iRecorder;
|
|
2524 |
iRecorder = NULL;
|
|
2525 |
iFs.Close();
|
|
2526 |
}
|
|
2527 |
|
|
2528 |
// recording stopped
|
|
2529 |
void RAudioRecPanicTest::RecordError(TInt aError)
|
|
2530 |
{
|
|
2531 |
iSuite->Log(ESevrInfo, _L("Recording Finished...."));
|
|
2532 |
if(aError!=KErrServerTerminated)
|
|
2533 |
{
|
|
2534 |
StopTest(aError, EFail);
|
|
2535 |
}
|
|
2536 |
else
|
|
2537 |
{
|
|
2538 |
StopTest(aError, EPass);
|
|
2539 |
}
|
|
2540 |
}
|