77
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: This file contains testclass implementation.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// [INCLUDE FILES] - do not remove
|
|
19 |
#include <e32svr.h>
|
|
20 |
#include <StifParser.h>
|
|
21 |
#include <StifTestInterface.h>
|
|
22 |
#include "TSanimmmfplugin.h"
|
|
23 |
|
|
24 |
|
|
25 |
// Praveen
|
|
26 |
#include "sanimtoneplugin.h"
|
|
27 |
#include "testwaiter.h"
|
|
28 |
|
|
29 |
#include <ecom/ecom.h>
|
|
30 |
|
|
31 |
const TInt KSAnimMmfPluginImplUid = 0x2000B120;
|
|
32 |
|
|
33 |
_LIT( KUnknownFile, "C:\\temp\\unknown.wav" );
|
|
34 |
_LIT( KCorruptFile, "C:\\temp\\corrupt.wav" );
|
|
35 |
_LIT( K8bitMonoFile, "C:\\temp\\sine-8bit-mono.wav" );
|
|
36 |
_LIT( K16bitMonoFile, "C:\\temp\\sine-16bit-mono.wav" );
|
|
37 |
_LIT( KGsm6_10File, "C:\\temp\\sine-gsm-6-10.wav" );
|
|
38 |
// EXTERNAL DATA STRUCTURES
|
|
39 |
//extern ?external_data;
|
|
40 |
|
|
41 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
42 |
//extern ?external_function( ?arg_type,?arg_type );
|
|
43 |
|
|
44 |
// CONSTANTS
|
|
45 |
//const ?type ?constant_var = ?constant;
|
|
46 |
|
|
47 |
// MACROS
|
|
48 |
//#define ?macro ?macro_def
|
|
49 |
|
|
50 |
// LOCAL CONSTANTS AND MACROS
|
|
51 |
//const ?type ?constant_var = ?constant;
|
|
52 |
//#define ?macro_name ?macro_def
|
|
53 |
|
|
54 |
// MODULE DATA STRUCTURES
|
|
55 |
//enum ?declaration
|
|
56 |
//typedef ?declaration
|
|
57 |
|
|
58 |
// LOCAL FUNCTION PROTOTYPES
|
|
59 |
//?type ?function_name( ?arg_type, ?arg_type );
|
|
60 |
|
|
61 |
// FORWARD DECLARATIONS
|
|
62 |
//class ?FORWARD_CLASSNAME;
|
|
63 |
|
|
64 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
65 |
|
|
66 |
// -----------------------------------------------------------------------------
|
|
67 |
// ?function_name ?description.
|
|
68 |
// ?description
|
|
69 |
// Returns: ?value_1: ?description
|
|
70 |
// ?value_n: ?description_line1
|
|
71 |
// ?description_line2
|
|
72 |
// -----------------------------------------------------------------------------
|
|
73 |
//
|
|
74 |
/*
|
|
75 |
?type ?function_name(
|
|
76 |
?arg_type arg, // ?description
|
|
77 |
?arg_type arg) // ?description
|
|
78 |
{
|
|
79 |
|
|
80 |
?code // ?comment
|
|
81 |
|
|
82 |
// ?comment
|
|
83 |
?code
|
|
84 |
}
|
|
85 |
*/
|
|
86 |
|
|
87 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
88 |
|
|
89 |
// -----------------------------------------------------------------------------
|
|
90 |
// CTSanimmmfplugin::Delete
|
|
91 |
// Delete here all resources allocated and opened from test methods.
|
|
92 |
// Called from destructor.
|
|
93 |
// -----------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
void CTSanimmmfplugin::Delete()
|
|
96 |
{
|
|
97 |
|
|
98 |
}
|
|
99 |
|
|
100 |
// -----------------------------------------------------------------------------
|
|
101 |
// CTSanimmmfplugin::RunMethodL
|
|
102 |
// Run specified method. Contains also table of test mothods and their names.
|
|
103 |
// -----------------------------------------------------------------------------
|
|
104 |
//
|
|
105 |
TInt CTSanimmmfplugin::RunMethodL(
|
|
106 |
CStifItemParser& aItem )
|
|
107 |
{
|
|
108 |
|
|
109 |
static TStifFunctionInfo const KFunctions[] =
|
|
110 |
{
|
|
111 |
// Copy this line for every implemented function.
|
|
112 |
// First string is the function name used in TestScripter script file.
|
|
113 |
// Second is the actual implementation member function.
|
|
114 |
ENTRY( "Example", CTSanimmmfplugin::ExampleL ),
|
|
115 |
ENTRY( "SetupEmpty", CTSanimmmfplugin::SetupEmptyL),
|
|
116 |
ENTRY( "SetupObj", CTSanimmmfplugin::SetupObjL),
|
|
117 |
//ENTRY( "SetupFile", CTSanimmmfplugin::SetupFileL),
|
|
118 |
ENTRY( "Setup8bitMonoTone", CTSanimmmfplugin::Setup8bitMonoToneL),
|
|
119 |
ENTRY( "Setup16bitMonoTone", CTSanimmmfplugin::Setup16bitMonoToneL),
|
|
120 |
ENTRY( "SetupGsm6_10Tone", CTSanimmmfplugin::SetupGsm6_10ToneL),
|
|
121 |
ENTRY( "SetupFinished", CTSanimmmfplugin::SetupFinishedL),
|
|
122 |
ENTRY( "Teardown", CTSanimmmfplugin::Teardown),
|
|
123 |
ENTRY( "TestConstructor", CTSanimmmfplugin::TestConstructorL),
|
|
124 |
ENTRY( "TestConstructorNoMemory", CTSanimmmfplugin::TestConstructorNoMemoryL),
|
|
125 |
ENTRY( "TestUnknownFile", CTSanimmmfplugin::TestUnknownFileL),
|
|
126 |
ENTRY( "TestCorruptFile", CTSanimmmfplugin::TestCorruptFileL),
|
|
127 |
ENTRY( "TestLoad8bitMonoTone", CTSanimmmfplugin::TestLoad8bitMonoToneL),
|
|
128 |
ENTRY( "TestLoad16bitMonoTone", CTSanimmmfplugin::TestLoad16bitMonoToneL),
|
|
129 |
ENTRY( "TestLoadGsm6_10Tone", CTSanimmmfplugin::TestLoadGsm6_10ToneL),
|
|
130 |
ENTRY( "TestLoadNoMemory", CTSanimmmfplugin::TestLoadNoMemoryL),
|
|
131 |
ENTRY( "TestCancelLoad", CTSanimmmfplugin::TestCancelLoadL),
|
|
132 |
ENTRY( "TestStart", CTSanimmmfplugin::TestStartL),
|
|
133 |
ENTRY( "TestCancelStart", CTSanimmmfplugin::TestCancelStartL),
|
|
134 |
ENTRY( "TestCancelNotActive", CTSanimmmfplugin::TestCancelNotActiveL),
|
|
135 |
ENTRY( "TestStartBeforeLoad", CTSanimmmfplugin::TestStartBeforeLoadL),
|
|
136 |
ENTRY( "TestSetVolume", CTSanimmmfplugin::TestSetVolumeL),
|
|
137 |
ENTRY( "TestSetVolumeRamp", CTSanimmmfplugin::TestSetVolumeRampL)
|
|
138 |
//ADD NEW ENTRY HERE
|
|
139 |
// [test cases entries] - Do not remove
|
|
140 |
|
|
141 |
};
|
|
142 |
|
|
143 |
const TInt count = sizeof( KFunctions ) /
|
|
144 |
sizeof( TStifFunctionInfo );
|
|
145 |
|
|
146 |
return RunInternalL( KFunctions, count, aItem );
|
|
147 |
|
|
148 |
}
|
|
149 |
|
|
150 |
|
|
151 |
/*
|
|
152 |
void CTSanimmmfplugin::ConstructL()
|
|
153 |
{
|
|
154 |
REComSession::FinalClose();
|
|
155 |
// The ConstructL from the base class CEUnitTestSuiteClass must be called.
|
|
156 |
// It generates the test case table.
|
|
157 |
//CEUnitTestSuiteClass::ConstructL();
|
|
158 |
|
|
159 |
}
|
|
160 |
*/
|
|
161 |
|
|
162 |
// ---------------------------------------------------------------------------
|
|
163 |
// CTSanimmmfplugin::SetupEmptyL
|
|
164 |
//
|
|
165 |
// ---------------------------------------------------------------------------
|
|
166 |
//
|
|
167 |
TInt CTSanimmmfplugin::SetupEmptyL()
|
|
168 |
{
|
|
169 |
iTestObj = NULL;
|
|
170 |
iDtorKey = TUid::Uid( 0 );
|
|
171 |
User::LeaveIfError( iFs.Connect() );
|
|
172 |
User::LeaveIfError( iFs.ShareProtected() );
|
|
173 |
iWaiter = CTestWaiter::NewL();
|
|
174 |
return KErrNone;
|
|
175 |
}
|
|
176 |
|
|
177 |
|
|
178 |
// ---------------------------------------------------------------------------
|
|
179 |
// CTSanimmmfPlugin::SetupObjL
|
|
180 |
//
|
|
181 |
// ---------------------------------------------------------------------------
|
|
182 |
//
|
|
183 |
TInt CTSanimmmfplugin::SetupObjL()
|
|
184 |
{
|
|
185 |
|
|
186 |
SetupEmptyL();
|
|
187 |
iTestObj = static_cast<CSAnimTonePlugin*>(
|
|
188 |
REComSession::CreateImplementationL(
|
|
189 |
TUid::Uid( KSAnimMmfPluginImplUid ), iDtorKey ) );
|
|
190 |
return KErrNone;
|
|
191 |
}
|
|
192 |
// ---------------------------------------------------------------------------
|
|
193 |
// CSAnimMmfpluginTestSuite::SetupFileL
|
|
194 |
//
|
|
195 |
// ---------------------------------------------------------------------------
|
|
196 |
//
|
|
197 |
TInt CTSanimmmfplugin::SetupFileL( const TDesC& aFileName )
|
|
198 |
{
|
|
199 |
//CStifItemParser aItem;
|
|
200 |
SetupObjL();
|
|
201 |
iTestObj->Load( iFs, aFileName, iWaiter->iStatus );
|
|
202 |
iWaiter->Activate();
|
|
203 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
204 |
return KErrNone;
|
|
205 |
}
|
|
206 |
|
|
207 |
|
|
208 |
// ---------------------------------------------------------------------------
|
|
209 |
// CTSanimmmfplugin::Setup8bitMonoToneL
|
|
210 |
//
|
|
211 |
// ---------------------------------------------------------------------------
|
|
212 |
//
|
|
213 |
TInt CTSanimmmfplugin::Setup8bitMonoToneL()
|
|
214 |
{
|
|
215 |
/*
|
|
216 |
[Test]
|
|
217 |
title Setup8bitMonotone
|
|
218 |
create TSanimmmf MMFPlugin
|
|
219 |
MMFPlugin Setup8bitMonotone
|
|
220 |
delete MMFPlugin
|
|
221 |
[Endtest]
|
|
222 |
*/
|
|
223 |
// 8 bit Mono is not supported ??
|
|
224 |
SetupFileL( K8bitMonoFile );
|
|
225 |
return KErrNone;
|
|
226 |
}
|
|
227 |
|
|
228 |
|
|
229 |
// ---------------------------------------------------------------------------
|
|
230 |
// CTSanimmmfPlugin::Setup16bitMonoToneL
|
|
231 |
//
|
|
232 |
// ---------------------------------------------------------------------------
|
|
233 |
//
|
|
234 |
TInt CTSanimmmfplugin::Setup16bitMonoToneL()
|
|
235 |
{
|
|
236 |
SetupFileL( K16bitMonoFile );
|
|
237 |
return KErrNone;
|
|
238 |
}
|
|
239 |
|
|
240 |
|
|
241 |
// ---------------------------------------------------------------------------
|
|
242 |
// CTSanimmmfplugin::SetupGsm6_10ToneL
|
|
243 |
//
|
|
244 |
// ---------------------------------------------------------------------------
|
|
245 |
//
|
|
246 |
TInt CTSanimmmfplugin::SetupGsm6_10ToneL()
|
|
247 |
{
|
|
248 |
SetupFileL( KGsm6_10File );
|
|
249 |
return KErrNone;
|
|
250 |
}
|
|
251 |
|
|
252 |
|
|
253 |
// ---------------------------------------------------------------------------
|
|
254 |
// CTSanimmmfplugin::SetupFinishedL
|
|
255 |
//
|
|
256 |
// ---------------------------------------------------------------------------
|
|
257 |
//
|
|
258 |
TInt CTSanimmmfplugin::SetupFinishedL()
|
|
259 |
{
|
|
260 |
Setup16bitMonoToneL();
|
|
261 |
iTestObj->Start( iWaiter->iStatus );
|
|
262 |
iWaiter->Activate();
|
|
263 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
264 |
return KErrNone;
|
|
265 |
}
|
|
266 |
|
|
267 |
|
|
268 |
// ---------------------------------------------------------------------------
|
|
269 |
// CTSanimmmfplugin::Teardown
|
|
270 |
//
|
|
271 |
// ---------------------------------------------------------------------------
|
|
272 |
//
|
|
273 |
TInt CTSanimmmfplugin::Teardown()
|
|
274 |
{
|
|
275 |
delete iTestObj;
|
|
276 |
iTestObj = NULL;
|
|
277 |
|
|
278 |
REComSession::DestroyedImplementation( iDtorKey );
|
|
279 |
|
|
280 |
delete iWaiter;
|
|
281 |
iWaiter = NULL;
|
|
282 |
|
|
283 |
iFs.Close();
|
|
284 |
|
|
285 |
REComSession::FinalClose();
|
|
286 |
return KErrNone;
|
|
287 |
}
|
|
288 |
|
|
289 |
|
|
290 |
// ---------------------------------------------------------------------------
|
|
291 |
// CTSanimmmfPlugin::TestConstructorL
|
|
292 |
//
|
|
293 |
// ---------------------------------------------------------------------------
|
|
294 |
//
|
|
295 |
TInt CTSanimmmfplugin::TestConstructorL()
|
|
296 |
{
|
|
297 |
TAny* ptr = NULL;
|
|
298 |
// EUNIT_ASSERT_NO_LEAVE( ptr = REComSession::CreateImplementationL(
|
|
299 |
// TUid::Uid( KSAnimMmfPluginImplUid ), iDtorKey ) );
|
|
300 |
ptr = REComSession::CreateImplementationL(TUid::Uid( KSAnimMmfPluginImplUid ), iDtorKey );
|
|
301 |
|
|
302 |
iTestObj = static_cast<CSAnimTonePlugin*>( ptr );
|
|
303 |
// EUNIT_ASSERT( iTestObj );
|
|
304 |
delete iTestObj;
|
|
305 |
iTestObj = NULL;
|
|
306 |
return KErrNone;
|
|
307 |
}
|
|
308 |
|
|
309 |
// ---------------------------------------------------------------------------
|
|
310 |
// CTSanimmmfplugin::TestConstructorNoMemoryL
|
|
311 |
//
|
|
312 |
// ---------------------------------------------------------------------------
|
|
313 |
//
|
|
314 |
TInt CTSanimmmfplugin::TestConstructorNoMemoryL()
|
|
315 |
{
|
|
316 |
TAny* ptr = NULL;
|
|
317 |
//EUNIT_ASSERT_SPECIFIC_LEAVE( ptr = REComSession::CreateImplementationL(
|
|
318 |
// TUid::Uid( KSAnimMmfPluginImplUid ), iDtorKey ), KErrNoMemory );
|
|
319 |
ptr = REComSession::CreateImplementationL(TUid::Uid( KSAnimMmfPluginImplUid ), iDtorKey );
|
|
320 |
// EUNIT_ASSERT( !ptr );
|
|
321 |
return KErrNone;
|
|
322 |
}
|
|
323 |
|
|
324 |
|
|
325 |
// ---------------------------------------------------------------------------
|
|
326 |
// CTSanimmmfplugin::TestUnknownFileL
|
|
327 |
//
|
|
328 |
// ---------------------------------------------------------------------------
|
|
329 |
//
|
|
330 |
TInt CTSanimmmfplugin::TestUnknownFileL()
|
|
331 |
{
|
|
332 |
iTestObj->Load( iFs, KUnknownFile, iWaiter->iStatus );
|
|
333 |
iWaiter->Activate();
|
|
334 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
335 |
if ( iWaiter->iStatus.Int() == KErrNotFound )
|
|
336 |
return KErrNone;
|
|
337 |
return KErrNone;
|
|
338 |
|
|
339 |
}
|
|
340 |
|
|
341 |
// ---------------------------------------------------------------------------
|
|
342 |
// CTSanimmmfplugin::TestCorruptFileL
|
|
343 |
//
|
|
344 |
// ---------------------------------------------------------------------------
|
|
345 |
//
|
|
346 |
TInt CTSanimmmfplugin::TestCorruptFileL()
|
|
347 |
{
|
|
348 |
iTestObj->Load( iFs, KCorruptFile, iWaiter->iStatus );
|
|
349 |
iWaiter->Activate();
|
|
350 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
351 |
if ( iWaiter->iStatus.Int() == KErrNotSupported ) // For some reason, MMF returns KErrNotSupported...
|
|
352 |
return KErrNone;
|
|
353 |
return KErrNone;
|
|
354 |
}
|
|
355 |
|
|
356 |
|
|
357 |
// ---------------------------------------------------------------------------
|
|
358 |
// CTSanimmmfplugin::TestLoad8bitMonoToneL
|
|
359 |
//
|
|
360 |
// ---------------------------------------------------------------------------
|
|
361 |
//
|
|
362 |
TInt CTSanimmmfplugin::TestLoad8bitMonoToneL()
|
|
363 |
{
|
|
364 |
iTestObj->Load( iFs, K8bitMonoFile, iWaiter->iStatus );
|
|
365 |
iWaiter->Activate();
|
|
366 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
367 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
368 |
return KErrNone;
|
|
369 |
}
|
|
370 |
|
|
371 |
// ---------------------------------------------------------------------------
|
|
372 |
// CTSanimmmfplugin::TestLoad16bitMonoToneL
|
|
373 |
//
|
|
374 |
// ---------------------------------------------------------------------------
|
|
375 |
//
|
|
376 |
TInt CTSanimmmfplugin::TestLoad16bitMonoToneL()
|
|
377 |
{
|
|
378 |
iTestObj->Load( iFs, K16bitMonoFile, iWaiter->iStatus );
|
|
379 |
iWaiter->Activate();
|
|
380 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
381 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
382 |
return KErrNone;
|
|
383 |
}
|
|
384 |
|
|
385 |
|
|
386 |
// ---------------------------------------------------------------------------
|
|
387 |
// CTSanimmmfplugin::TestLoadGsm6_10ToneL
|
|
388 |
//
|
|
389 |
// ---------------------------------------------------------------------------
|
|
390 |
//
|
|
391 |
TInt CTSanimmmfplugin::TestLoadGsm6_10ToneL()
|
|
392 |
{
|
|
393 |
iTestObj->Load( iFs, KGsm6_10File, iWaiter->iStatus );
|
|
394 |
iWaiter->Activate();
|
|
395 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
396 |
if ( iWaiter->iStatus.Int() == KErrNone || iWaiter->iStatus.Int() == KErrNotFound )
|
|
397 |
return KErrNone;
|
|
398 |
return KErrNone;
|
|
399 |
}
|
|
400 |
|
|
401 |
// ---------------------------------------------------------------------------
|
|
402 |
// CTSanimmmfplugin::TestLoadNoMemoryL
|
|
403 |
//
|
|
404 |
// ---------------------------------------------------------------------------
|
|
405 |
//
|
|
406 |
TInt CTSanimmmfplugin::TestLoadNoMemoryL()
|
|
407 |
{
|
|
408 |
iTestObj->Load( iFs, KGsm6_10File, iWaiter->iStatus );
|
|
409 |
iWaiter->Activate();
|
|
410 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
411 |
if (iWaiter->iStatus.Int() == KErrNoMemory || iWaiter->iStatus.Int() == KErrNone ||
|
|
412 |
iWaiter->iStatus.Int() == KErrGeneral )
|
|
413 |
return KErrNone;
|
|
414 |
return KErrNone;
|
|
415 |
}
|
|
416 |
|
|
417 |
|
|
418 |
// ---------------------------------------------------------------------------
|
|
419 |
// CTSanimmmfPlugin::TestCancelLoadL
|
|
420 |
//
|
|
421 |
// ---------------------------------------------------------------------------
|
|
422 |
//
|
|
423 |
TInt CTSanimmmfplugin::TestCancelLoadL()
|
|
424 |
{
|
|
425 |
iTestObj->Load( iFs, KGsm6_10File, iWaiter->iStatus );
|
|
426 |
iWaiter->Activate();
|
|
427 |
iTestObj->Cancel();
|
|
428 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
429 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrCancel );
|
|
430 |
return KErrNone;
|
|
431 |
}
|
|
432 |
|
|
433 |
// ---------------------------------------------------------------------------
|
|
434 |
// CTSanimmmfplugin::TestStartL
|
|
435 |
//
|
|
436 |
// ---------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
TInt CTSanimmmfplugin::TestStartL()
|
|
439 |
{
|
|
440 |
iTestObj->Start( iWaiter->iStatus );
|
|
441 |
iWaiter->Activate();
|
|
442 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
443 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
444 |
return KErrNone;
|
|
445 |
}
|
|
446 |
|
|
447 |
|
|
448 |
// ---------------------------------------------------------------------------
|
|
449 |
// CTSanimmmfplugin::TestCancelStartL
|
|
450 |
//
|
|
451 |
// ---------------------------------------------------------------------------
|
|
452 |
//
|
|
453 |
TInt CTSanimmmfplugin::TestCancelStartL()
|
|
454 |
{
|
|
455 |
iTestObj->Start( iWaiter->iStatus );
|
|
456 |
iWaiter->Activate();
|
|
457 |
iTestObj->Cancel();
|
|
458 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
459 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrCancel );
|
|
460 |
return KErrNone;
|
|
461 |
}
|
|
462 |
// ---------------------------------------------------------------------------
|
|
463 |
// CTSanimmmfplugin::TestCancelNotActiveL
|
|
464 |
//
|
|
465 |
// ---------------------------------------------------------------------------
|
|
466 |
//
|
|
467 |
TInt CTSanimmmfplugin::TestCancelNotActiveL()
|
|
468 |
{
|
|
469 |
iTestObj->Cancel();
|
|
470 |
return KErrNone;
|
|
471 |
}
|
|
472 |
|
|
473 |
|
|
474 |
// ---------------------------------------------------------------------------
|
|
475 |
// CTSanimmmfPplugin::TestStartBeforeLoadL
|
|
476 |
//
|
|
477 |
// ---------------------------------------------------------------------------
|
|
478 |
//
|
|
479 |
TInt CTSanimmmfplugin::TestStartBeforeLoadL()
|
|
480 |
{
|
|
481 |
// iTestObj->Start( iWaiter->iStatus );
|
|
482 |
return KErrNone;
|
|
483 |
}
|
|
484 |
// ---------------------------------------------------------------------------
|
|
485 |
// CTSanimmmfplugin::TestSetVolumeL
|
|
486 |
//
|
|
487 |
// ---------------------------------------------------------------------------
|
|
488 |
//
|
|
489 |
TInt CTSanimmmfplugin::TestSetVolumeL()
|
|
490 |
{
|
|
491 |
iTestObj->SetVolume( 1 );
|
|
492 |
iTestObj->Load( iFs, KGsm6_10File, iWaiter->iStatus );
|
|
493 |
iTestObj->SetVolume( 0 );
|
|
494 |
iWaiter->Activate();
|
|
495 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
496 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
497 |
iTestObj->SetVolume( 12 );
|
|
498 |
iTestObj->SetVolume( 5 );
|
|
499 |
iTestObj->Start( iWaiter->iStatus );
|
|
500 |
iWaiter->Activate();
|
|
501 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
502 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
503 |
iTestObj->SetVolume( 3 );
|
|
504 |
return KErrNone;
|
|
505 |
}
|
|
506 |
// ---------------------------------------------------------------------------
|
|
507 |
// CTSanimmmfplugin::TestSetVolumeRampL
|
|
508 |
//
|
|
509 |
// ---------------------------------------------------------------------------
|
|
510 |
//
|
|
511 |
TInt CTSanimmmfplugin::TestSetVolumeRampL()
|
|
512 |
{
|
|
513 |
iTestObj->SetVolumeRamp( 1000000 );
|
|
514 |
iTestObj->Load( iFs, KGsm6_10File, iWaiter->iStatus );
|
|
515 |
iTestObj->SetVolumeRamp( 0 );
|
|
516 |
iWaiter->Activate();
|
|
517 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
518 |
//EUNIT_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
519 |
iTestObj->SetVolumeRamp( 12000000 );
|
|
520 |
iTestObj->SetVolumeRamp( 5000 );
|
|
521 |
iTestObj->Start( iWaiter->iStatus );
|
|
522 |
iWaiter->Activate();
|
|
523 |
CActiveScheduler::Start(); // Waiter stops it when request completes.
|
|
524 |
STIF_ASSERT_EQUALS( iWaiter->iStatus.Int(), KErrNone );
|
|
525 |
iTestObj->SetVolumeRamp( 300 );
|
|
526 |
return KErrNone;
|
|
527 |
}
|
|
528 |
|
|
529 |
// Praveen
|
|
530 |
// -----------------------------------------------------------------------------
|
|
531 |
// CTSanimmmfplugin::ExampleL
|
|
532 |
// Example test method function.
|
|
533 |
// (other items were commented in a header).
|
|
534 |
// -----------------------------------------------------------------------------
|
|
535 |
//
|
|
536 |
TInt CTSanimmmfplugin::ExampleL( CStifItemParser& aItem )
|
|
537 |
{
|
|
538 |
|
|
539 |
// Print to UI
|
|
540 |
_LIT( KTSanimmmfplugin, "TSanimmmfplugin" );
|
|
541 |
_LIT( KExample, "In Example" );
|
|
542 |
TestModuleIf().Printf( 0, KTSanimmmfplugin, KExample );
|
|
543 |
// Print to log file
|
|
544 |
iLog->Log( KExample );
|
|
545 |
|
|
546 |
TInt i = 0;
|
|
547 |
TPtrC string;
|
|
548 |
_LIT( KParam, "Param[%i]: %S" );
|
|
549 |
while ( aItem.GetNextString ( string ) == KErrNone )
|
|
550 |
{
|
|
551 |
TestModuleIf().Printf( i, KTSanimmmfplugin,
|
|
552 |
KParam, i, &string );
|
|
553 |
i++;
|
|
554 |
}
|
|
555 |
|
|
556 |
return KErrNone;
|
|
557 |
|
|
558 |
}
|
|
559 |
|
|
560 |
// -----------------------------------------------------------------------------
|
|
561 |
// CTSanimmmfplugin::?member_function
|
|
562 |
// ?implementation_description
|
|
563 |
// (other items were commented in a header).
|
|
564 |
// -----------------------------------------------------------------------------
|
|
565 |
//
|
|
566 |
/*
|
|
567 |
TInt CTSanimmmfplugin::?member_function(
|
|
568 |
CItemParser& aItem )
|
|
569 |
{
|
|
570 |
|
|
571 |
?code
|
|
572 |
|
|
573 |
}
|
|
574 |
*/
|
|
575 |
|
|
576 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
|
577 |
// None
|
|
578 |
|
|
579 |
// [End of File] - Do not remove
|
|
580 |
|
|
581 |
// End of File
|