|
1 /* |
|
2 * Copyright (c) 2007 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: STIF testing for MPX Harvester |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32svr.h> |
|
21 #include <badesca.h> |
|
22 #include <StifParser.h> |
|
23 #include <Stiftestinterface.h> |
|
24 |
|
25 #include <mpxharvesterutility.h> |
|
26 #include <mpxcollectionutility.h> |
|
27 #include <mpxattribute.h> |
|
28 #include <mpxplaylistenginedefs.h> |
|
29 #include "mpxharvestertest.h" |
|
30 |
|
31 // ======== MEMBER FUNCTIONS ======== |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // Cmpxharvestertest::Delete |
|
35 // Delete here all resources allocated and opened from test methods. |
|
36 // Called from destructor. |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 void Cmpxharvestertest::Delete() |
|
40 { |
|
41 |
|
42 if ( iHarvester ) |
|
43 { |
|
44 iHarvester->Close(); |
|
45 } |
|
46 if ( iCollection ) |
|
47 { |
|
48 iCollection->Close(); |
|
49 } |
|
50 iExpectedEvents.Close(); |
|
51 } |
|
52 |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // Cmpxharvestertest::AddExpectedEvent |
|
56 // Add an event to the expected event list |
|
57 // ----------------------------------------------------------------------------- |
|
58 |
|
59 void Cmpxharvestertest::AddExpectedEvent( TExpectedEvents aEvent ) |
|
60 { |
|
61 iLog->Log(_L("Cmpxharvestertest::AddExpectedEvent: %d"), aEvent); |
|
62 iExpectedEvents.Append(aEvent); |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // Cmpxharvestertest::RemoveExpectedEvent |
|
67 // Remove the event from the expected event list |
|
68 // Returns: ETrue: Event found. |
|
69 // EFalse: Event not found. |
|
70 // ----------------------------------------------------------------------------- |
|
71 TBool Cmpxharvestertest::RemoveExpectedEvent( TExpectedEvents aEvent ) |
|
72 { |
|
73 iLog->Log(_L("Cmpxharvestertest::RemoveExpectedEvent: %d"), aEvent); |
|
74 TBool match = EFalse; |
|
75 TInt index = iExpectedEvents.Find(aEvent); |
|
76 if ( index != KErrNotFound ) |
|
77 { |
|
78 iExpectedEvents.Remove(index); |
|
79 match = ETrue; |
|
80 } |
|
81 return match; |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // Cmpxharvestertest::RunMethodL |
|
86 // Run specified method. Contains also table of test mothods and their names. |
|
87 // --------------------------------------------------------------------------- |
|
88 // |
|
89 TInt Cmpxharvestertest::RunMethodL( |
|
90 CStifItemParser& aItem ) |
|
91 { |
|
92 |
|
93 static TStifFunctionInfo const KFunctions[] = |
|
94 { |
|
95 // Copy this line for every implemented function. |
|
96 // First string is the function name used in TestScripter script file. |
|
97 // Second is the actual implementation member function. |
|
98 ENTRY( "Example", Cmpxharvestertest::ExampleL ), |
|
99 //ADD NEW ENTRY HERE |
|
100 ENTRY( "CreateUtility", Cmpxharvestertest::CreateUtility ), |
|
101 ENTRY( "CopyTestFile", Cmpxharvestertest::CopyTestFile ), |
|
102 ENTRY( "DeleteTestFile", Cmpxharvestertest::DeleteTestFile ), |
|
103 ENTRY( "VerifyEvents", Cmpxharvestertest::VerifyEvents ), |
|
104 ENTRY( "Scan", Cmpxharvestertest::Scan ), |
|
105 ENTRY( "CancelScan", Cmpxharvestertest::CancelScan ), |
|
106 ENTRY( "AddFileByPath", Cmpxharvestertest::AddFileByPath ), |
|
107 //ENTRY( "AddFileByMedia", Cmpxharvestertest::AddFileByMedia ), |
|
108 ENTRY( "RemoveFile", Cmpxharvestertest::RemoveFile ), |
|
109 ENTRY( "RemoveFiles", Cmpxharvestertest::RemoveFiles ), |
|
110 ENTRY( "RecreateDatabases", Cmpxharvestertest::RecreateDatabases ), |
|
111 ENTRY( "DeleteFile", Cmpxharvestertest::DeleteFile ), |
|
112 ENTRY( "DeleteFiles", Cmpxharvestertest::DeleteFiles ), |
|
113 //ENTRY( "UpdateFile", Cmpxharvestertest::UpdateFile ), |
|
114 ENTRY( "FindCollectionId", Cmpxharvestertest::FindCollectionId ), |
|
115 //ENTRY( "RenameFileByMedia", Cmpxharvestertest::RenameFileByMedia ), |
|
116 ENTRY( "RenameFileByPath", Cmpxharvestertest::RenameFileByPath ), |
|
117 //ENTRY( "ExportPlaylist", Cmpxharvestertest::ExportPlaylist ), |
|
118 ENTRY( "ImportPlaylist", Cmpxharvestertest::ImportPlaylist ), |
|
119 ENTRY( "ImportFile", Cmpxharvestertest::ImportFile ), |
|
120 ENTRY( "RequiredAttributes", Cmpxharvestertest::RequiredAttributes ), |
|
121 ENTRY( "OptionalAttributes", Cmpxharvestertest::OptionalAttributes ), |
|
122 ENTRY( "PlaylistFileExtension", Cmpxharvestertest::PlaylistFileExtension ), |
|
123 ENTRY( "IsPlaylist", Cmpxharvestertest::IsPlaylist ), |
|
124 ENTRY( "CheckForSystemEvents", Cmpxharvestertest::CheckForSystemEvents ) |
|
125 }; |
|
126 |
|
127 const TInt count = sizeof( KFunctions ) / |
|
128 sizeof( TStifFunctionInfo ); |
|
129 |
|
130 return RunInternalL( KFunctions, count, aItem ); |
|
131 |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // Cmpxharvestertest::HandlePlaylistExportCompletedL |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void Cmpxharvestertest::HandlePlaylistExportCompletedL( CMPXMedia* /*aMedia*/, TInt aErr ) |
|
139 { |
|
140 if ( RemoveExpectedEvent(EEventHandlePlaylistExportCompletedL) ) |
|
141 { |
|
142 iLog->Log(_L("Cmpxharvestertest::HandlePlaylistExportCompletedL: %d [EXPECTED]"), aErr); |
|
143 } |
|
144 else |
|
145 { |
|
146 iLog->Log(_L("Cmpxharvestertest::HandlePlaylistExportCompletedL: %d"), aErr); |
|
147 } |
|
148 } |
|
149 |
|
150 // --------------------------------------------------------------------------- |
|
151 // Cmpxharvestertest::HandlePlaylistImportCompletedL |
|
152 // --------------------------------------------------------------------------- |
|
153 // |
|
154 void Cmpxharvestertest::HandlePlaylistImportCompletedL( CMPXMedia* aMedia, TInt aErr ) |
|
155 { |
|
156 if ( RemoveExpectedEvent(EEventHandlePlaylistImportCompletedL) ) |
|
157 { |
|
158 iLog->Log(_L("Cmpxharvestertest::HandlePlaylistImportCompletedL: %d [EXPECTED]"), aErr); |
|
159 } |
|
160 else |
|
161 { |
|
162 iLog->Log(_L("Cmpxharvestertest::HandlePlaylistImportCompletedL: %d"), aErr); |
|
163 } |
|
164 |
|
165 if ( aErr == KErrNone ) |
|
166 { |
|
167 iLog->Log(_L("Number of attributes: %d"), aMedia->Count() ); |
|
168 delete aMedia; |
|
169 aMedia = NULL; |
|
170 } |
|
171 if ( (iResult && (aErr == KErrNone )) || (!iResult && (aErr != KErrNone)) ) |
|
172 { |
|
173 Signal(); |
|
174 } |
|
175 else |
|
176 { |
|
177 Signal(aErr); |
|
178 } |
|
179 } |
|
180 |
|
181 // --------------------------------------------------------------------------- |
|
182 // Cmpxharvestertest::HandleFileAddCompletedL |
|
183 // --------------------------------------------------------------------------- |
|
184 // |
|
185 void Cmpxharvestertest::HandleFileAddCompletedL( CMPXMedia* aMedia, TInt aErr ) |
|
186 { |
|
187 if ( RemoveExpectedEvent(EEventHandleFileAddCompletedL) ) |
|
188 { |
|
189 iLog->Log(_L("Cmpxharvestertest::HandleFileAddCompletedL: %d [EXPECTED]"), aErr); |
|
190 } |
|
191 else |
|
192 { |
|
193 iLog->Log(_L("Cmpxharvestertest::HandleFileAddCompletedL: %d"), aErr); |
|
194 } |
|
195 |
|
196 if ( aErr == KErrNone ) |
|
197 { |
|
198 iLog->Log(_L("Number of attributes: %d"), aMedia->Count() ); |
|
199 delete aMedia; |
|
200 aMedia = NULL; |
|
201 } |
|
202 Signal(); |
|
203 } |
|
204 |
|
205 // --------------------------------------------------------------------------- |
|
206 // Cmpxharvestertest::HandleDeleteCompletedL |
|
207 // --------------------------------------------------------------------------- |
|
208 // |
|
209 void Cmpxharvestertest::HandleDeleteCompletedL( TInt aErr ) |
|
210 { |
|
211 if ( RemoveExpectedEvent(EEventHandleDeleteCompletedL) ) |
|
212 { |
|
213 iLog->Log(_L("Cmpxharvestertest::HandleDeleteCompletedL: %d [EXPECTED]"), aErr); |
|
214 } |
|
215 else |
|
216 { |
|
217 iLog->Log(_L("Cmpxharvestertest::HandleDeleteCompletedL: %d"), aErr); |
|
218 } |
|
219 |
|
220 if ( aErr == KErrNone ) |
|
221 { |
|
222 Signal(); |
|
223 } |
|
224 else |
|
225 { |
|
226 Signal(aErr); |
|
227 } |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // Cmpxharvestertest::HandleFileImportCompletedL |
|
232 // --------------------------------------------------------------------------- |
|
233 // |
|
234 void Cmpxharvestertest::HandleFileImportCompletedL( CMPXMedia* aMedia, TInt aErr ) |
|
235 { |
|
236 if ( RemoveExpectedEvent(EEventHandleFileImportCompletedL) ) |
|
237 { |
|
238 iLog->Log(_L("Cmpxharvestertest::EEventHandleFileImportCompletedL: %d [EXPECTED]"), aErr); |
|
239 } |
|
240 else |
|
241 { |
|
242 iLog->Log(_L("Cmpxharvestertest::EEventHandleFileImportCompletedL: %d"), aErr); |
|
243 } |
|
244 |
|
245 if ( aErr == KErrNone ) |
|
246 { |
|
247 iLog->Log(_L("Number of attributes: %d"), aMedia->Count() ); |
|
248 delete aMedia; |
|
249 aMedia = NULL; |
|
250 } |
|
251 if ( (iResult && (aErr == KErrNone )) || (!iResult && (aErr != KErrNone)) ) |
|
252 { |
|
253 Signal(); |
|
254 } |
|
255 else |
|
256 { |
|
257 Signal(aErr); |
|
258 } |
|
259 } |
|
260 |
|
261 // --------------------------------------------------------------------------- |
|
262 // Cmpxharvestertest::HandleFileGetMediaCompletedL |
|
263 // --------------------------------------------------------------------------- |
|
264 // |
|
265 void Cmpxharvestertest::HandleFileGetMediaCompletedL( CMPXMedia* /*aMedia*/, TInt aErr ) |
|
266 { |
|
267 if ( RemoveExpectedEvent(EEventHandleFileGetMediaCompletedL) ) |
|
268 { |
|
269 iLog->Log(_L("Cmpxharvestertest::HandleFileGetMediaCompletedL: %d [EXPECTED]"), aErr); |
|
270 } |
|
271 else |
|
272 { |
|
273 iLog->Log(_L("Cmpxharvestertest::HandleFileGetMediaCompletedL: %d"), aErr); |
|
274 } |
|
275 } |
|
276 |
|
277 // --------------------------------------------------------------------------- |
|
278 // Cmpxharvestertest::HandleCollectionMediaL |
|
279 // --------------------------------------------------------------------------- |
|
280 // |
|
281 void Cmpxharvestertest::HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt aError ) |
|
282 { |
|
283 iLog->Log(_L("Cmpxharvestertest::HandleCollectionMediaL: %d"), aError); |
|
284 } |
|
285 |
|
286 // --------------------------------------------------------------------------- |
|
287 // Cmpxharvestertest::HandleCollectionMessage |
|
288 // --------------------------------------------------------------------------- |
|
289 // |
|
290 void Cmpxharvestertest::HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt aError ) |
|
291 { |
|
292 iLog->Log(_L("Cmpxharvestertest::HandleCollectionMessage: %d"), aError); |
|
293 } |
|
294 |
|
295 // --------------------------------------------------------------------------- |
|
296 // Cmpxharvestertest::HandleOpenL |
|
297 // --------------------------------------------------------------------------- |
|
298 // |
|
299 void Cmpxharvestertest::HandleOpenL( const CMPXMedia& /*aEntries*/, TInt /*aIndex*/, TBool /*aComplete*/, TInt aError ) |
|
300 { |
|
301 iLog->Log(_L("Cmpxharvestertest::HandleOpenL: %d"), aError); |
|
302 } |
|
303 // --------------------------------------------------------------------------- |
|
304 // Cmpxharvestertest::HandleOpenL |
|
305 // --------------------------------------------------------------------------- |
|
306 // |
|
307 void Cmpxharvestertest::HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt aError ) |
|
308 { |
|
309 iLog->Log(_L("Cmpxharvestertest::HandleOpenL: %d"), aError); |
|
310 } |
|
311 |
|
312 // --------------------------------------------------------------------------- |
|
313 // Cmpxharvestertest::ExampleL |
|
314 // Example test method function. |
|
315 // (other items were commented in a header). |
|
316 // --------------------------------------------------------------------------- |
|
317 // |
|
318 TInt Cmpxharvestertest::ExampleL( CStifItemParser& aItem ) |
|
319 { |
|
320 |
|
321 // Print to UI |
|
322 _LIT( Kmpxharvestertest, "mpxharvestertest" ); |
|
323 _LIT( KExample, "In Example" ); |
|
324 TestModuleIf().Printf( 0, Kmpxharvestertest, KExample ); |
|
325 // Print to log file |
|
326 iLog->Log( KExample ); |
|
327 |
|
328 TInt i = 0; |
|
329 TPtrC string; |
|
330 _LIT( KParam, "Param[%i]: %S" ); |
|
331 while ( aItem.GetNextString( string ) == KErrNone ) |
|
332 { |
|
333 TestModuleIf().Printf( i, Kmpxharvestertest, |
|
334 KParam, i, &string ); |
|
335 i++; |
|
336 } |
|
337 |
|
338 return KErrNone; |
|
339 } |
|
340 |
|
341 // --------------------------------------------------------------------------- |
|
342 // Cmpxharvestertest::CreateUtility |
|
343 // ?implementation_description |
|
344 // (other items were commented in a header). |
|
345 // --------------------------------------------------------------------------- |
|
346 // |
|
347 TInt Cmpxharvestertest::CreateUtility( CStifItemParser& /*aItem*/ ) |
|
348 { |
|
349 iLog->Log(_L("Cmpxharvestertest::CreateUtility")); |
|
350 TRAPD(err, iHarvester = CMPXHarvesterFactory::NewL()); |
|
351 if ( err == KErrNone ) |
|
352 { |
|
353 TRAP(err, iCollection = MMPXCollectionUtility::NewL(this)); |
|
354 if ( err != KErrNone ) |
|
355 { |
|
356 iLog->Log(_L("MMPXCollectionUtility::NewL returned: %d"), err); |
|
357 } |
|
358 } |
|
359 else |
|
360 { |
|
361 iLog->Log(_L("CMPXHarvesterFactory::NewL returned: %d"), err); |
|
362 } |
|
363 |
|
364 iExpectedEvents.Reset(); |
|
365 return err; |
|
366 } |
|
367 |
|
368 // --------------------------------------------------------------------------- |
|
369 // Cmpxharvestertest::CopyTestFile |
|
370 // ?implementation_description |
|
371 // (other items were commented in a header). |
|
372 // --------------------------------------------------------------------------- |
|
373 // |
|
374 TInt Cmpxharvestertest::CopyTestFile( CStifItemParser& aItem ) |
|
375 { |
|
376 iLog->Log(_L("Cmpxharvestertest::CopyTestFile")); |
|
377 TInt err = KErrNone; |
|
378 TPtrC string; |
|
379 while ( aItem.GetNextString( string ) == KErrNone ) |
|
380 { |
|
381 TBuf<120> KFrom; |
|
382 KFrom.Append(Kmpxharvester_testPath); |
|
383 KFrom.Append(string); |
|
384 |
|
385 TBuf<120> KTo; |
|
386 KTo.Append(Kmpxharvester_digitalPath); |
|
387 KTo.Append(string); |
|
388 |
|
389 err = iFileMan->Copy(KFrom, KTo); |
|
390 if ( err != KErrNone ) |
|
391 { |
|
392 iLog->Log(_L("CopyTestFile returned: %d"), err); |
|
393 break; |
|
394 } |
|
395 } |
|
396 return err; |
|
397 } |
|
398 |
|
399 // --------------------------------------------------------------------------- |
|
400 // Cmpxharvestertest::DeleteTestFile |
|
401 // ?implementation_description |
|
402 // (other items were commented in a header). |
|
403 // --------------------------------------------------------------------------- |
|
404 // |
|
405 TInt Cmpxharvestertest::DeleteTestFile( CStifItemParser& aItem ) |
|
406 { |
|
407 iLog->Log(_L("Cmpxharvestertest::DeleteTestFile")); |
|
408 TInt err = KErrNone; |
|
409 TPtrC string; |
|
410 while ( aItem.GetNextString( string ) == KErrNone ) |
|
411 { |
|
412 TBuf<120> KFrom; |
|
413 KFrom.Append(Kmpxharvester_digitalPath); |
|
414 KFrom.Append(string); |
|
415 |
|
416 err = iFileMan->Delete(KFrom); |
|
417 if ( err != KErrNone ) |
|
418 { |
|
419 iLog->Log(_L("DeleteTestFile returned: %d"), err); |
|
420 break; |
|
421 } |
|
422 } |
|
423 return err; |
|
424 } |
|
425 |
|
426 // --------------------------------------------------------------------------- |
|
427 // Cmpxharvestertest::VerifyEvents |
|
428 // ?implementation_description |
|
429 // (other items were commented in a header). |
|
430 // --------------------------------------------------------------------------- |
|
431 // |
|
432 TInt Cmpxharvestertest::VerifyEvents( CStifItemParser& /*aItem*/ ) |
|
433 { |
|
434 TInt err = KErrNone; |
|
435 TInt count = iExpectedEvents.Count(); |
|
436 if ( count > 0 ) |
|
437 { |
|
438 for ( TInt i = 0; i < count; i++ ) |
|
439 { |
|
440 iLog->Log(_L("Cmpxharvestertest::VerifyEvents - Missing: %d"), iExpectedEvents[i]); |
|
441 } |
|
442 err = KErrGeneral; |
|
443 iExpectedEvents.Reset(); |
|
444 } |
|
445 return err; |
|
446 } |
|
447 |
|
448 // --------------------------------------------------------------------------- |
|
449 // Cmpxharvestertest::Scan |
|
450 // ?implementation_description |
|
451 // (other items were commented in a header). |
|
452 // --------------------------------------------------------------------------- |
|
453 // |
|
454 TInt Cmpxharvestertest::Scan( CStifItemParser& /*aItem*/ ) |
|
455 { |
|
456 iLog->Log(_L("Cmpxharvestertest::Scan")); |
|
457 TRAPD(err, iHarvester->ScanL()); |
|
458 if ( err != KErrNone ) |
|
459 { |
|
460 iLog->Log(_L("ScanL returned: %d"), err); |
|
461 } |
|
462 return err; |
|
463 } |
|
464 |
|
465 // --------------------------------------------------------------------------- |
|
466 // Cmpxharvestertest::CancelScan |
|
467 // ?implementation_description |
|
468 // (other items were commented in a header). |
|
469 // --------------------------------------------------------------------------- |
|
470 // |
|
471 TInt Cmpxharvestertest::CancelScan( CStifItemParser& /*aItem*/ ) |
|
472 { |
|
473 iLog->Log(_L("Cmpxharvestertest::CancelScan")); |
|
474 TRAPD(err, iHarvester->CancelScanL()); |
|
475 if ( err != KErrNone ) |
|
476 { |
|
477 iLog->Log(_L("CancelScanL returned: %d"), err); |
|
478 } |
|
479 return err; |
|
480 } |
|
481 |
|
482 // --------------------------------------------------------------------------- |
|
483 // Cmpxharvestertest::AddFileByPath |
|
484 // ?implementation_description |
|
485 // (other items were commented in a header). |
|
486 // --------------------------------------------------------------------------- |
|
487 // |
|
488 TInt Cmpxharvestertest::AddFileByPath( CStifItemParser& aItem ) |
|
489 { |
|
490 iLog->Log(_L("Cmpxharvestertest::AddFileByPath")); |
|
491 TInt err = KErrNone; |
|
492 TPtrC string; |
|
493 if ( KErrNone == aItem.GetNextString(string) ) |
|
494 { |
|
495 TBuf<120> KFile; |
|
496 KFile.Append(Kmpxharvester_digitalPath); |
|
497 KFile.Append(string); |
|
498 |
|
499 TRAP(err, iHarvester->AddFileL(KFile, this)) |
|
500 if ( err == KErrNone ) |
|
501 { |
|
502 AddExpectedEvent(EEventHandleFileAddCompletedL); |
|
503 } |
|
504 else |
|
505 { |
|
506 iLog->Log(_L("AddFileL returned: %d"), err); |
|
507 } |
|
508 } |
|
509 else |
|
510 { |
|
511 iLog->Log(_L("Bad parameter on config file")); |
|
512 err = KErrBadTestParameter; |
|
513 } |
|
514 |
|
515 return err; |
|
516 } |
|
517 |
|
518 // --------------------------------------------------------------------------- |
|
519 // Cmpxharvestertest::AddFileByMedia |
|
520 // ?implementation_description |
|
521 // (other items were commented in a header). |
|
522 // --------------------------------------------------------------------------- |
|
523 // |
|
524 //TInt Cmpxharvestertest::AddFileByMedia( CStifItemParser& aItem ) |
|
525 |
|
526 // --------------------------------------------------------------------------- |
|
527 // Cmpxharvestertest::RemoveFile |
|
528 // ?implementation_description |
|
529 // (other items were commented in a header). |
|
530 // --------------------------------------------------------------------------- |
|
531 // |
|
532 TInt Cmpxharvestertest::RemoveFile( CStifItemParser& aItem ) |
|
533 { |
|
534 iLog->Log(_L("Cmpxharvestertest::RemoveFile")); |
|
535 TInt err = KErrNone; |
|
536 TPtrC string; |
|
537 if ( KErrNone == aItem.GetNextString(string) ) |
|
538 { |
|
539 TBuf<120> KFile; |
|
540 KFile.Append(Kmpxharvester_digitalPath); |
|
541 KFile.Append(string); |
|
542 |
|
543 TRAP(err, iHarvester->RemoveFileL(KFile)) |
|
544 if ( err != KErrNone ) |
|
545 { |
|
546 iLog->Log(_L("RemoveFileL returned: %d"), err); |
|
547 } |
|
548 } |
|
549 else |
|
550 { |
|
551 iLog->Log(_L("Bad parameter on config file")); |
|
552 err = KErrBadTestParameter; |
|
553 } |
|
554 |
|
555 return err; |
|
556 } |
|
557 |
|
558 // --------------------------------------------------------------------------- |
|
559 // Cmpxharvestertest::RemoveFiles |
|
560 // ?implementation_description |
|
561 // (other items were commented in a header). |
|
562 // --------------------------------------------------------------------------- |
|
563 // |
|
564 TInt Cmpxharvestertest::RemoveFiles( CStifItemParser& aItem ) |
|
565 { |
|
566 iLog->Log(_L("Cmpxharvestertest::RemoveFiles")); |
|
567 TInt err = KErrNone; |
|
568 TPtrC string; |
|
569 if ( KErrNone == aItem.GetNextString(string) ) |
|
570 { |
|
571 if ( string == KTagAll ) |
|
572 { |
|
573 TRAP(err, iHarvester->RemoveAllFilesL()); |
|
574 if ( err != KErrNone ) |
|
575 { |
|
576 iLog->Log(_L("RemoveAllFilesL returned: %d"), err); |
|
577 } |
|
578 } |
|
579 else |
|
580 { |
|
581 CDesCArrayFlat* files = new (ELeave)CDesCArrayFlat(1); |
|
582 CleanupStack::PushL(files); |
|
583 TBuf<120> KFrom; |
|
584 KFrom.Append(Kmpxharvester_digitalPath); |
|
585 KFrom.Append(string); |
|
586 files->AppendL(KFrom); |
|
587 |
|
588 while ( aItem.GetNextString( string ) == KErrNone ) |
|
589 { |
|
590 TBuf<120> KFrom; |
|
591 KFrom.Append(Kmpxharvester_digitalPath); |
|
592 KFrom.Append(string); |
|
593 files->AppendL(KFrom); |
|
594 } |
|
595 |
|
596 TRAP(err, iHarvester->RemoveFilesL(*files)); |
|
597 if ( err != KErrNone ) |
|
598 { |
|
599 iLog->Log(_L("RemoveFilesL returned: %d"), err); |
|
600 } |
|
601 CleanupStack::PopAndDestroy(files); |
|
602 } |
|
603 } |
|
604 else |
|
605 { |
|
606 iLog->Log(_L("Bad parameter on config file")); |
|
607 err = KErrBadTestParameter; |
|
608 } |
|
609 |
|
610 return err; |
|
611 } |
|
612 |
|
613 // --------------------------------------------------------------------------- |
|
614 // Cmpxharvestertest::RecreateDatabases |
|
615 // ?implementation_description |
|
616 // (other items were commented in a header). |
|
617 // --------------------------------------------------------------------------- |
|
618 // |
|
619 TInt Cmpxharvestertest::RecreateDatabases( CStifItemParser& /*aItem*/ ) |
|
620 { |
|
621 iLog->Log(_L("Cmpxharvestertest::RecreateDatabases")); |
|
622 TRAPD(err, iHarvester->RecreateDatabasesL()); |
|
623 if ( err != KErrNone ) |
|
624 { |
|
625 iLog->Log(_L("RecreateDatabasesL returned: %d"), err); |
|
626 } |
|
627 return err; |
|
628 } |
|
629 |
|
630 // --------------------------------------------------------------------------- |
|
631 // Cmpxharvestertest::DeleteFile |
|
632 // ?implementation_description |
|
633 // (other items were commented in a header). |
|
634 // --------------------------------------------------------------------------- |
|
635 // |
|
636 TInt Cmpxharvestertest::DeleteFile( CStifItemParser& aItem ) |
|
637 { |
|
638 iLog->Log(_L("Cmpxharvestertest::DeleteFile")); |
|
639 TInt err = KErrNone; |
|
640 TPtrC string; |
|
641 if ( KErrNone == aItem.GetNextString(string) ) |
|
642 { |
|
643 TBuf<120> KFile; |
|
644 KFile.Append(Kmpxharvester_digitalPath); |
|
645 KFile.Append(string); |
|
646 |
|
647 TRAP(err, iHarvester->DeleteFileL(KFile, this)) |
|
648 if ( err != KErrNone ) |
|
649 { |
|
650 iLog->Log(_L("DeleteFileL returned: %d"), err); |
|
651 } |
|
652 } |
|
653 else |
|
654 { |
|
655 iLog->Log(_L("Bad parameter on config file")); |
|
656 err = KErrBadTestParameter; |
|
657 } |
|
658 |
|
659 return err; |
|
660 } |
|
661 |
|
662 // --------------------------------------------------------------------------- |
|
663 // Cmpxharvestertest::DeleteFiles |
|
664 // ?implementation_description |
|
665 // (other items were commented in a header). |
|
666 // --------------------------------------------------------------------------- |
|
667 // |
|
668 TInt Cmpxharvestertest::DeleteFiles( CStifItemParser& aItem ) |
|
669 { |
|
670 iLog->Log(_L("Cmpxharvestertest::DeleteFiles")); |
|
671 TInt err = KErrNone; |
|
672 TPtrC mode; |
|
673 TPtrC string; |
|
674 TPtrC string2; |
|
675 if ( KErrNone == aItem.GetNextString(mode) ) |
|
676 { |
|
677 CDesCArrayFlat* files = new (ELeave)CDesCArrayFlat(1); |
|
678 CleanupStack::PushL(files); |
|
679 while ( aItem.GetNextString( string ) == KErrNone ) |
|
680 { |
|
681 TBuf<120> KFrom; |
|
682 KFrom.Append(Kmpxharvester_digitalPath); |
|
683 KFrom.Append(string); |
|
684 files->AppendL(KFrom); |
|
685 } |
|
686 |
|
687 if ( mode == KTagAsync ) |
|
688 { |
|
689 TRAP(err, iHarvester->DeleteFilesL(*files, this)); |
|
690 if ( err == KErrNone ) |
|
691 { |
|
692 AddExpectedEvent(EEventHandleDeleteCompletedL); |
|
693 } |
|
694 else |
|
695 { |
|
696 iLog->Log(_L("DeleteFilesL async returned: %d"), err); |
|
697 } |
|
698 } |
|
699 else if ( mode == KTagSync ) |
|
700 { |
|
701 TRAP(err, iHarvester->DeleteFilesL(*files)); |
|
702 if ( err != KErrNone ) |
|
703 { |
|
704 iLog->Log(_L("DeleteFilesL sync returned: %d"), err); |
|
705 } |
|
706 } |
|
707 else |
|
708 { |
|
709 iLog->Log(_L("Bad parameter on config file")); |
|
710 err = KErrBadTestParameter; |
|
711 } |
|
712 CleanupStack::PopAndDestroy(files); |
|
713 } |
|
714 else |
|
715 { |
|
716 iLog->Log(_L("Bad parameter on config file")); |
|
717 err = KErrBadTestParameter; |
|
718 } |
|
719 |
|
720 return err; |
|
721 } |
|
722 |
|
723 // --------------------------------------------------------------------------- |
|
724 // Cmpxharvestertest::UpdateFile |
|
725 // ?implementation_description |
|
726 // (other items were commented in a header). |
|
727 // --------------------------------------------------------------------------- |
|
728 // |
|
729 //TInt Cmpxharvestertest::UpdateFile( CStifItemParser& aItem ) |
|
730 |
|
731 // --------------------------------------------------------------------------- |
|
732 // Cmpxharvestertest::FindCollectionId |
|
733 // ?implementation_description |
|
734 // (other items were commented in a header). |
|
735 // --------------------------------------------------------------------------- |
|
736 // |
|
737 TInt Cmpxharvestertest::FindCollectionId( CStifItemParser& aItem ) |
|
738 { |
|
739 iLog->Log(_L("Cmpxharvestertest::FindCollectionId")); |
|
740 TInt err = KErrNone; |
|
741 TPtrC string; |
|
742 if ( KErrNone == aItem.GetNextString(string) ) |
|
743 { |
|
744 TBuf<120> KFile; |
|
745 KFile.Append(Kmpxharvester_digitalPath); |
|
746 KFile.Append(string); |
|
747 |
|
748 TInt id = 0; |
|
749 TRAP(err, id = iHarvester->FindCollectionIdL(KFile)) |
|
750 if ( err != KErrNone ) |
|
751 { |
|
752 iLog->Log(_L("FindCollectionIdL returned: %d"), err); |
|
753 } |
|
754 else |
|
755 { |
|
756 iLog->Log(_L("Collection ID: %d"), id); |
|
757 } |
|
758 } |
|
759 else |
|
760 { |
|
761 iLog->Log(_L("Bad parameter on config file")); |
|
762 err = KErrBadTestParameter; |
|
763 } |
|
764 |
|
765 return err; |
|
766 } |
|
767 |
|
768 // --------------------------------------------------------------------------- |
|
769 // Cmpxharvestertest::RenameFileByMedia |
|
770 // ?implementation_description |
|
771 // (other items were commented in a header). |
|
772 // --------------------------------------------------------------------------- |
|
773 // |
|
774 //TInt Cmpxharvestertest::RenameFileByMedia( CStifItemParser& aItem ) |
|
775 |
|
776 // --------------------------------------------------------------------------- |
|
777 // Cmpxharvestertest::RenameFileByPath |
|
778 // ?implementation_description |
|
779 // (other items were commented in a header). |
|
780 // --------------------------------------------------------------------------- |
|
781 // |
|
782 TInt Cmpxharvestertest::RenameFileByPath( CStifItemParser& aItem ) |
|
783 { |
|
784 iLog->Log(_L("Cmpxharvestertest::RenameFileByPath")); |
|
785 TInt err = KErrNone; |
|
786 TPtrC oldUri; |
|
787 TPtrC newUri; |
|
788 TBuf<120> KOld; |
|
789 TBuf<120> KNew; |
|
790 if ( KErrNone == aItem.GetNextString(oldUri) ) |
|
791 { |
|
792 KOld.Append(Kmpxharvester_digitalPath); |
|
793 KOld.Append(oldUri); |
|
794 |
|
795 if ( KErrNone == aItem.GetNextString(newUri) ) |
|
796 { |
|
797 KNew.Append(Kmpxharvester_digitalPath); |
|
798 KNew.Append(newUri); |
|
799 } |
|
800 else |
|
801 { |
|
802 iLog->Log(_L("Bad parameter on config file")); |
|
803 err = KErrBadTestParameter; |
|
804 } |
|
805 } |
|
806 else |
|
807 { |
|
808 iLog->Log(_L("Bad parameter on config file")); |
|
809 err = KErrBadTestParameter; |
|
810 } |
|
811 |
|
812 if ( err == KErrNone ) |
|
813 { |
|
814 TInt id = 0; |
|
815 TRAP(err, id = iHarvester->FindCollectionIdL(KOld)) |
|
816 if ( err != KErrNone ) |
|
817 { |
|
818 iLog->Log(_L("FindCollectionIdL returned: %d"), err); |
|
819 } |
|
820 else |
|
821 { |
|
822 TRAP(err, iHarvester->RenameFileL(KOld, KNew, id)); |
|
823 if ( err != KErrNone ) |
|
824 { |
|
825 iLog->Log(_L("RenameFileL returned: %d"), err); |
|
826 } |
|
827 } |
|
828 } |
|
829 return err; |
|
830 } |
|
831 |
|
832 // --------------------------------------------------------------------------- |
|
833 // Cmpxharvestertest::ExportPlaylist |
|
834 // ?implementation_description |
|
835 // (other items were commented in a header). |
|
836 // --------------------------------------------------------------------------- |
|
837 // |
|
838 //TInt Cmpxharvestertest::ExportPlaylist( CStifItemParser& aItem ) |
|
839 |
|
840 // --------------------------------------------------------------------------- |
|
841 // Cmpxharvestertest::ImportPlaylist |
|
842 // ?implementation_description |
|
843 // (other items were commented in a header). |
|
844 // --------------------------------------------------------------------------- |
|
845 // |
|
846 TInt Cmpxharvestertest::ImportPlaylist( CStifItemParser& aItem ) |
|
847 { |
|
848 iLog->Log(_L("Cmpxharvestertest::ImportPlaylist")); |
|
849 TInt err = KErrNone; |
|
850 TPtrC string; |
|
851 TPtrC result; |
|
852 if ( KErrNone == aItem.GetNextString(string) ) |
|
853 { |
|
854 TBuf<120> KFile; |
|
855 KFile.Append(Kmpxharvester_digitalPath); |
|
856 KFile.Append(string); |
|
857 |
|
858 if ( KErrNone == aItem.GetNextString(result) ) |
|
859 { |
|
860 if ( result == KTagTrue ) |
|
861 { |
|
862 iResult = ETrue; |
|
863 } |
|
864 else if ( result == KTagFalse ) |
|
865 { |
|
866 iResult = EFalse; |
|
867 } |
|
868 else |
|
869 { |
|
870 iLog->Log(_L("Bad parameter on config file")); |
|
871 err = KErrBadTestParameter; |
|
872 } |
|
873 |
|
874 if ( err == KErrNone ) |
|
875 { |
|
876 TRAP(err, iHarvester->ImportPlaylistL(KFile, this)) |
|
877 if ( err == KErrNone ) |
|
878 { |
|
879 AddExpectedEvent(EEventHandlePlaylistImportCompletedL); |
|
880 } |
|
881 else |
|
882 { |
|
883 iLog->Log(_L("ImportPlaylist returned: %d"), err); |
|
884 } |
|
885 } |
|
886 } |
|
887 } |
|
888 else |
|
889 { |
|
890 iLog->Log(_L("Bad parameter on config file")); |
|
891 err = KErrBadTestParameter; |
|
892 } |
|
893 |
|
894 return err; |
|
895 } |
|
896 |
|
897 // --------------------------------------------------------------------------- |
|
898 // Cmpxharvestertest::ImportFile |
|
899 // ?implementation_description |
|
900 // (other items were commented in a header). |
|
901 // --------------------------------------------------------------------------- |
|
902 // |
|
903 TInt Cmpxharvestertest::ImportFile( CStifItemParser& aItem ) |
|
904 { |
|
905 iLog->Log(_L("Cmpxharvestertest::ImportFile")); |
|
906 TInt err = KErrNone; |
|
907 TPtrC string; |
|
908 TPtrC result; |
|
909 if ( KErrNone == aItem.GetNextString(string) ) |
|
910 { |
|
911 TBuf<120> KFile; |
|
912 KFile.Append(Kmpxharvester_digitalPath); |
|
913 KFile.Append(string); |
|
914 |
|
915 if ( KErrNone == aItem.GetNextString(result) ) |
|
916 { |
|
917 if ( result == KTagTrue ) |
|
918 { |
|
919 iResult = ETrue; |
|
920 } |
|
921 else if ( result == KTagFalse ) |
|
922 { |
|
923 iResult = EFalse; |
|
924 } |
|
925 else |
|
926 { |
|
927 iLog->Log(_L("Bad parameter on config file")); |
|
928 err = KErrBadTestParameter; |
|
929 } |
|
930 |
|
931 if ( err == KErrNone ) |
|
932 { |
|
933 TRAP(err, iHarvester->ImportFileL(KFile, this)) |
|
934 if ( err == KErrNone ) |
|
935 { |
|
936 AddExpectedEvent(EEventHandleFileImportCompletedL); |
|
937 } |
|
938 else |
|
939 { |
|
940 iLog->Log(_L("ImportFile returned: %d"), err); |
|
941 } |
|
942 |
|
943 } |
|
944 } |
|
945 } |
|
946 else |
|
947 { |
|
948 iLog->Log(_L("Bad parameter on config file")); |
|
949 err = KErrBadTestParameter; |
|
950 } |
|
951 |
|
952 return err; |
|
953 } |
|
954 |
|
955 // --------------------------------------------------------------------------- |
|
956 // Cmpxharvestertest::RequiredAttributes |
|
957 // ?implementation_description |
|
958 // (other items were commented in a header). |
|
959 // --------------------------------------------------------------------------- |
|
960 // |
|
961 TInt Cmpxharvestertest::RequiredAttributes( CStifItemParser& aItem ) |
|
962 { |
|
963 iLog->Log(_L("Cmpxharvestertest::RequiredAttributes")); |
|
964 TInt err = KErrNone; |
|
965 TPtrC playlistType; |
|
966 if ( KErrNone == aItem.GetNextString(playlistType) ) |
|
967 { |
|
968 TMPXPlaylistType type = EMPXPlaylistTypeUnknown; |
|
969 if ( playlistType == KTagM3U ) |
|
970 { |
|
971 type = EMPXPlaylistTypeM3U; |
|
972 } |
|
973 else if ( playlistType == KTagPLA ) |
|
974 { |
|
975 type = EMPXPlaylistTypePLA; |
|
976 } |
|
977 else if ( playlistType == KTagMPV ) |
|
978 { |
|
979 type = EMPXPlaylistTypeMPV; |
|
980 } |
|
981 else if ( playlistType == KTagXSPF ) |
|
982 { |
|
983 type = EMPXPlaylistTypeXSPF; |
|
984 } |
|
985 else if ( playlistType == KTagXML ) |
|
986 { |
|
987 type = EMPXPlaylistTypeXML; |
|
988 } |
|
989 else |
|
990 { |
|
991 iLog->Log(_L("Bad parameter on config file")); |
|
992 return KErrBadTestParameter; |
|
993 } |
|
994 |
|
995 RArray<TMPXAttribute> att; |
|
996 TRAP(err, iHarvester->RequiredAttributesL(type, att)); |
|
997 if ( err != KErrNone ) |
|
998 { |
|
999 iLog->Log(_L("RequiredAttributesL returned: %d"), err); |
|
1000 } |
|
1001 else |
|
1002 { |
|
1003 TInt count = att.Count(); |
|
1004 iLog->Log(_L("Number of attributes: %d"), count ); |
|
1005 for ( TInt i=0; i < count; i++ ) |
|
1006 { |
|
1007 TMPXAttribute attribute = att[i]; |
|
1008 iLog->Log(_L("AttributeId: %d, ContentId: %d"), attribute.AttributeId(), attribute.ContentId() ); |
|
1009 } |
|
1010 } |
|
1011 att.Reset(); |
|
1012 } |
|
1013 else |
|
1014 { |
|
1015 iLog->Log(_L("Bad parameter on config file")); |
|
1016 err = KErrBadTestParameter; |
|
1017 } |
|
1018 |
|
1019 return err; |
|
1020 } |
|
1021 |
|
1022 // --------------------------------------------------------------------------- |
|
1023 // Cmpxharvestertest::OptionalAttributes |
|
1024 // ?implementation_description |
|
1025 // (other items were commented in a header). |
|
1026 // --------------------------------------------------------------------------- |
|
1027 // |
|
1028 TInt Cmpxharvestertest::OptionalAttributes( CStifItemParser& aItem ) |
|
1029 { |
|
1030 iLog->Log(_L("Cmpxharvestertest::OptionalAttributes")); |
|
1031 TInt err = KErrNone; |
|
1032 TPtrC playlistType; |
|
1033 if ( KErrNone == aItem.GetNextString(playlistType) ) |
|
1034 { |
|
1035 TMPXPlaylistType type = EMPXPlaylistTypeUnknown; |
|
1036 if ( playlistType == KTagM3U ) |
|
1037 { |
|
1038 type = EMPXPlaylistTypeM3U; |
|
1039 } |
|
1040 else if ( playlistType == KTagPLA ) |
|
1041 { |
|
1042 type = EMPXPlaylistTypePLA; |
|
1043 } |
|
1044 else if ( playlistType == KTagMPV ) |
|
1045 { |
|
1046 type = EMPXPlaylistTypeMPV; |
|
1047 } |
|
1048 else if ( playlistType == KTagXSPF ) |
|
1049 { |
|
1050 type = EMPXPlaylistTypeXSPF; |
|
1051 } |
|
1052 else if ( playlistType == KTagXML ) |
|
1053 { |
|
1054 type = EMPXPlaylistTypeXML; |
|
1055 } |
|
1056 else |
|
1057 { |
|
1058 iLog->Log(_L("Bad parameter on config file")); |
|
1059 return KErrBadTestParameter; |
|
1060 } |
|
1061 |
|
1062 RArray<TMPXAttribute> att; |
|
1063 TRAP(err, iHarvester->OptionalAttributesL(type, att)); |
|
1064 if ( err != KErrNone ) |
|
1065 { |
|
1066 iLog->Log(_L("OptionalAttributesL returned: %d"), err); |
|
1067 } |
|
1068 else |
|
1069 { |
|
1070 TInt count = att.Count(); |
|
1071 iLog->Log(_L("Number of attributes: %d"), count ); |
|
1072 for ( TInt i=0; i < count; i++ ) |
|
1073 { |
|
1074 // AK - need to add better checking |
|
1075 TMPXAttribute attribute = att[i]; |
|
1076 iLog->Log(_L("AttributeId: %d, ContentId: %d"), attribute.AttributeId(), attribute.ContentId() ); |
|
1077 } |
|
1078 } |
|
1079 att.Reset(); |
|
1080 } |
|
1081 else |
|
1082 { |
|
1083 iLog->Log(_L("Bad parameter on config file")); |
|
1084 err = KErrBadTestParameter; |
|
1085 } |
|
1086 |
|
1087 return err; |
|
1088 } |
|
1089 |
|
1090 // --------------------------------------------------------------------------- |
|
1091 // Cmpxharvestertest::PlaylistFileExtension |
|
1092 // ?implementation_description |
|
1093 // (other items were commented in a header). |
|
1094 // --------------------------------------------------------------------------- |
|
1095 // |
|
1096 TInt Cmpxharvestertest::PlaylistFileExtension( CStifItemParser& aItem ) |
|
1097 { |
|
1098 iLog->Log(_L("Cmpxharvestertest::PlaylistFileExtension")); |
|
1099 TInt err = KErrNone; |
|
1100 TPtrC playlistType; |
|
1101 if ( KErrNone == aItem.GetNextString(playlistType) ) |
|
1102 { |
|
1103 TMPXPlaylistType type = EMPXPlaylistTypeUnknown; |
|
1104 if ( playlistType == KTagM3U ) |
|
1105 { |
|
1106 type = EMPXPlaylistTypeM3U; |
|
1107 } |
|
1108 else if ( playlistType == KTagPLA ) |
|
1109 { |
|
1110 type = EMPXPlaylistTypePLA; |
|
1111 } |
|
1112 else if ( playlistType == KTagMPV ) |
|
1113 { |
|
1114 type = EMPXPlaylistTypeMPV; |
|
1115 } |
|
1116 else if ( playlistType == KTagXSPF ) |
|
1117 { |
|
1118 type = EMPXPlaylistTypeXSPF; |
|
1119 } |
|
1120 else if ( playlistType == KTagXML ) |
|
1121 { |
|
1122 type = EMPXPlaylistTypeXML; |
|
1123 } |
|
1124 else |
|
1125 { |
|
1126 iLog->Log(_L("Bad parameter on config file")); |
|
1127 return KErrBadTestParameter; |
|
1128 } |
|
1129 |
|
1130 HBufC* ext = iHarvester->PlaylistFileExtensionLC(type); |
|
1131 TPtr extptr = ext->Des(); |
|
1132 iLog->Log(_L("Extension: %S"), &extptr ); |
|
1133 err = !( (type == EMPXPlaylistTypeM3U) && (ext->Des() == _L(".m3u")) ); |
|
1134 iLog->Log(_L("Correct extension error: %d"), err ); |
|
1135 CleanupStack::PopAndDestroy(ext); |
|
1136 } |
|
1137 else |
|
1138 { |
|
1139 iLog->Log(_L("Bad parameter on config file")); |
|
1140 err = KErrBadTestParameter; |
|
1141 } |
|
1142 |
|
1143 return err; |
|
1144 } |
|
1145 |
|
1146 |
|
1147 // --------------------------------------------------------------------------- |
|
1148 // Cmpxharvestertest::IsPlaylist |
|
1149 // ?implementation_description |
|
1150 // (other items were commented in a header). |
|
1151 // --------------------------------------------------------------------------- |
|
1152 // |
|
1153 TInt Cmpxharvestertest::IsPlaylist( CStifItemParser& aItem ) |
|
1154 { |
|
1155 iLog->Log(_L("Cmpxharvestertest::IsPlaylist")); |
|
1156 TInt err = KErrNone; |
|
1157 TPtrC string; |
|
1158 TPtrC test; |
|
1159 if ( KErrNone == aItem.GetNextString(string) ) |
|
1160 { |
|
1161 TBuf<120> KFile; |
|
1162 KFile.Append(Kmpxharvester_digitalPath); |
|
1163 KFile.Append(string); |
|
1164 |
|
1165 if ( KErrNone == aItem.GetNextString(test) ) |
|
1166 { |
|
1167 TBool playlist = EFalse; |
|
1168 TRAP(err, playlist = iHarvester->IsPlaylistL(KFile)) |
|
1169 if ( err != KErrNone ) |
|
1170 { |
|
1171 iLog->Log(_L("IsPlaylist returned: %d"), err); |
|
1172 } |
|
1173 else |
|
1174 { |
|
1175 if ( ((test == KTagTrue) && playlist ) || |
|
1176 ((test == KTagFalse) && !playlist ) ) |
|
1177 { |
|
1178 err = KErrNone; |
|
1179 } |
|
1180 else |
|
1181 { |
|
1182 err = KErrGeneral; |
|
1183 } |
|
1184 } |
|
1185 } |
|
1186 } |
|
1187 else |
|
1188 { |
|
1189 iLog->Log(_L("Bad parameter on config file")); |
|
1190 err = KErrBadTestParameter; |
|
1191 } |
|
1192 |
|
1193 return err; |
|
1194 } |
|
1195 |
|
1196 // --------------------------------------------------------------------------- |
|
1197 // Cmpxharvestertest::CheckForSystemEvents |
|
1198 // ?implementation_description |
|
1199 // (other items were commented in a header). |
|
1200 // --------------------------------------------------------------------------- |
|
1201 // |
|
1202 TInt Cmpxharvestertest::CheckForSystemEvents( CStifItemParser& /*aItem*/ ) |
|
1203 { |
|
1204 iLog->Log(_L("Cmpxharvestertest::CheckForSystemEvents")); |
|
1205 TRAPD(err, iHarvester->CheckForSystemEventsL()); |
|
1206 if ( err != KErrNone ) |
|
1207 { |
|
1208 iLog->Log(_L("CancelScanL returned: %d"), err); |
|
1209 } |
|
1210 return err; |
|
1211 } |
|
1212 |