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 |
// TestStepToneAllocFailNew.cpp
|
|
15 |
// This file contains an example Test step implementation
|
|
16 |
// This demonstrates the various functions provided
|
|
17 |
// by the CTestStep base class which are available within
|
|
18 |
// a test step
|
|
19 |
//
|
|
20 |
//
|
|
21 |
|
|
22 |
// EPOC includes
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <e32test.h>
|
|
25 |
#include <e32keys.h>
|
|
26 |
#include <c32comm.h>
|
|
27 |
#include <f32file.h>
|
|
28 |
#include <etel.h>
|
|
29 |
#include <etelmm.h>
|
|
30 |
#include <testframework.h>
|
|
31 |
|
|
32 |
#include <mdaaudiotoneplayer.h>
|
|
33 |
|
|
34 |
// Test system includes
|
|
35 |
#include <testframework.h>
|
|
36 |
|
|
37 |
// Specific includes for this test suite
|
|
38 |
#include "TestStepUnitMMFAudClient.h"
|
|
39 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
40 |
|
|
41 |
// Specific includes for these test steps
|
|
42 |
#include "TestStepTone.h"
|
|
43 |
|
|
44 |
|
|
45 |
//#include <mmfaudiocontroller.h>
|
|
46 |
#include "mmfclienttoneplayer.h"
|
|
47 |
//#include "MmfClientAudioPlayer.h"
|
|
48 |
//#include <mmffourcc.h>
|
|
49 |
//#include <mmfpaniccodes.h>
|
|
50 |
//#include <mmfFormatImplementationUIDs.hrh>
|
|
51 |
// --------------------------------------------
|
|
52 |
|
|
53 |
/**
|
|
54 |
*
|
|
55 |
* Static constructor for CTestStepToneNew.
|
|
56 |
*
|
|
57 |
*
|
|
58 |
* @return "CTestStepToneNew*"
|
|
59 |
* The constructed CTestStepToneNew
|
|
60 |
*
|
|
61 |
* @xxxx
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
CTestStepToneNew* CTestStepToneNew::NewL()
|
|
65 |
{
|
|
66 |
CTestStepToneNew* self = new(ELeave) CTestStepToneNew;
|
|
67 |
return self;
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
*
|
|
72 |
* Test step constructor.
|
|
73 |
* Each test step initialises its own name.
|
|
74 |
*
|
|
75 |
* @xxxx
|
|
76 |
*
|
|
77 |
*/
|
|
78 |
CTestStepToneNew::CTestStepToneNew() : iError(KErrNone)
|
|
79 |
{
|
|
80 |
// store the name of this test case
|
|
81 |
// this is the name that is used by the script file
|
|
82 |
iTestStepName = _L("MM-MMF-ACLNT-U-0450-CP");
|
|
83 |
}
|
|
84 |
|
|
85 |
/**
|
|
86 |
*
|
|
87 |
* Test step destructor.
|
|
88 |
*
|
|
89 |
* @xxxx
|
|
90 |
*
|
|
91 |
*/
|
|
92 |
CTestStepToneNew::~CTestStepToneNew()
|
|
93 |
{
|
|
94 |
}
|
|
95 |
|
|
96 |
void CTestStepToneNew::MatoPrepareComplete(TInt aError)
|
|
97 |
{
|
|
98 |
iError = aError;
|
|
99 |
CActiveScheduler::Stop();
|
|
100 |
}
|
|
101 |
|
|
102 |
void CTestStepToneNew::MatoPlayComplete(TInt aError)
|
|
103 |
{
|
|
104 |
iError = aError;
|
|
105 |
CActiveScheduler::Stop();
|
|
106 |
}
|
|
107 |
|
|
108 |
/**
|
|
109 |
*
|
|
110 |
* Do the test step.
|
|
111 |
* Each test step must supply an implementation for DoTestStepL.
|
|
112 |
*
|
|
113 |
* @return "TVerdict"
|
|
114 |
* The result of the test step
|
|
115 |
*
|
|
116 |
* @xxxx
|
|
117 |
*
|
|
118 |
*/
|
|
119 |
TVerdict CTestStepToneNew::DoTestStepL()
|
|
120 |
{
|
|
121 |
iTestStepResult = EPass;
|
|
122 |
TInt err = KErrNone;
|
|
123 |
|
|
124 |
// Printing to the console and log file
|
|
125 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0450-CP"));
|
|
126 |
INFO_PRINTF1(_L("this is a test of CMMFMdaAudioToneUtility::NewL() "));
|
|
127 |
|
|
128 |
__MM_HEAP_MARK;
|
|
129 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this)) );
|
|
130 |
// check for error
|
|
131 |
if (err != KErrNone ||
|
|
132 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
133 |
return EFail;
|
|
134 |
delete iTone;
|
|
135 |
iTone = NULL;
|
|
136 |
__MM_HEAP_MARKEND;
|
|
137 |
|
|
138 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
139 |
// test steps return a result
|
|
140 |
return iTestStepResult;
|
|
141 |
}
|
|
142 |
|