0
|
1 |
// Copyright (c) 2007-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 |
// teststepciErrorConcealmentIntfc.cpp
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#include "teststepcierrorconcealment.h"
|
|
19 |
|
|
20 |
|
|
21 |
TVerdict CTestStepCIErrorConcealmentIntfc::DoTestStepL()
|
|
22 |
{
|
|
23 |
iTestStepResult = ETestSuiteError;
|
|
24 |
|
|
25 |
INFO_PRINTF1(_L("Initializing test CI device"));
|
|
26 |
|
|
27 |
if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0062-HP")) == 0)
|
|
28 |
{
|
|
29 |
iTestStepResult = DoTestStep0062L();
|
|
30 |
}
|
|
31 |
else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0063-HP")) == 0)
|
|
32 |
{
|
|
33 |
iTestStepResult = DoTestStep0063L();
|
|
34 |
}
|
|
35 |
else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0064-HP")) == 0)
|
|
36 |
{
|
|
37 |
iTestStepResult = DoTestStep0064L();
|
|
38 |
}
|
|
39 |
else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0065-HP")) == 0)
|
|
40 |
{
|
|
41 |
iTestStepResult = DoTestStep0065L();
|
|
42 |
}
|
|
43 |
|
|
44 |
return iTestStepResult;
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
TVerdict CTestStepCIErrorConcealmentIntfc::DoTestStep0062L()
|
|
49 |
{
|
|
50 |
iTestStepResult = EFail;
|
|
51 |
|
|
52 |
INFO_PRINTF1(_L("ErrorConcealmentIntfc - Instantiating"));
|
|
53 |
|
|
54 |
//Initialize - with the UID of our test HwDevice
|
|
55 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
56 |
TUid testUID = {KUidErrorConcealmentIntfcTestDevice};
|
|
57 |
#else
|
|
58 |
TFourCC testUID('T','0','1','9');
|
|
59 |
#endif
|
|
60 |
|
|
61 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
|
62 |
|
|
63 |
if (iTestStepResult != EPass)
|
|
64 |
{
|
|
65 |
INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
|
|
66 |
return EInconclusive;
|
|
67 |
}
|
|
68 |
|
|
69 |
// reset the value as previous test is pass
|
|
70 |
iTestStepResult = EFail;
|
|
71 |
|
|
72 |
// KUidCustomInterfaceDevSoundErrorConcealmentIntfc
|
|
73 |
MMMFErrorConcealmentIntfc* ptr = static_cast <MMMFErrorConcealmentIntfc*> (iMMFDevSound->CustomInterface(KUidErrorConcealmentIntfc));
|
|
74 |
|
|
75 |
if (ptr)
|
|
76 |
{
|
|
77 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc successfully retrieved the interface"));
|
|
78 |
|
|
79 |
iTestStepResult = EPass;
|
|
80 |
}
|
|
81 |
else
|
|
82 |
{
|
|
83 |
ERR_PRINTF1(_L("MMMFErrorConcealmentIntfc failed to retrieve the interface"));
|
|
84 |
}
|
|
85 |
|
|
86 |
return iTestStepResult;
|
|
87 |
}
|
|
88 |
|
|
89 |
|
|
90 |
TVerdict CTestStepCIErrorConcealmentIntfc::DoTestStep0063L()
|
|
91 |
{
|
|
92 |
iTestStepResult = EFail;
|
|
93 |
TInt result = KErrGeneral;
|
|
94 |
|
|
95 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc - ConcealErrorForNextBuffer"));
|
|
96 |
|
|
97 |
//Initialize - with the UID of our test HwDevice
|
|
98 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
99 |
TUid testUID = {KUidErrorConcealmentIntfcTestDevice};
|
|
100 |
#else
|
|
101 |
TFourCC testUID('T','0','1','9');
|
|
102 |
#endif
|
|
103 |
|
|
104 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
|
105 |
|
|
106 |
if (iTestStepResult != EPass)
|
|
107 |
{
|
|
108 |
INFO_PRINTF1(_L("DevSound failed to initialize with the test device"));
|
|
109 |
return EInconclusive;
|
|
110 |
}
|
|
111 |
|
|
112 |
// reset the value as previous test is pass
|
|
113 |
iTestStepResult = EFail;
|
|
114 |
|
|
115 |
// KUidErrorConcealmentIntfc
|
|
116 |
MMMFErrorConcealmentIntfc* ptr = static_cast <MMMFErrorConcealmentIntfc*> (iMMFDevSound->CustomInterface(KUidErrorConcealmentIntfc));
|
|
117 |
|
|
118 |
if (ptr)
|
|
119 |
{
|
|
120 |
result = ptr->ConcealErrorForNextBuffer(); // call method
|
|
121 |
|
|
122 |
if (result == KErrNone)
|
|
123 |
{
|
|
124 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc::ConcealErrorForNextBuffer finished successfully"));
|
|
125 |
|
|
126 |
iTestStepResult = EPass;
|
|
127 |
}
|
|
128 |
else
|
|
129 |
{
|
|
130 |
ERR_PRINTF2(_L("MMMFErrorConcealmentIntfc::ConcealErrorForNextBuffer failed with result %d"), result);
|
|
131 |
}
|
|
132 |
}
|
|
133 |
else
|
|
134 |
{
|
|
135 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc failed to retrieve the interface"));
|
|
136 |
iTestStepResult = EInconclusive;
|
|
137 |
}
|
|
138 |
|
|
139 |
return iTestStepResult;
|
|
140 |
}
|
|
141 |
|
|
142 |
|
|
143 |
TVerdict CTestStepCIErrorConcealmentIntfc::DoTestStep0064L()
|
|
144 |
{
|
|
145 |
iTestStepResult = EFail;
|
|
146 |
TInt result = KErrGeneral;
|
|
147 |
|
|
148 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc - SetFrameMode"));
|
|
149 |
|
|
150 |
//Initialize - with the UID of our test HwDevice
|
|
151 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
152 |
TUid testUID = {KUidErrorConcealmentIntfcTestDevice};
|
|
153 |
#else
|
|
154 |
TFourCC testUID('T','0','1','9');
|
|
155 |
#endif
|
|
156 |
|
|
157 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
|
158 |
|
|
159 |
if (iTestStepResult != EPass)
|
|
160 |
{
|
|
161 |
INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
|
|
162 |
return EInconclusive;
|
|
163 |
}
|
|
164 |
|
|
165 |
// reset the value as previous test is pass
|
|
166 |
iTestStepResult = EFail;
|
|
167 |
|
|
168 |
// KUidErrorConcealmentIntfc
|
|
169 |
MMMFErrorConcealmentIntfc* ptr = static_cast <MMMFErrorConcealmentIntfc*> (iMMFDevSound->CustomInterface(KUidErrorConcealmentIntfc));
|
|
170 |
|
|
171 |
TBool frameModeOn = EFalse;
|
|
172 |
TBool retframeModeOn = ETrue;
|
|
173 |
|
|
174 |
if (ptr)
|
|
175 |
{
|
|
176 |
result = ptr->SetFrameMode(frameModeOn); // call method
|
|
177 |
|
|
178 |
if (result == KErrNone)
|
|
179 |
{
|
|
180 |
// This file is created by the test stub, the plugin device
|
|
181 |
_LIT(KFileName, "c:\\temp\\errorConcealment.txt");
|
|
182 |
|
|
183 |
ReadFileL(KFileName, retframeModeOn);
|
|
184 |
|
|
185 |
if (retframeModeOn == frameModeOn)
|
|
186 |
{
|
|
187 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc::SetFrameMode finished successfully"));
|
|
188 |
|
|
189 |
iTestStepResult = EPass;
|
|
190 |
}
|
|
191 |
else
|
|
192 |
{
|
|
193 |
ERR_PRINTF2(_L("MMMFErrorConcealmentIntfc::SetFrameMode failed with frameModeRqrd %d"), retframeModeOn);
|
|
194 |
}
|
|
195 |
}
|
|
196 |
else
|
|
197 |
{
|
|
198 |
ERR_PRINTF2(_L("MMMFErrorConcealmentIntfc::SetFrameMode failed with result %d"), result);
|
|
199 |
}
|
|
200 |
}
|
|
201 |
else
|
|
202 |
{
|
|
203 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc failed to retrieve the interface"));
|
|
204 |
iTestStepResult = EInconclusive;
|
|
205 |
}
|
|
206 |
|
|
207 |
return iTestStepResult;
|
|
208 |
}
|
|
209 |
|
|
210 |
|
|
211 |
TVerdict CTestStepCIErrorConcealmentIntfc::DoTestStep0065L()
|
|
212 |
{
|
|
213 |
iTestStepResult = EFail;
|
|
214 |
TInt result = KErrGeneral;
|
|
215 |
|
|
216 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc - FrameModeRqrdForEC"));
|
|
217 |
|
|
218 |
//Initialize - with the UID of our test HwDevice
|
|
219 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
220 |
TUid testUID = {KUidErrorConcealmentIntfcTestDevice};
|
|
221 |
#else
|
|
222 |
TFourCC testUID('T','0','1','9');
|
|
223 |
#endif
|
|
224 |
|
|
225 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
|
226 |
|
|
227 |
if (iTestStepResult != EPass)
|
|
228 |
{
|
|
229 |
INFO_PRINTF1(_L("DevSound failed to instantiated the test device"));
|
|
230 |
return EInconclusive;
|
|
231 |
}
|
|
232 |
|
|
233 |
// reset the value as previous test is pass
|
|
234 |
iTestStepResult = EFail;
|
|
235 |
|
|
236 |
// KUidErrorConcealmentIntfc
|
|
237 |
MMMFErrorConcealmentIntfc* ptr = static_cast <MMMFErrorConcealmentIntfc*> (iMMFDevSound->CustomInterface(KUidErrorConcealmentIntfc));
|
|
238 |
|
|
239 |
if (ptr)
|
|
240 |
{
|
|
241 |
TBool frameModeRqrd = EFalse;
|
|
242 |
TInt setFrameModeRqrd = ETrue;
|
|
243 |
|
|
244 |
// This file is created by the test stub, the plugin device
|
|
245 |
_LIT(KFileName, "c:\\temp\\errorConcealment.txt");
|
|
246 |
|
|
247 |
// store a value in a file, for the test to read from.
|
|
248 |
WriteFileL(KFileName, setFrameModeRqrd);
|
|
249 |
|
|
250 |
result = ptr->FrameModeRqrdForEC(frameModeRqrd); // call method
|
|
251 |
|
|
252 |
if ( (result == KErrNone) && (setFrameModeRqrd == frameModeRqrd) )
|
|
253 |
{
|
|
254 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc::FrameModeRqrdForEC finished successfully"));
|
|
255 |
|
|
256 |
iTestStepResult = EPass;
|
|
257 |
}
|
|
258 |
else
|
|
259 |
{
|
|
260 |
ERR_PRINTF3(_L("MMMFErrorConcealmentIntfc::FrameModeRqrdForEC failed with result %d frameModeRqrd %d"), result, frameModeRqrd);
|
|
261 |
}
|
|
262 |
}
|
|
263 |
else
|
|
264 |
{
|
|
265 |
INFO_PRINTF1(_L("MMMFErrorConcealmentIntfc failed to retrieve the interface"));
|
|
266 |
iTestStepResult = EInconclusive;
|
|
267 |
}
|
|
268 |
|
|
269 |
return iTestStepResult;
|
|
270 |
}
|