|
1 /* |
|
2 * Copyright (c) 2002 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: MmfTsPlay class member functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <Stiftestinterface.h> |
|
22 #include "MmfTsPlay.h" |
|
23 #include <MmfMeta.h> |
|
24 |
|
25 // EXTERNAL DATA STRUCTURES |
|
26 //extern ?external_data; |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 //extern ?external_function( ?arg_type,?arg_type ); |
|
30 |
|
31 // CONSTANTS |
|
32 //const ?type ?constant_var = ?constant; |
|
33 |
|
34 // MACROS |
|
35 //#define ?macro ?macro_def |
|
36 |
|
37 // LOCAL CONSTANTS AND MACROS |
|
38 //const ?type ?constant_var = ?constant; |
|
39 //#define ?macro_name ?macro_def |
|
40 |
|
41 // MODULE DATA STRUCTURES |
|
42 //enum ?declaration |
|
43 //typedef ?declaration |
|
44 |
|
45 // LOCAL FUNCTION PROTOTYPES |
|
46 //?type ?function_name( ?arg_type, ?arg_type ); |
|
47 |
|
48 // FORWARD DECLARATIONS |
|
49 //class ?FORWARD_CLASSNAME; |
|
50 |
|
51 // ============================= LOCAL FUNCTIONS =============================== |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // ?function_name ?description. |
|
55 // ?description |
|
56 // Returns: ?value_1: ?description |
|
57 // ?value_n: ?description_line1 |
|
58 // ?description_line2 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 /* |
|
62 ?type ?function_name( |
|
63 ?arg_type arg, // ?description |
|
64 ?arg_type arg) // ?description |
|
65 { |
|
66 |
|
67 ?code // ?comment |
|
68 |
|
69 // ?comment |
|
70 ?code |
|
71 } |
|
72 */ |
|
73 |
|
74 // ============================ MEMBER FUNCTIONS =============================== |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CMmfTsPlay::CMmfTsPlay |
|
78 // C++ default constructor can NOT contain any code, that |
|
79 // might leave. |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 CMmfTsPlay::CMmfTsPlay() |
|
83 { |
|
84 |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CMmfTsPlay::ConstructL |
|
89 // Symbian 2nd phase constructor can leave. |
|
90 // Note: If OOM test case uses STIF Logger, then STIF Logger must be created |
|
91 // with static buffer size parameter (aStaticBufferSize). Otherwise Logger |
|
92 // allocates memory from heap and therefore causes error situations with OOM |
|
93 // testing. For more information about STIF Logger construction, see STIF Users |
|
94 // Guide. |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 /*void CMmfTsPlay::ConstructL() |
|
98 { |
|
99 iLog = CStifLogger::NewL( KMmfTsPlayLogPath, |
|
100 KMmfTsPlayLogFile); |
|
101 }*/ |
|
102 |
|
103 void CMmfTsPlay::ConstructL() |
|
104 { |
|
105 if ( ! iScheduler) |
|
106 { |
|
107 iScheduler = new (ELeave) CActiveScheduler; |
|
108 CActiveScheduler::Install(iScheduler); // install as active scheduler |
|
109 } |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CMmfTsPlay::NewL |
|
114 // Two-phased constructor. |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 CMmfTsPlay* CMmfTsPlay::NewL() |
|
118 { |
|
119 CMmfTsPlay* self = new (ELeave) CMmfTsPlay; |
|
120 |
|
121 CleanupStack::PushL( self ); |
|
122 self->ConstructL(); |
|
123 CleanupStack::Pop(); |
|
124 |
|
125 return self; |
|
126 |
|
127 } |
|
128 |
|
129 // Destructor |
|
130 CMmfTsPlay::~CMmfTsPlay() |
|
131 { |
|
132 // delete iLog; |
|
133 delete iScheduler; |
|
134 delete iLogger; |
|
135 } |
|
136 |
|
137 /*------------------------------------------------------------------------------- |
|
138 |
|
139 Class: CMmfTsPlay |
|
140 |
|
141 Method: InitL |
|
142 Description: Initialization function. |
|
143 Init is used to initialize the Test Module. |
|
144 Parameters: TName& aIniFile: in: Filename: |
|
145 Configuration file for the test module |
|
146 |
|
147 Return Values: KErrNone: No error |
|
148 <value_1: Description |
|
149 value_n: Description line 1 |
|
150 description line 2> |
|
151 |
|
152 Errors/Exceptions: None |
|
153 Status: Draft |
|
154 |
|
155 ------------------------------------------------------------------------------- */ |
|
156 TInt CMmfTsPlay::InitL( TFileName& aIniFile , TBool /*aFirstTime*/ ) |
|
157 { |
|
158 CStifParser *parser; |
|
159 RDebug::Print(_L("CMmfTsPlay::InitL:")); |
|
160 TParsePtrC fp(aIniFile); |
|
161 //fp.Set(); |
|
162 parser = CStifParser::NewL(fp.DriveAndPath() , fp.NameAndExt() ); |
|
163 CleanupStack::PushL(parser); |
|
164 |
|
165 if (parser) |
|
166 { |
|
167 RDebug::Print(_L("CMmfTsPlay::InitL: parser is not null")); |
|
168 CStifSectionParser *section; |
|
169 |
|
170 section = parser->SectionL(KSectionStart, KSectionEnd); |
|
171 CleanupStack::PushL(section); |
|
172 TPtrC logFileName; |
|
173 TPtrC logPath; |
|
174 if (section) |
|
175 { |
|
176 RDebug::Print(_L("CMmfTsPlay::InitL: section is not null")); |
|
177 |
|
178 |
|
179 if ( (section->GetLine(KLogFileTag, logFileName, ENoTag) == KErrNone) && (section->GetLine(KLogPathTag, logPath, ENoTag) == KErrNone) ) |
|
180 { |
|
181 RDebug::Print(_L("CMmfTsPlay::InitL: InitLoggerL(logPath, logFileName);")); |
|
182 InitLoggerL(logPath, logFileName); |
|
183 } |
|
184 } |
|
185 if (!iLogger) |
|
186 { |
|
187 RDebug::Print(_L("CMmfTsPlay::InitL: InitLoggerL(); again")); |
|
188 InitLoggerL(); |
|
189 } |
|
190 iLogger->Log(KOpeningLogFilepath, &logPath); |
|
191 iLogger->Log(KLoggerStarted, &aIniFile); |
|
192 CleanupStack::PopAndDestroy(section); //section |
|
193 } |
|
194 |
|
195 CleanupStack::PopAndDestroy(parser); //parser |
|
196 |
|
197 // Binh |
|
198 iMetaDataFieldName[EUnknownMetaDataField] = _L("Unknown"); |
|
199 iMetaDataFieldName[EMetaDataSongTitle] = KMMFMetaEntrySongTitle; |
|
200 iMetaDataFieldName[EMetaDataArtist] = KMMFMetaEntryArtist; |
|
201 iMetaDataFieldName[EMetaDataAlbum] = KMMFMetaEntryAlbum; |
|
202 iMetaDataFieldName[EMetaDataYear] = KMMFMetaEntryYear; |
|
203 iMetaDataFieldName[EMetaDataComment] = KMMFMetaEntryComment; |
|
204 iMetaDataFieldName[EMetaDataAlbumTrack] = KMMFMetaEntryAlbumTrack; |
|
205 iMetaDataFieldName[EMetaDataGenre] = KMMFMetaEntryGenre; |
|
206 iMetaDataFieldName[EMetaDataComposer] = KMMFMetaEntryComposer; |
|
207 iMetaDataFieldName[EMetaDataCopyright] = KMMFMetaEntryCopyright; |
|
208 iMetaDataFieldName[EMetaDataOriginalArtist] = KMMFMetaEntryOriginalArtist; |
|
209 iMetaDataFieldName[EMetaDataUrl] = KMMFMetaEntryWOAF; |
|
210 iMetaDataFieldName[EMetaDataUserUrl] = KMMFMetaEntryWXXX; |
|
211 iMetaDataFieldName[EMetaDataJpeg] = KMMFMetaEntryAPIC; |
|
212 iMetaDataFieldName[EMetaDataVendor] = KMMFMetaEntryVendorID; |
|
213 iMetaDataFieldName[EMetaDataRating] = _L("Rating"); |
|
214 iMetaDataFieldName[EMetaDataUniqueFileIdentifier] = _L("UniqueFileID"); |
|
215 iMetaDataFieldName[EMetaDataDuration] = _L("Duration"); |
|
216 iMetaDataFieldName[EMetaDataDate] = _L("Date"); |
|
217 |
|
218 iMetaDataFieldID[EUnknownMetaDataField] = EUnknownMetaDataField; |
|
219 iMetaDataFieldID[EMetaDataSongTitle] = EMetaDataSongTitle; |
|
220 iMetaDataFieldID[EMetaDataArtist] = EMetaDataArtist; |
|
221 iMetaDataFieldID[EMetaDataAlbum] = EMetaDataAlbum; |
|
222 iMetaDataFieldID[EMetaDataYear] = EMetaDataYear; |
|
223 iMetaDataFieldID[EMetaDataComment] = EMetaDataComment; |
|
224 iMetaDataFieldID[EMetaDataAlbumTrack] = EMetaDataAlbumTrack, |
|
225 iMetaDataFieldID[EMetaDataGenre] = EMetaDataGenre; |
|
226 iMetaDataFieldID[EMetaDataComposer] = EMetaDataComposer; |
|
227 iMetaDataFieldID[EMetaDataCopyright] = EMetaDataCopyright; |
|
228 iMetaDataFieldID[EMetaDataOriginalArtist] = EMetaDataOriginalArtist; |
|
229 iMetaDataFieldID[EMetaDataUrl] = EMetaDataUrl; |
|
230 iMetaDataFieldID[EMetaDataUserUrl] = EMetaDataUserUrl; |
|
231 iMetaDataFieldID[EMetaDataJpeg] = EMetaDataJpeg; |
|
232 iMetaDataFieldID[EMetaDataVendor] = EMetaDataVendor; |
|
233 iMetaDataFieldID[EMetaDataRating] = EMetaDataRating; |
|
234 iMetaDataFieldID[EMetaDataUniqueFileIdentifier] = EMetaDataUniqueFileIdentifier; |
|
235 iMetaDataFieldID[EMetaDataDuration] = EMetaDataDuration; |
|
236 iMetaDataFieldID[EMetaDataDate] = EMetaDataDate; |
|
237 |
|
238 return KErrNone; |
|
239 } |
|
240 |
|
241 /* ------------------------------------------------------------------------------- |
|
242 |
|
243 Class: CMmfTsPlay |
|
244 Method: InitLoggerL |
|
245 Description: Initialize the logger for this test module |
|
246 Parameters: File name where to append data |
|
247 Return Values: Error value |
|
248 Errors/Exceptions: <description how errors and exceptions are handled> |
|
249 Status: Draft |
|
250 |
|
251 ------------------------------------------------------------------------------- */ |
|
252 void CMmfTsPlay::InitLoggerL( const TFileName& aLogPath , const TFileName& aLogFile) |
|
253 { |
|
254 //iLogger = CStifLogger::NewL(aLogPath, aLogFile, ETxt, EFile, EFalse); //, ETrue, ETrue, ETrue, ETrue, EFalse); |
|
255 iLogger = CStifLogger::NewL(aLogPath, aLogFile, CStifLogger::ETxt, CStifLogger::EFile, EFalse) ; |
|
256 if ( ! iLogger ) |
|
257 { |
|
258 RDebug::Print(_L("CMmfTsPlay::InitL: InitLoggerL(); with filename failed")); |
|
259 InitLoggerL(); |
|
260 } |
|
261 } |
|
262 |
|
263 void CMmfTsPlay::InitLoggerL() |
|
264 { |
|
265 RDebug::Print(_L("CMmfTsPlay::InitL: InitLoggerL(); with default")); |
|
266 iLogger = CStifLogger::NewL(KDefLogPath, KDefLogFile, CStifLogger::ETxt, CStifLogger::EFile, EFalse); |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CMmfTsPlay::GetTestCasesL |
|
271 // GetTestCases is used to inquire test cases from the Test Module. Test |
|
272 // cases are stored to array of test cases. The Test Framework will be |
|
273 // the owner of the data in the RPointerArray after GetTestCases return |
|
274 // and it does the memory deallocation. |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 TInt CMmfTsPlay::GetTestCasesL( |
|
278 const TFileName& aConfig, |
|
279 RPointerArray<TTestCaseInfo>& aTestCases ) |
|
280 { |
|
281 |
|
282 //Get a parser for the config file |
|
283 iLogger->Log(KOpeningConfig, &aConfig); |
|
284 |
|
285 if (! aConfig.Length() ) { |
|
286 iLogger->Log(KConfigRequired() ); |
|
287 return KErrConfigInvalid; |
|
288 } |
|
289 |
|
290 TParsePtrC fp(aConfig); |
|
291 CStifParser *parser = CStifParser::NewL(fp.DriveAndPath() , fp.NameAndExt() ); |
|
292 CleanupStack::PushL(parser); |
|
293 |
|
294 //Get a section parser |
|
295 CStifSectionParser *section; |
|
296 TInt x = 0; |
|
297 |
|
298 //Read all cases in config file |
|
299 //while ( section = parser->SectionL(KTestCaseConfigStart , KTestCaseConfigEnd, x++) ) |
|
300 |
|
301 while ( (section = parser->NextSectionL(KTestCaseConfigStart , KTestCaseConfigEnd) ),section ) // use comma to avoid warning |
|
302 { |
|
303 CleanupStack::PushL(section); |
|
304 TInt id = -1; |
|
305 TPtrC TestCaseTitle; |
|
306 TInt ErrorResult = KErrNone; |
|
307 |
|
308 CStifItemParser *item; |
|
309 item = section->GetItemLineL(KTagId); |
|
310 if (item) |
|
311 { |
|
312 CleanupStack::PushL(item); |
|
313 |
|
314 if (!item->GetInt(KTagId, id)) |
|
315 { |
|
316 ErrorResult = section->GetLine(KTagTitle, TestCaseTitle, ENoTag); |
|
317 if (!ErrorResult) {iLogger->Log( _L("Adding case: (%d) %S") , id, &TestCaseTitle ); } |
|
318 } |
|
319 else |
|
320 { |
|
321 id = -1; |
|
322 } |
|
323 CleanupStack::PopAndDestroy(item); //item |
|
324 } |
|
325 |
|
326 //leer el id del test case |
|
327 //leer el titulo del caso |
|
328 //si es valido el id entonces crear el caso |
|
329 if (0 < id && id <= MAX_TESTCASE_ID) |
|
330 { |
|
331 TTestCaseInfo* testCase = new (ELeave) TTestCaseInfo(); |
|
332 CleanupStack::PushL(testCase); |
|
333 testCase->iCaseNumber = ++x; |
|
334 iLogger->Log(_L("CaseNumber: (%d)"), testCase->iCaseNumber); |
|
335 testCase->iTitle.Format(KTestCaseTitleFormat, id, &TestCaseTitle); //testCase->iTitle.Copy( KTestCaseTitleFormat() ); |
|
336 |
|
337 User::LeaveIfError( aTestCases.Append( testCase ) ); |
|
338 |
|
339 CleanupStack::Pop( testCase ); //testCase |
|
340 } |
|
341 |
|
342 CleanupStack::PopAndDestroy(section); //section |
|
343 } |
|
344 |
|
345 CleanupStack::PopAndDestroy(parser); //parser |
|
346 |
|
347 return KErrNone; |
|
348 |
|
349 } |
|
350 |
|
351 // ----------------------------------------------------------------------------- |
|
352 // CMmfTsPlay::RunTestCaseL |
|
353 // RunTestCaseL is used to run an individual test case specified |
|
354 // by aTestCase. Test cases that can be run may be requested from |
|
355 // Test Module by GetTestCases method before calling RunTestCase. |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 TInt CMmfTsPlay::RunTestCaseL( const TInt aCaseNumber , const TFileName& aConfig , TTestResult& aResult ) |
|
359 { |
|
360 TInt id=-1; |
|
361 |
|
362 //Get a parser for the config file |
|
363 iLogger->Log(KOpeningConfig, &aConfig); |
|
364 |
|
365 if (! aConfig.Length() ) { |
|
366 iLogger->Log(KConfigRequired() ); |
|
367 aResult.iResultDes.Copy(KConfigRequired()); |
|
368 aResult.iResult = KErrNotExecuted; |
|
369 return KErrConfigInvalid; |
|
370 } |
|
371 |
|
372 TParsePtrC fp(aConfig); |
|
373 iLogger->Log(_L("Opening configuration file [%S], case #%d"), &aConfig, |
|
374 aCaseNumber); |
|
375 CStifParser *parser; |
|
376 TRAPD(error, parser = CStifParser::NewL(fp.DriveAndPath() , fp.NameAndExt() )); |
|
377 iLogger->Log(_L("CStifParser::NewL [%d] \n"), error); |
|
378 if (error == KErrNone) |
|
379 { |
|
380 CleanupStack::PushL(parser); |
|
381 } |
|
382 |
|
383 //Get a section parser |
|
384 TInt retVal = 0; |
|
385 CStifSectionParser *section = 0; |
|
386 CStifItemParser *item = 0; |
|
387 section = parser->NextSectionL(KTestCaseConfigStart, KTestCaseConfigEnd, |
|
388 aCaseNumber); |
|
389 |
|
390 if (section) |
|
391 { |
|
392 CleanupStack::PushL(section); |
|
393 item = section->GetItemLineL(KTagId); |
|
394 |
|
395 if (item) { |
|
396 CleanupStack::PushL(item); |
|
397 |
|
398 if (!item->GetInt(KTagId, id)) { |
|
399 TPtrC TestCaseTitle; |
|
400 |
|
401 TInt TitleErrorResult = section->GetLine(KTagTitle, TestCaseTitle, ENoTag); |
|
402 if (!TitleErrorResult) {iLogger->Log( _L("Executing test case (%d) %S") , id, &TestCaseTitle ); } |
|
403 |
|
404 //Call Funtion to perform test |
|
405 __UHEAP_MARK; |
|
406 TRAPD(error, retVal = RunTestCaseFunctionL(id, section, aResult);); |
|
407 REComSession::FinalClose(); |
|
408 __UHEAP_MARKEND; |
|
409 |
|
410 if (error) |
|
411 { |
|
412 retVal = KErrLeft; |
|
413 aResult.iResult=error; |
|
414 aResult.iResultDes.Copy( KTestCaseResultLeft() ); |
|
415 } |
|
416 |
|
417 iLogger->Log( _L("Finished Executing test case (%d)"), id); |
|
418 iLogger->Log( _L(" Error code (%d)"), retVal); |
|
419 iLogger->Log( _L(" aResult.iResult=(%d)") , aResult.iResult); |
|
420 iLogger->Log( _L(" aResult.iResultDes=(%S)\r\n") , &aResult.iResultDes); |
|
421 |
|
422 } else { |
|
423 id=-1; |
|
424 } |
|
425 CleanupStack::PopAndDestroy(item); |
|
426 } |
|
427 CleanupStack::PopAndDestroy(section); |
|
428 } |
|
429 CleanupStack::PopAndDestroy(parser); |
|
430 |
|
431 if (-1!=id) |
|
432 { |
|
433 return retVal; |
|
434 } |
|
435 iLogger->Log(KConfigInvalid() ); |
|
436 aResult.iResultDes.Copy(KConfigInvalid()); |
|
437 aResult.iResult = KErrNotFound; |
|
438 return KErrNotFound; |
|
439 } |
|
440 |
|
441 // End of File |
|
442 // ----------------------------------------------------------------------------- |
|
443 // CNormalEx::OOMTestQueryL |
|
444 // Used to check if a particular test case should be run in OOM conditions and |
|
445 // which memory allocations should fail. |
|
446 // |
|
447 // NOTE: This method is virtual and must be implemented only if test case |
|
448 // should be executed using OOM conditions. |
|
449 // ----------------------------------------------------------------------------- |
|
450 // |
|
451 TBool CMmfTsPlay::OOMTestQueryL( |
|
452 const TFileName& /* aTestCaseFile */, |
|
453 const TInt /* aCaseNumber */, |
|
454 TOOMFailureType& /* aFailureType */, |
|
455 TInt& /* aFirstMemFailure */, |
|
456 TInt& /* aLastMemFailure */ ) |
|
457 { |
|
458 _LIT( KOOMTestQueryL, "CMmfTsPlay::OOMTestQueryL" ); |
|
459 iLogger->Log( KOOMTestQueryL ); |
|
460 |
|
461 return EFalse; |
|
462 |
|
463 } |
|
464 |
|
465 // ----------------------------------------------------------------------------- |
|
466 // CMmfTsPlay::OOMTestInitializeL |
|
467 // Used to perform the test environment setup for a particular OOM test case. |
|
468 // Test Modules may use the initialization file to read parameters for Test |
|
469 // Module initialization but they can also have their own configure file or |
|
470 // some other routine to initialize themselves. |
|
471 // |
|
472 // NOTE: This method is virtual and must be implemented only if test case |
|
473 // should be executed using OOM conditions. |
|
474 // ----------------------------------------------------------------------------- |
|
475 // |
|
476 void CMmfTsPlay::OOMTestInitializeL( |
|
477 const TFileName& /* aTestCaseFile */, |
|
478 const TInt /* aCaseNumber */ ) |
|
479 { |
|
480 } |
|
481 |
|
482 // ----------------------------------------------------------------------------- |
|
483 // CMmfTsPlay::OOMHandleWarningL |
|
484 // In some cases the heap memory allocation should be skipped, either due to |
|
485 // problems in the OS code or components used by the code being tested, or even |
|
486 // inside the tested components which are implemented this way on purpose (by |
|
487 // design), so it is important to give the tester a way to bypass allocation |
|
488 // failures. |
|
489 // |
|
490 // NOTE: This method is virtual and must be implemented only if test case |
|
491 // should be executed using OOM conditions. |
|
492 // ----------------------------------------------------------------------------- |
|
493 // |
|
494 void CMmfTsPlay::OOMHandleWarningL( |
|
495 const TFileName& /* aTestCaseFile */, |
|
496 const TInt /* aCaseNumber */, |
|
497 TInt& /* aFailNextValue */ ) |
|
498 { |
|
499 } |
|
500 |
|
501 // ----------------------------------------------------------------------------- |
|
502 // CMmfTsPlay::OOMTestFinalizeL |
|
503 // Used to perform the test environment cleanup for a particular OOM test case. |
|
504 // |
|
505 // NOTE: This method is virtual and must be implemented only if test case |
|
506 // should be executed using OOM conditions. |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 void CMmfTsPlay::OOMTestFinalizeL( |
|
510 const TFileName& /* aTestCaseFile */, |
|
511 const TInt /* aCaseNumber */ ) |
|
512 { |
|
513 } |
|
514 |
|
515 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
516 |
|
517 // ----------------------------------------------------------------------------- |
|
518 // LibEntryL is a polymorphic Dll entry point |
|
519 // Returns: CTestModuleBase*: Pointer to Test Module object |
|
520 // ----------------------------------------------------------------------------- |
|
521 // |
|
522 EXPORT_C CTestModuleBase* LibEntryL() |
|
523 { |
|
524 return CMmfTsPlay::NewL(); |
|
525 |
|
526 } |
|
527 |
|
528 // ----------------------------------------------------------------------------- |
|
529 // SetRequirements handles test module parameters(implements evolution |
|
530 // version 1 for test module's heap and stack sizes configuring). |
|
531 // Returns: TInt: Symbian error code. |
|
532 // ----------------------------------------------------------------------------- |
|
533 // |
|
534 EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, |
|
535 TUint32& /*aParameterValid*/ ) |
|
536 { |
|
537 |
|
538 /* --------------------------------- NOTE --------------------------------- |
|
539 USER PANICS occurs in test thread creation when: |
|
540 1) "The panic occurs when the value of the stack size is negative." |
|
541 2) "The panic occurs if the minimum heap size specified is less |
|
542 than KMinHeapSize". |
|
543 KMinHeapSize: "Functions that require a new heap to be allocated will |
|
544 either panic, or will reset the required heap size to this value if |
|
545 a smaller heap size is specified". |
|
546 3) "The panic occurs if the minimum heap size specified is greater than |
|
547 the maximum size to which the heap can grow". |
|
548 Other: |
|
549 1) Make sure that your hardware or Symbian OS is supporting given sizes. |
|
550 e.g. Hardware might support only sizes that are divisible by four. |
|
551 ------------------------------- NOTE end ------------------------------- */ |
|
552 |
|
553 // Normally STIF uses default heap and stack sizes for test thread, see: |
|
554 // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize. |
|
555 // If needed heap and stack sizes can be configured here by user. Remove |
|
556 // comments and define sizes. |
|
557 |
|
558 /* |
|
559 aParameterValid = KStifTestModuleParameterChanged; |
|
560 |
|
561 CTestModuleParamVer01* param = CTestModuleParamVer01::NewL(); |
|
562 // Stack size |
|
563 param->iTestThreadStackSize= 16384; // 16K stack |
|
564 // Heap sizes |
|
565 param->iTestThreadMinHeap = 4096; // 4K heap min |
|
566 param->iTestThreadMaxHeap = 1048576;// 1M heap max |
|
567 |
|
568 aTestModuleParam = param; |
|
569 */ |
|
570 return KErrNone; |
|
571 |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // E32Dll is a DLL entry point function |
|
576 // Returns: KErrNone: No error |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 #ifndef EKA2 // Hide Dll entry point to EKA2 |
|
580 GLDEF_C TInt E32Dll( |
|
581 TDllReason /*aReason*/) // Reason |
|
582 { |
|
583 return(KErrNone); |
|
584 |
|
585 } |
|
586 #endif // EKA2 |
|
587 |
|
588 // End of File |