sl@0
|
1 |
|
sl@0
|
2 |
// GlobalEffectTest.cpp
|
sl@0
|
3 |
|
sl@0
|
4 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
5 |
// All rights reserved.
|
sl@0
|
6 |
// This component and the accompanying materials are made available
|
sl@0
|
7 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
8 |
// which accompanies this distribution, and is available
|
sl@0
|
9 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Initial Contributors:
|
sl@0
|
12 |
// Nokia Corporation - initial contribution.
|
sl@0
|
13 |
//
|
sl@0
|
14 |
// Contributors:
|
sl@0
|
15 |
//
|
sl@0
|
16 |
// Description:
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "GlobalEffectTest.h"
|
sl@0
|
20 |
#include "TestGlobalEffect.hrh"
|
sl@0
|
21 |
#include "TestEffect.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
#include <mmfstdglblaudioeffect.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
//
|
sl@0
|
27 |
// RGlobalEffectPrimitiveTest
|
sl@0
|
28 |
//
|
sl@0
|
29 |
|
sl@0
|
30 |
RGlobalEffectPrimitiveTest* RGlobalEffectPrimitiveTest::NewL(TBool aAllocTest)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
RGlobalEffectPrimitiveTest* self = new (ELeave) RGlobalEffectPrimitiveTest(aAllocTest);
|
sl@0
|
33 |
return self;
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
RGlobalEffectPrimitiveTest::RGlobalEffectPrimitiveTest(TBool /*aAllocTest*/)
|
sl@0
|
37 |
{
|
sl@0
|
38 |
iTestStepName = _L("MM-MMF-GEF-U-001");
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
TVerdict RGlobalEffectPrimitiveTest::DoTestStepL()
|
sl@0
|
42 |
{
|
sl@0
|
43 |
INFO_PRINTF1(_L("Check can actually open test GlobalEffect plugin"));
|
sl@0
|
44 |
TVerdict result = EPass;
|
sl@0
|
45 |
|
sl@0
|
46 |
__MM_HEAP_MARK;
|
sl@0
|
47 |
|
sl@0
|
48 |
CTestGlobalEffect* plugin = NULL;
|
sl@0
|
49 |
|
sl@0
|
50 |
TRAPD(error, plugin = CTestGlobalEffect::NewL(NULL));
|
sl@0
|
51 |
|
sl@0
|
52 |
if (error==KErrNone)
|
sl@0
|
53 |
{
|
sl@0
|
54 |
INFO_PRINTF1(_L("plugin opened as expected"));
|
sl@0
|
55 |
delete plugin;
|
sl@0
|
56 |
}
|
sl@0
|
57 |
else
|
sl@0
|
58 |
{
|
sl@0
|
59 |
INFO_PRINTF2(_L("CreateImplementationL() failed - %d"), error);
|
sl@0
|
60 |
result = EFail;
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
__MM_HEAP_MARKEND;
|
sl@0
|
64 |
|
sl@0
|
65 |
return result;
|
sl@0
|
66 |
}
|
sl@0
|
67 |
|
sl@0
|
68 |
//
|
sl@0
|
69 |
// RGlobalEffectStdTest
|
sl@0
|
70 |
//
|
sl@0
|
71 |
|
sl@0
|
72 |
RGlobalEffectStdTest* RGlobalEffectStdTest::NewL(TBool aAllocTest)
|
sl@0
|
73 |
{
|
sl@0
|
74 |
RGlobalEffectStdTest* self = new (ELeave) RGlobalEffectStdTest(aAllocTest);
|
sl@0
|
75 |
return self;
|
sl@0
|
76 |
}
|
sl@0
|
77 |
|
sl@0
|
78 |
RGlobalEffectStdTest::RGlobalEffectStdTest(TBool /*aAllocTest*/)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
iTestStepName = _L("MM-MMF-GEF-U-002");
|
sl@0
|
81 |
}
|
sl@0
|
82 |
|
sl@0
|
83 |
TVerdict RGlobalEffectStdTest::DoTestStepL()
|
sl@0
|
84 |
{
|
sl@0
|
85 |
INFO_PRINTF1(_L("Check standard plugins cleanup return errors"));
|
sl@0
|
86 |
TVerdict result = EPass;
|
sl@0
|
87 |
|
sl@0
|
88 |
{
|
sl@0
|
89 |
__MM_HEAP_MARK;
|
sl@0
|
90 |
|
sl@0
|
91 |
CMmfGlobalEqEffect* plugin = NULL;
|
sl@0
|
92 |
|
sl@0
|
93 |
TRAPD(error, plugin = CMmfGlobalEqEffect::NewL(NULL));
|
sl@0
|
94 |
|
sl@0
|
95 |
if (error==KErrNone)
|
sl@0
|
96 |
{
|
sl@0
|
97 |
INFO_PRINTF1(_L("GlobalEq plugin opened managed to open!"));
|
sl@0
|
98 |
delete plugin;
|
sl@0
|
99 |
result = EFail;
|
sl@0
|
100 |
}
|
sl@0
|
101 |
else if (error==KErrNotSupported)
|
sl@0
|
102 |
{
|
sl@0
|
103 |
INFO_PRINTF1(_L("GlobalEq plugin not supported - as expected"));
|
sl@0
|
104 |
}
|
sl@0
|
105 |
else
|
sl@0
|
106 |
{
|
sl@0
|
107 |
INFO_PRINTF2(_L("GlobalEq CreateImplementationL() failed - %d"), error);
|
sl@0
|
108 |
result = EFail;
|
sl@0
|
109 |
}
|
sl@0
|
110 |
|
sl@0
|
111 |
__MM_HEAP_MARKEND;
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
{
|
sl@0
|
115 |
__MM_HEAP_MARK;
|
sl@0
|
116 |
|
sl@0
|
117 |
CMmfGlobalMegaEffect* plugin = NULL;
|
sl@0
|
118 |
|
sl@0
|
119 |
TRAPD(error, plugin = CMmfGlobalMegaEffect::NewL(NULL));
|
sl@0
|
120 |
|
sl@0
|
121 |
if (error==KErrNone)
|
sl@0
|
122 |
{
|
sl@0
|
123 |
INFO_PRINTF1(_L("GlobalMega plugin opened managed to open!"));
|
sl@0
|
124 |
delete plugin;
|
sl@0
|
125 |
result = EFail;
|
sl@0
|
126 |
}
|
sl@0
|
127 |
else if (error==KErrNotSupported)
|
sl@0
|
128 |
{
|
sl@0
|
129 |
INFO_PRINTF1(_L("GlobalMega plugin not supported - as expected"));
|
sl@0
|
130 |
}
|
sl@0
|
131 |
else
|
sl@0
|
132 |
{
|
sl@0
|
133 |
INFO_PRINTF2(_L("GlobalMega CreateImplementationL() failed - %d"), error);
|
sl@0
|
134 |
result = EFail;
|
sl@0
|
135 |
}
|
sl@0
|
136 |
|
sl@0
|
137 |
__MM_HEAP_MARKEND;
|
sl@0
|
138 |
}
|
sl@0
|
139 |
|
sl@0
|
140 |
return result;
|
sl@0
|
141 |
}
|
sl@0
|
142 |
|
sl@0
|
143 |
//
|
sl@0
|
144 |
// RGlobalEffectMainTest
|
sl@0
|
145 |
//
|
sl@0
|
146 |
|
sl@0
|
147 |
RGlobalEffectMainTest* RGlobalEffectMainTest::NewL(TBool aAllocTest)
|
sl@0
|
148 |
{
|
sl@0
|
149 |
RGlobalEffectMainTest* self = new (ELeave) RGlobalEffectMainTest(aAllocTest);
|
sl@0
|
150 |
return self;
|
sl@0
|
151 |
}
|
sl@0
|
152 |
|
sl@0
|
153 |
RGlobalEffectMainTest::RGlobalEffectMainTest(TBool /*aAllocTest*/)
|
sl@0
|
154 |
{
|
sl@0
|
155 |
iTestStepName = _L("MM-MMF-GEF-U-003");
|
sl@0
|
156 |
}
|
sl@0
|
157 |
|
sl@0
|
158 |
TVerdict RGlobalEffectMainTest::DoTestStepL()
|
sl@0
|
159 |
{
|
sl@0
|
160 |
INFO_PRINTF1(_L("Check basic API calls on TestPlugin"));
|
sl@0
|
161 |
TVerdict result = EPass;
|
sl@0
|
162 |
|
sl@0
|
163 |
__MM_HEAP_MARK;
|
sl@0
|
164 |
|
sl@0
|
165 |
CTestGlobalEffect* plugin = NULL;
|
sl@0
|
166 |
|
sl@0
|
167 |
TRAPD(error, plugin = CTestGlobalEffect::NewL(NULL));
|
sl@0
|
168 |
|
sl@0
|
169 |
if (error!=KErrNone)
|
sl@0
|
170 |
{
|
sl@0
|
171 |
INFO_PRINTF2(_L("CreateImplementationL() failed - %d"), error);
|
sl@0
|
172 |
return EFail;
|
sl@0
|
173 |
}
|
sl@0
|
174 |
|
sl@0
|
175 |
CleanupStack::PushL(plugin);
|
sl@0
|
176 |
|
sl@0
|
177 |
{
|
sl@0
|
178 |
// check Capability
|
sl@0
|
179 |
TUint value = plugin->Capability(EFalse);
|
sl@0
|
180 |
if (value!=0)
|
sl@0
|
181 |
{
|
sl@0
|
182 |
INFO_PRINTF2(_L("Capability(EFalse): expected 0 got - %d"), value);
|
sl@0
|
183 |
result = EFail;
|
sl@0
|
184 |
}
|
sl@0
|
185 |
value = plugin->Capability(ETrue);
|
sl@0
|
186 |
if (value!=0xffff)
|
sl@0
|
187 |
{
|
sl@0
|
188 |
INFO_PRINTF2(_L("Capability(ETrue): expected -1 got - %d"), value);
|
sl@0
|
189 |
result = EFail;
|
sl@0
|
190 |
}
|
sl@0
|
191 |
}
|
sl@0
|
192 |
|
sl@0
|
193 |
// check settings by des, uid or value
|
sl@0
|
194 |
HBufC8* tempDes = NULL;
|
sl@0
|
195 |
TUid tempUid;
|
sl@0
|
196 |
TInt tempInt;
|
sl@0
|
197 |
TPckg<TInt> tempPackage (tempInt);
|
sl@0
|
198 |
{
|
sl@0
|
199 |
// initially (stage 1) nothing set, so SettingsByUidL() and ExtractValuesL()
|
sl@0
|
200 |
// should leave KErrNotSupported, and SettingsByDesL() should return "1234"
|
sl@0
|
201 |
|
sl@0
|
202 |
TRAP(error, tempDes = plugin->SettingsByDesL());
|
sl@0
|
203 |
if (error==KErrNone)
|
sl@0
|
204 |
{
|
sl@0
|
205 |
CleanupStack::PushL(tempDes);
|
sl@0
|
206 |
if (*tempDes!=_L8("1234"))
|
sl@0
|
207 |
{
|
sl@0
|
208 |
HBufC* tempDes16 = HBufC::NewMaxLC(tempDes->Length());
|
sl@0
|
209 |
tempDes16->Des().Copy(*tempDes);
|
sl@0
|
210 |
INFO_PRINTF2(_L("Stage1: SettingsByDesL() expected \"1234\" got \"%S\""), tempDes16);
|
sl@0
|
211 |
result = EFail;
|
sl@0
|
212 |
CleanupStack::PopAndDestroy(tempDes16);
|
sl@0
|
213 |
}
|
sl@0
|
214 |
CleanupStack::PopAndDestroy(tempDes);
|
sl@0
|
215 |
tempDes = NULL;
|
sl@0
|
216 |
}
|
sl@0
|
217 |
else
|
sl@0
|
218 |
{
|
sl@0
|
219 |
INFO_PRINTF2(_L("Stage1: SettingsByDesL() returned %d"), error);
|
sl@0
|
220 |
result = EFail;
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
TRAP(error, tempUid = plugin->SettingsByUidL());
|
sl@0
|
224 |
if (error!=KErrNotSupported)
|
sl@0
|
225 |
{
|
sl@0
|
226 |
INFO_PRINTF3(_L("Stage1: SettingsByUidL() expected KErrNotSupported got %d(0x%x)"), error, tempUid.iUid);
|
sl@0
|
227 |
result = EFail;
|
sl@0
|
228 |
}
|
sl@0
|
229 |
|
sl@0
|
230 |
TRAP(error, plugin->ExtractValuesL(tempPackage));
|
sl@0
|
231 |
if (error!=KErrNotSupported)
|
sl@0
|
232 |
{
|
sl@0
|
233 |
INFO_PRINTF3(_L("Stage1: ExtractValuesL() expected KErrNotSupported got %d(%d)"), error, tempInt);
|
sl@0
|
234 |
result = EFail;
|
sl@0
|
235 |
}
|
sl@0
|
236 |
|
sl@0
|
237 |
}
|
sl@0
|
238 |
|
sl@0
|
239 |
{
|
sl@0
|
240 |
// at stage 2, we set a value by UID, so now SettingsByUid returns something sensible
|
sl@0
|
241 |
TUid sampleUid = {0x1234567}; // any silly value will do
|
sl@0
|
242 |
plugin->SetSettingsByUidL(sampleUid);
|
sl@0
|
243 |
|
sl@0
|
244 |
TRAP(error, tempDes = plugin->SettingsByDesL());
|
sl@0
|
245 |
if (error==KErrNone)
|
sl@0
|
246 |
{
|
sl@0
|
247 |
CleanupStack::PushL(tempDes);
|
sl@0
|
248 |
if (*tempDes!=_L8("1234"))
|
sl@0
|
249 |
{
|
sl@0
|
250 |
HBufC* tempDes16 = HBufC::NewMaxLC(tempDes->Length());
|
sl@0
|
251 |
tempDes16->Des().Copy(*tempDes);
|
sl@0
|
252 |
INFO_PRINTF2(_L("Stage2: SettingsByDesL() expected \"1234\" got \"%S\""), tempDes16);
|
sl@0
|
253 |
result = EFail;
|
sl@0
|
254 |
CleanupStack::PopAndDestroy(tempDes16);
|
sl@0
|
255 |
}
|
sl@0
|
256 |
CleanupStack::PopAndDestroy(tempDes);
|
sl@0
|
257 |
tempDes = NULL;
|
sl@0
|
258 |
}
|
sl@0
|
259 |
else
|
sl@0
|
260 |
{
|
sl@0
|
261 |
INFO_PRINTF2(_L("Stage2: SettingsByDesL() returned %d"), error);
|
sl@0
|
262 |
result = EFail;
|
sl@0
|
263 |
}
|
sl@0
|
264 |
|
sl@0
|
265 |
TRAP(error, tempUid = plugin->SettingsByUidL());
|
sl@0
|
266 |
if (error!=KErrNone)
|
sl@0
|
267 |
{
|
sl@0
|
268 |
INFO_PRINTF3(_L("Stage2: SettingsByUidL() expected KErrNone got %d(0x%x)"), error, tempUid.iUid);
|
sl@0
|
269 |
result = EFail;
|
sl@0
|
270 |
}
|
sl@0
|
271 |
else if (tempUid != sampleUid)
|
sl@0
|
272 |
{
|
sl@0
|
273 |
INFO_PRINTF3(_L("Stage2: SettingsByUidL() expected return of 0x%x got 0x%x"), sampleUid.iUid, tempUid.iUid);
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
TRAP(error, plugin->ExtractValuesL(tempPackage));
|
sl@0
|
277 |
if (error!=KErrNotSupported)
|
sl@0
|
278 |
{
|
sl@0
|
279 |
INFO_PRINTF3(_L("Stage2: ExtractValuesL() expected KErrNotSupported got %d(%d)"), error, tempInt);
|
sl@0
|
280 |
result = EFail;
|
sl@0
|
281 |
}
|
sl@0
|
282 |
|
sl@0
|
283 |
}
|
sl@0
|
284 |
|
sl@0
|
285 |
{
|
sl@0
|
286 |
// at stage 3, we set a value by des, so again only SettingsByDesL() gives valid results
|
sl@0
|
287 |
_LIT8(KSampleDes, "89a");
|
sl@0
|
288 |
plugin->SetSettingsByDesL(KSampleDes);
|
sl@0
|
289 |
|
sl@0
|
290 |
TRAP(error, tempDes = plugin->SettingsByDesL());
|
sl@0
|
291 |
if (error==KErrNone)
|
sl@0
|
292 |
{
|
sl@0
|
293 |
CleanupStack::PushL(tempDes);
|
sl@0
|
294 |
if (*tempDes!=KSampleDes)
|
sl@0
|
295 |
{
|
sl@0
|
296 |
HBufC* tempDes16 = HBufC::NewMaxLC(tempDes->Length());
|
sl@0
|
297 |
tempDes16->Des().Copy(*tempDes);
|
sl@0
|
298 |
INFO_PRINTF2(_L("Stage3: SettingsByDesL() expected \"89a\" got \"%S\""), tempDes16);
|
sl@0
|
299 |
result = EFail;
|
sl@0
|
300 |
CleanupStack::PopAndDestroy(tempDes16);
|
sl@0
|
301 |
}
|
sl@0
|
302 |
CleanupStack::PopAndDestroy(tempDes);
|
sl@0
|
303 |
tempDes = NULL;
|
sl@0
|
304 |
}
|
sl@0
|
305 |
else
|
sl@0
|
306 |
{
|
sl@0
|
307 |
INFO_PRINTF2(_L("Stage3: SettingsByDesL() returned %d"), error);
|
sl@0
|
308 |
result = EFail;
|
sl@0
|
309 |
}
|
sl@0
|
310 |
|
sl@0
|
311 |
TRAP(error, tempUid = plugin->SettingsByUidL());
|
sl@0
|
312 |
if (error!=KErrNotSupported)
|
sl@0
|
313 |
{
|
sl@0
|
314 |
INFO_PRINTF3(_L("Stage3: SettingsByUidL() expected KErrNotSupported got %d(0x%x)"), error, tempUid.iUid);
|
sl@0
|
315 |
result = EFail;
|
sl@0
|
316 |
}
|
sl@0
|
317 |
|
sl@0
|
318 |
TRAP(error, plugin->ExtractValuesL(tempPackage));
|
sl@0
|
319 |
if (error!=KErrNotSupported)
|
sl@0
|
320 |
{
|
sl@0
|
321 |
INFO_PRINTF3(_L("Stage3: ExtractValuesL() expected KErrNotSupported got %d(%d)"), error, tempInt);
|
sl@0
|
322 |
result = EFail;
|
sl@0
|
323 |
}
|
sl@0
|
324 |
}
|
sl@0
|
325 |
|
sl@0
|
326 |
{
|
sl@0
|
327 |
// at stage 4, we set a value by package buffer, so only that way returns valid value
|
sl@0
|
328 |
const TInt sampleInt = 10;
|
sl@0
|
329 |
TPckgC<TInt> sampleBuffer (sampleInt);
|
sl@0
|
330 |
plugin->SetByValuesL(sampleBuffer);
|
sl@0
|
331 |
|
sl@0
|
332 |
TRAP(error, tempDes = plugin->SettingsByDesL());
|
sl@0
|
333 |
if (error==KErrNone)
|
sl@0
|
334 |
{
|
sl@0
|
335 |
CleanupStack::PushL(tempDes);
|
sl@0
|
336 |
HBufC* tempDes16 = HBufC::NewMaxLC(tempDes->Length());
|
sl@0
|
337 |
tempDes16->Des().Copy(*tempDes);
|
sl@0
|
338 |
INFO_PRINTF2(_L("Stage4: SettingsByDesL() expected KErrNotSupported got \"%S\""), tempDes16);
|
sl@0
|
339 |
result = EFail;
|
sl@0
|
340 |
CleanupStack::PopAndDestroy(2, tempDes);
|
sl@0
|
341 |
tempDes = NULL;
|
sl@0
|
342 |
}
|
sl@0
|
343 |
else if (error!=KErrNotSupported)
|
sl@0
|
344 |
{
|
sl@0
|
345 |
INFO_PRINTF2(_L("Stage4: SettingsByDesL() expected KErrNotSupported returned %d"), error);
|
sl@0
|
346 |
result = EFail;
|
sl@0
|
347 |
}
|
sl@0
|
348 |
|
sl@0
|
349 |
TRAP(error, tempUid = plugin->SettingsByUidL());
|
sl@0
|
350 |
if (error!=KErrNotSupported)
|
sl@0
|
351 |
{
|
sl@0
|
352 |
INFO_PRINTF3(_L("Stage4: SettingsByUidL() expected KErrNotSupported got %d(0x%x)"), error, tempUid.iUid);
|
sl@0
|
353 |
result = EFail;
|
sl@0
|
354 |
}
|
sl@0
|
355 |
|
sl@0
|
356 |
TRAP(error, plugin->ExtractValuesL(tempPackage));
|
sl@0
|
357 |
if (error!=KErrNone)
|
sl@0
|
358 |
{
|
sl@0
|
359 |
INFO_PRINTF3(_L("Stage4: ExtractValuesL() expected KErrNone got %d(%d)"), error, tempInt);
|
sl@0
|
360 |
result = EFail;
|
sl@0
|
361 |
}
|
sl@0
|
362 |
else if (tempInt!=sampleInt)
|
sl@0
|
363 |
{
|
sl@0
|
364 |
INFO_PRINTF3(_L("Stage4: ExtractValuesL() expected %d got %d"), sampleInt, tempInt);
|
sl@0
|
365 |
result = EFail;
|
sl@0
|
366 |
}
|
sl@0
|
367 |
}
|
sl@0
|
368 |
|
sl@0
|
369 |
{
|
sl@0
|
370 |
// Check for Enabled() and IsActive() - should be false to start. poke value and show have
|
sl@0
|
371 |
// changed. Have to use custom command for SetActive() since not really the way to drive
|
sl@0
|
372 |
// - this should relate to the underlying implementation
|
sl@0
|
373 |
TBool enabled = plugin->IsEnabled();
|
sl@0
|
374 |
TBool active = plugin->IsActive();
|
sl@0
|
375 |
if (enabled!=EFalse || active!=EFalse)
|
sl@0
|
376 |
{
|
sl@0
|
377 |
INFO_PRINTF3(_L("Check1: active(%d) and enabled(%d) should have been false"), active, enabled);
|
sl@0
|
378 |
result = EFail;
|
sl@0
|
379 |
}
|
sl@0
|
380 |
plugin->SetEnabledL(ETrue);
|
sl@0
|
381 |
plugin->SetActive(ETrue);
|
sl@0
|
382 |
enabled = plugin->IsEnabled();
|
sl@0
|
383 |
active = plugin->IsActive();
|
sl@0
|
384 |
if (enabled==EFalse || active==EFalse)
|
sl@0
|
385 |
{
|
sl@0
|
386 |
INFO_PRINTF3(_L("Check2: active(%d) and enabled(%d) should have been true"), active, enabled);
|
sl@0
|
387 |
result = EFail;
|
sl@0
|
388 |
}
|
sl@0
|
389 |
}
|
sl@0
|
390 |
|
sl@0
|
391 |
{
|
sl@0
|
392 |
// check preset - for test this ties up with the test plugin
|
sl@0
|
393 |
const TInt KPresetsCount = 3;
|
sl@0
|
394 |
MMmfGlobalAudioPresetList* list = plugin->KnownPresetsL();
|
sl@0
|
395 |
|
sl@0
|
396 |
// reproduce what the plugin will do and check
|
sl@0
|
397 |
if (list->MdcaCount()!=KPresetsCount)
|
sl@0
|
398 |
{
|
sl@0
|
399 |
INFO_PRINTF3(_L("Expected %d presets, got %d"), KPresetsCount, list->MdcaCount());
|
sl@0
|
400 |
result = EFail;
|
sl@0
|
401 |
}
|
sl@0
|
402 |
else
|
sl@0
|
403 |
{
|
sl@0
|
404 |
for (TInt index=0; index<KPresetsCount; index++)
|
sl@0
|
405 |
{
|
sl@0
|
406 |
TBuf<10> name;
|
sl@0
|
407 |
name.Num(index);
|
sl@0
|
408 |
TUid tempUid={index};
|
sl@0
|
409 |
|
sl@0
|
410 |
TUid foundUid = list->GAPUidPoint(index);
|
sl@0
|
411 |
const TPtrC foundName = list->MdcaPoint(index);
|
sl@0
|
412 |
|
sl@0
|
413 |
if (foundUid!=tempUid)
|
sl@0
|
414 |
{
|
sl@0
|
415 |
INFO_PRINTF4(_L("Index %d, expected %x found %x"), index, tempUid.iUid, foundUid.iUid);
|
sl@0
|
416 |
result = EFail;
|
sl@0
|
417 |
}
|
sl@0
|
418 |
if (foundName != name)
|
sl@0
|
419 |
{
|
sl@0
|
420 |
INFO_PRINTF4(_L("Index %d, expected %S found %S"), index, &name, &foundName);
|
sl@0
|
421 |
result = EFail;
|
sl@0
|
422 |
}
|
sl@0
|
423 |
}
|
sl@0
|
424 |
|
sl@0
|
425 |
}
|
sl@0
|
426 |
}
|
sl@0
|
427 |
|
sl@0
|
428 |
CleanupStack::PopAndDestroy(plugin);
|
sl@0
|
429 |
|
sl@0
|
430 |
__MM_HEAP_MARKEND;
|
sl@0
|
431 |
|
sl@0
|
432 |
return result;
|
sl@0
|
433 |
}
|
sl@0
|
434 |
|
sl@0
|
435 |
//
|
sl@0
|
436 |
// RGlobalEffectCallbackTest
|
sl@0
|
437 |
//
|
sl@0
|
438 |
|
sl@0
|
439 |
const TUid KUidTestGlbNotification = {KUidTestGlbNotificationDefine};
|
sl@0
|
440 |
|
sl@0
|
441 |
|
sl@0
|
442 |
RGlobalEffectCallbackTest* RGlobalEffectCallbackTest::NewL(TBool aAllocTest)
|
sl@0
|
443 |
{
|
sl@0
|
444 |
RGlobalEffectCallbackTest* self = new (ELeave) RGlobalEffectCallbackTest(aAllocTest);
|
sl@0
|
445 |
return self;
|
sl@0
|
446 |
}
|
sl@0
|
447 |
|
sl@0
|
448 |
RGlobalEffectCallbackTest::RGlobalEffectCallbackTest(TBool /*aAllocTest*/)
|
sl@0
|
449 |
{
|
sl@0
|
450 |
iTestStepName = _L("MM-MMF-GEF-U-004");
|
sl@0
|
451 |
}
|
sl@0
|
452 |
|
sl@0
|
453 |
void RGlobalEffectCallbackTest::GAEEventNotificationL(CMmfGlobalAudioEffect* aEffect,
|
sl@0
|
454 |
TUid aEventUid,
|
sl@0
|
455 |
const TDesC8& aParam)
|
sl@0
|
456 |
{
|
sl@0
|
457 |
INFO_PRINTF1(_L("Callback"));
|
sl@0
|
458 |
if (aEffect!=iEffect)
|
sl@0
|
459 |
{
|
sl@0
|
460 |
INFO_PRINTF3(_L("Effect is %x, expected %d"), aEffect, iEffect);
|
sl@0
|
461 |
iResult = EFail;
|
sl@0
|
462 |
}
|
sl@0
|
463 |
if (KUidTestGlbNotification != aEventUid)
|
sl@0
|
464 |
{
|
sl@0
|
465 |
INFO_PRINTF3(_L("Uid is %x, expected %x"), aEventUid.iUid, KUidTestGlbNotification.iUid);
|
sl@0
|
466 |
iResult = EFail;
|
sl@0
|
467 |
}
|
sl@0
|
468 |
if (aParam != KNullDesC8)
|
sl@0
|
469 |
{
|
sl@0
|
470 |
INFO_PRINTF2(_L("Param=\"%S\", expected \"\""), &aParam);
|
sl@0
|
471 |
iResult = EFail;
|
sl@0
|
472 |
}
|
sl@0
|
473 |
iCalledBack = ETrue;
|
sl@0
|
474 |
}
|
sl@0
|
475 |
|
sl@0
|
476 |
|
sl@0
|
477 |
TVerdict RGlobalEffectCallbackTest::DoTestStepL()
|
sl@0
|
478 |
{
|
sl@0
|
479 |
INFO_PRINTF1(_L("Check notification callback"));
|
sl@0
|
480 |
iResult = EPass;
|
sl@0
|
481 |
|
sl@0
|
482 |
__MM_HEAP_MARK;
|
sl@0
|
483 |
|
sl@0
|
484 |
iEffect = CTestGlobalEffect::NewL(this);
|
sl@0
|
485 |
CleanupStack::PushL(iEffect);
|
sl@0
|
486 |
|
sl@0
|
487 |
// for test, just generate test synchronously
|
sl@0
|
488 |
iEffect->RequestNotificationL(KUidTestGlbNotification);
|
sl@0
|
489 |
iEffect->GenCallbackL();
|
sl@0
|
490 |
|
sl@0
|
491 |
if (!iCalledBack)
|
sl@0
|
492 |
{
|
sl@0
|
493 |
INFO_PRINTF1(_L("Callback seemingly did not happen"));
|
sl@0
|
494 |
iResult = EFail;
|
sl@0
|
495 |
}
|
sl@0
|
496 |
|
sl@0
|
497 |
CleanupStack::PopAndDestroy(iEffect);
|
sl@0
|
498 |
|
sl@0
|
499 |
__MM_HEAP_MARKEND;
|
sl@0
|
500 |
|
sl@0
|
501 |
return iResult;
|
sl@0
|
502 |
}
|
sl@0
|
503 |
|