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 module contains implementation of |
|
15 * CStartedTestCase class member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32base.h> |
|
21 #include <e32svr.h> |
|
22 |
|
23 #include <stifinternal/UIEngine.h> |
|
24 #include <stifinternal/UIEngineContainer.h> |
|
25 #include <stifinternal/UIStoreContainer.h> |
|
26 #include <stifinternal/UIStore.h> |
|
27 |
|
28 #include "Logging.h" |
|
29 |
|
30 |
|
31 // EXTERNAL DATA STRUCTURES |
|
32 |
|
33 // EXTERNAL FUNCTION PROTOTYPES |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 // MACROS |
|
38 #ifdef LOGGER |
|
39 #undef LOGGER |
|
40 #endif |
|
41 _LIT( KStartedTestCase, "CStartedTestCase" ); |
|
42 _LIT( KStartedTestSet, "CStartedTestSet" ); |
|
43 |
|
44 |
|
45 // LOCAL CONSTANTS AND MACROS |
|
46 |
|
47 // MODULE DATA STRUCTURES |
|
48 |
|
49 // LOCAL FUNCTION PROTOTYPES |
|
50 |
|
51 // FORWARD DECLARATIONS |
|
52 |
|
53 // ==================== LOCAL FUNCTIONS ======================================= |
|
54 |
|
55 // None |
|
56 |
|
57 // ================= MEMBER FUNCTIONS ========================================= |
|
58 |
|
59 /* |
|
60 ------------------------------------------------------------------------------- |
|
61 |
|
62 Class: CStartedTestCase |
|
63 |
|
64 Method: NewL |
|
65 |
|
66 Description: Create a testcase container. |
|
67 |
|
68 Parameters: CTestInfo* aTestInfo: in: Test case info |
|
69 CUIEngineContainer* aContainer: in: container |
|
70 |
|
71 Return Values: CStartedTestCase* : pointer to created object |
|
72 |
|
73 Errors/Exceptions: Leaves if memory allocation for object fails |
|
74 Leaves if ConstructL leaves |
|
75 |
|
76 Status: Draft |
|
77 |
|
78 ------------------------------------------------------------------------------- |
|
79 */ |
|
80 CStartedTestCase* CStartedTestCase::NewL( const CTestInfo& aTestInfo, |
|
81 CUIEngineContainer& aContainer ) |
|
82 { |
|
83 |
|
84 CStartedTestCase* self = new ( ELeave ) CStartedTestCase( aContainer ); |
|
85 CleanupStack::PushL( self ); |
|
86 self->ConstructL( aTestInfo ); |
|
87 CleanupStack::Pop( self ); |
|
88 return self; |
|
89 |
|
90 } |
|
91 |
|
92 /* |
|
93 ------------------------------------------------------------------------------- |
|
94 |
|
95 Class: CStartedTestCase |
|
96 |
|
97 Method: ConstructL |
|
98 |
|
99 Description: Second level constructor. |
|
100 |
|
101 Parameters: CTestInfo* aTestInfo: Test case info |
|
102 |
|
103 Return Values: None |
|
104 |
|
105 Errors/Exceptions: Leaves if CTestInfo copying fails |
|
106 |
|
107 Status: Draft |
|
108 |
|
109 ------------------------------------------------------------------------------- |
|
110 */ |
|
111 void CStartedTestCase::ConstructL( const CTestInfo& aTestInfo ) |
|
112 { |
|
113 |
|
114 iTestInfo = CTestInfo::NewL(); |
|
115 iTestInfo->CopyL( aTestInfo ); |
|
116 |
|
117 } |
|
118 |
|
119 /* |
|
120 ------------------------------------------------------------------------------- |
|
121 |
|
122 Class: CStartedTestCase |
|
123 |
|
124 Method: CStartedTestCase |
|
125 |
|
126 Description: Constructor |
|
127 |
|
128 Parameters: None |
|
129 |
|
130 Return Values: None |
|
131 |
|
132 Errors/Exceptions: None |
|
133 |
|
134 Status: Draft |
|
135 |
|
136 ------------------------------------------------------------------------------- |
|
137 */ |
|
138 CStartedTestCase::CStartedTestCase( CUIEngineContainer& aContainer ): |
|
139 iContainer( &aContainer ), |
|
140 iStatus( CUIStoreIf::EStatusRunning ) |
|
141 { |
|
142 |
|
143 } |
|
144 |
|
145 /* |
|
146 ------------------------------------------------------------------------------- |
|
147 |
|
148 Class: CStartedTestCase |
|
149 |
|
150 Method: CStartedTestCase |
|
151 |
|
152 Description: Private Constructor for internal use |
|
153 |
|
154 Parameters: CTestInfo* aTestInfo: in: new testinfo |
|
155 |
|
156 Return Values: None |
|
157 |
|
158 Errors/Exceptions: None |
|
159 |
|
160 Status: Draft |
|
161 |
|
162 ------------------------------------------------------------------------------- |
|
163 */ |
|
164 CStartedTestCase::CStartedTestCase( CTestInfo* aTestInfo, |
|
165 TFullTestResult aResult, |
|
166 TInt aStatus ): |
|
167 iContainer( 0 ), |
|
168 iTestInfo( aTestInfo ), |
|
169 iResult( aResult ), |
|
170 iStatus( aStatus ) |
|
171 { |
|
172 |
|
173 } |
|
174 |
|
175 /* |
|
176 ------------------------------------------------------------------------------- |
|
177 |
|
178 Class: CStartedTestCase |
|
179 |
|
180 Method: ~CStartedTestCase |
|
181 |
|
182 Description: Destructor. |
|
183 |
|
184 Cancels the asynchronous request, deallocate memory and closes the testcase. |
|
185 |
|
186 Parameters: None |
|
187 |
|
188 Return Values: None |
|
189 |
|
190 Errors/Exceptions: None |
|
191 |
|
192 Status: Draft |
|
193 |
|
194 ------------------------------------------------------------------------------- |
|
195 */ |
|
196 CStartedTestCase::~CStartedTestCase() |
|
197 { |
|
198 |
|
199 delete iTestInfo; |
|
200 iPrints.ResetAndDestroy(); |
|
201 iPrints.Close(); |
|
202 |
|
203 } |
|
204 |
|
205 /* |
|
206 ------------------------------------------------------------------------------- |
|
207 |
|
208 Class: CStartedTestCase |
|
209 |
|
210 Method: SetResult |
|
211 |
|
212 Description: Set the result |
|
213 |
|
214 Parameters: const TFullTestResult& :in: Result |
|
215 |
|
216 Return Values: None |
|
217 |
|
218 Errors/Exceptions: None |
|
219 |
|
220 Status: Draft |
|
221 |
|
222 ------------------------------------------------------------------------------- |
|
223 */ |
|
224 void CStartedTestCase::SetResult(const TFullTestResult& aResult) |
|
225 { |
|
226 |
|
227 iResult = aResult; |
|
228 |
|
229 iStatus = CUIStoreIf::EStatusExecuted; |
|
230 |
|
231 switch( aResult.iCaseExecutionResultType ) |
|
232 { |
|
233 case TFullTestResult::ECaseExecuted: |
|
234 if( aResult.iTestResult.iResult == KErrNone ) |
|
235 { |
|
236 iStatus |= CUIStoreIf::EStatusPassed; |
|
237 } |
|
238 else |
|
239 { |
|
240 iStatus |= CUIStoreIf::EStatusFailed; |
|
241 } |
|
242 break; |
|
243 case TFullTestResult::ECaseCancelled: |
|
244 case TFullTestResult::ECaseTimeout: |
|
245 case TFullTestResult::ECaseSuicided: |
|
246 iStatus |= CUIStoreIf::EStatusAborted; |
|
247 break; |
|
248 default: |
|
249 iStatus |= CUIStoreIf::EStatusCrashed; |
|
250 break; |
|
251 } |
|
252 } |
|
253 |
|
254 /* |
|
255 ------------------------------------------------------------------------------- |
|
256 |
|
257 Class: CStartedTestCase |
|
258 |
|
259 Method: UIEngineContainer |
|
260 |
|
261 Description: Returns the UIEngineContainer |
|
262 |
|
263 Parameters: None |
|
264 |
|
265 Return Values: CUIEngineContainer& |
|
266 |
|
267 Errors/Exceptions: Panics if called for testcase that is not running |
|
268 |
|
269 Status: Draft |
|
270 |
|
271 ------------------------------------------------------------------------------- |
|
272 */ |
|
273 EXPORT_C CUIEngineContainer& CStartedTestCase::UIEngineContainer() const |
|
274 { |
|
275 |
|
276 if( !( iStatus & CUIStoreIf::EStatusRunning ) ) |
|
277 { |
|
278 __RDEBUG( _L("CStartedTestCase::UIEngineContainer for test case that is not running")); |
|
279 User::Panic( KStartedTestCase, KErrNotFound ); |
|
280 } |
|
281 |
|
282 return *iContainer; |
|
283 |
|
284 } |
|
285 |
|
286 /* |
|
287 ------------------------------------------------------------------------------- |
|
288 |
|
289 DESCRIPTION |
|
290 |
|
291 This module contains implementation of CStartedTestSet class |
|
292 member functions. |
|
293 |
|
294 ------------------------------------------------------------------------------- |
|
295 */ |
|
296 |
|
297 // ================= MEMBER FUNCTIONS ========================================= |
|
298 |
|
299 /* |
|
300 ------------------------------------------------------------------------------- |
|
301 |
|
302 Class: CStartedTestSet |
|
303 |
|
304 Method: NewL |
|
305 |
|
306 Description: Create a testcase container. |
|
307 |
|
308 Parameters: const CTestSetInfo& aTestSetInfo: in: test set info |
|
309 CUIStore::TSetType aType: in: set type |
|
310 |
|
311 Return Values: CStartedTestSet* : pointer to created object |
|
312 |
|
313 Errors/Exceptions: Leaves if memory allocation for object fails |
|
314 Leaves if ConstructL leaves |
|
315 |
|
316 Status: Draft |
|
317 |
|
318 ------------------------------------------------------------------------------- |
|
319 */ |
|
320 CStartedTestSet* CStartedTestSet::NewL( CUIStore* aUIStore, |
|
321 const CTestSetInfo& aTestSetInfo, |
|
322 TSetType aType ) |
|
323 { |
|
324 |
|
325 CStartedTestSet* self = new ( ELeave ) CStartedTestSet( aUIStore, aType ); |
|
326 CleanupStack::PushL( self ); |
|
327 self->ConstructL( aTestSetInfo ); |
|
328 CleanupStack::Pop( self ); |
|
329 return self; |
|
330 |
|
331 } |
|
332 |
|
333 /* |
|
334 ------------------------------------------------------------------------------- |
|
335 |
|
336 Class: CStartedTestSet |
|
337 |
|
338 Method: ConstructL |
|
339 |
|
340 Description: Second level constructor. |
|
341 |
|
342 Parameters: const CTestSetInfo& aTestSetInfo: in: Test set info |
|
343 |
|
344 Return Values: None |
|
345 |
|
346 Errors/Exceptions: Leaves if CTestSetInfo copying fails |
|
347 |
|
348 Status: Draft |
|
349 |
|
350 ------------------------------------------------------------------------------- |
|
351 */ |
|
352 void CStartedTestSet::ConstructL( const CTestSetInfo& aTestSetInfo ) |
|
353 { |
|
354 |
|
355 iTestSetInfo = CTestSetInfo::NewL( aTestSetInfo.Name() ); |
|
356 iTestSetInfo->CopyL( aTestSetInfo ); |
|
357 |
|
358 iOriginalTestSet = const_cast<CTestSetInfo*>(&aTestSetInfo); |
|
359 } |
|
360 |
|
361 /* |
|
362 ------------------------------------------------------------------------------- |
|
363 |
|
364 Class: CStartedTestSet |
|
365 |
|
366 Method: CStartedTestSet |
|
367 |
|
368 Description: Constructor |
|
369 |
|
370 Parameters: CUIStore::TSetType aType: in: set type |
|
371 |
|
372 Return Values: None |
|
373 |
|
374 Errors/Exceptions: None |
|
375 |
|
376 Status: Draft |
|
377 |
|
378 ------------------------------------------------------------------------------- |
|
379 */ |
|
380 CStartedTestSet::CStartedTestSet( CUIStore* aUIStore, |
|
381 TSetType aType ): |
|
382 iUIStore( aUIStore ), |
|
383 iResultSet( EFalse ), |
|
384 iType( aType ), |
|
385 iStatus( CUIStoreIf::ESetRunning ), |
|
386 iNext( 0 ), |
|
387 iRunningCases( 0 ), |
|
388 iOriginalTestSet ( NULL ) |
|
389 { |
|
390 |
|
391 } |
|
392 |
|
393 /* |
|
394 ------------------------------------------------------------------------------- |
|
395 |
|
396 Class: CStartedTestSet |
|
397 |
|
398 Method: ~CStartedTestSet |
|
399 |
|
400 Description: Destructor. |
|
401 |
|
402 Cancels the asynchronous request, deallocate memory and closes the testcase. |
|
403 |
|
404 Parameters: None |
|
405 |
|
406 Return Values: None |
|
407 |
|
408 Errors/Exceptions: None |
|
409 |
|
410 Status: Draft |
|
411 |
|
412 ------------------------------------------------------------------------------- |
|
413 */ |
|
414 CStartedTestSet::~CStartedTestSet() |
|
415 { |
|
416 |
|
417 delete iTestSetInfo; |
|
418 iTestSetInfo = 0; |
|
419 iTestCases.Reset(); |
|
420 iTestCases.Close(); |
|
421 |
|
422 } |
|
423 |
|
424 /* |
|
425 ------------------------------------------------------------------------------- |
|
426 |
|
427 Class: CStartedTestSet |
|
428 |
|
429 Method: StartNext |
|
430 |
|
431 Description: Start next testcase. |
|
432 |
|
433 Parameters: None |
|
434 |
|
435 Return Values: KErrNone: test case started |
|
436 KErrNotFound: no test cases found. |
|
437 Other Symbian OS error code |
|
438 |
|
439 Errors/Exceptions: None |
|
440 |
|
441 Status: Draft |
|
442 |
|
443 ------------------------------------------------------------------------------- |
|
444 */ |
|
445 TInt CStartedTestSet::StartNext() |
|
446 { |
|
447 TInt ret = KErrNone; |
|
448 |
|
449 TInt count = iTestSetInfo->TestCases().Count(); |
|
450 if( iNext >= count ) |
|
451 { |
|
452 // All test cases running or completed, no more cases to start |
|
453 return KErrNotFound; |
|
454 } |
|
455 |
|
456 TInt index = 0; |
|
457 if( iType == ESetSequential ) |
|
458 { |
|
459 // Get test case index to be executed (when in NotExecutedCasesMode) |
|
460 if(iNotStartedCasesMode) |
|
461 { |
|
462 iNext = iTestSetInfo->GetLastStartedCaseIndex(); |
|
463 |
|
464 if(iNext >= count) |
|
465 { |
|
466 // All test cases running or completed, no more cases to start |
|
467 return KErrNotFound; |
|
468 } |
|
469 |
|
470 iTestSetInfo->SetLastStartedCaseIndex(iNext + 1); |
|
471 if(iOriginalTestSet) |
|
472 { |
|
473 iOriginalTestSet->SetLastStartedCaseIndex(iNext + 1); |
|
474 // Update only if original test set exists |
|
475 iUIStore->UpdateTestSet(*iOriginalTestSet); |
|
476 } |
|
477 } |
|
478 |
|
479 // Start next one and return |
|
480 ret = iUIStore->StartTestCase( iTestSetInfo->TestCases()[iNext], |
|
481 index ); |
|
482 if( ret != KErrNone ) |
|
483 { |
|
484 return ret; |
|
485 } |
|
486 iNext++; |
|
487 TRAPD( err, |
|
488 CStartedTestCase& testCase = iUIStore->StartedTestCaseL( index ); |
|
489 ret = iTestCases.Append( testCase ); |
|
490 ); |
|
491 if( err != KErrNone ) |
|
492 { |
|
493 User::Panic( KStartedTestSet, err ); |
|
494 } |
|
495 } |
|
496 else |
|
497 { |
|
498 // Start all cases |
|
499 for( ; iNext<count; iNext++ ) |
|
500 { |
|
501 ret = iUIStore->StartTestCase( iTestSetInfo->TestCases()[iNext], |
|
502 index ); |
|
503 if( ret != KErrNone ) |
|
504 { |
|
505 break; |
|
506 } |
|
507 TRAPD( err, |
|
508 CStartedTestCase& testCase = iUIStore->StartedTestCaseL( index ); |
|
509 ret = iTestCases.Append( testCase ); |
|
510 iRunningCases++; |
|
511 ); |
|
512 if( err != KErrNone ) |
|
513 { |
|
514 User::Panic( KStartedTestSet, err ); |
|
515 } |
|
516 if( ret != KErrNone ) |
|
517 { |
|
518 break; |
|
519 } |
|
520 } |
|
521 } |
|
522 |
|
523 return ret; |
|
524 |
|
525 } |
|
526 |
|
527 /* |
|
528 ------------------------------------------------------------------------------- |
|
529 |
|
530 Class: CStartedTestSet |
|
531 |
|
532 Method: Abort |
|
533 |
|
534 Description: Start next testcase. |
|
535 |
|
536 Parameters: None |
|
537 |
|
538 Return Values: KErrNone: test case started |
|
539 KErrNotFound: no test cases found. |
|
540 Other Symbian OS error code |
|
541 |
|
542 Errors/Exceptions: None |
|
543 |
|
544 Status: Draft |
|
545 |
|
546 ------------------------------------------------------------------------------- |
|
547 */ |
|
548 TInt CStartedTestSet::Abort() |
|
549 { |
|
550 |
|
551 TInt ret = KErrNotFound; |
|
552 TInt count = iTestCases.Count(); |
|
553 for( TInt i=0; i<count; i++ ) |
|
554 { |
|
555 if( iTestCases[i].Status() & |
|
556 CUIStoreIf::EStatusRunning ) |
|
557 { |
|
558 ret = iTestCases[i].UIEngineContainer().CancelTest(); |
|
559 if( ret != KErrNone ) |
|
560 { |
|
561 break; |
|
562 } |
|
563 } |
|
564 } |
|
565 |
|
566 // Prevent execution of remaining cases |
|
567 count = iTestSetInfo->TestCases().Count(); |
|
568 iNext = count; |
|
569 |
|
570 return ret; |
|
571 |
|
572 } |
|
573 |
|
574 |
|
575 /* |
|
576 ------------------------------------------------------------------------------- |
|
577 |
|
578 Class: CStartedTestSet |
|
579 |
|
580 Method: IsRunning |
|
581 |
|
582 Description: Check if test case running in this test set. |
|
583 |
|
584 Parameters: const CStartedTestCase* aTestCase: in: test case info |
|
585 |
|
586 Return Values: ETrue: This test set is running specified test case |
|
587 EFalse: Not running |
|
588 |
|
589 Errors/Exceptions: None |
|
590 |
|
591 Status: Draft |
|
592 |
|
593 ------------------------------------------------------------------------------- |
|
594 */ |
|
595 TBool CStartedTestSet::IsRunning( const CStartedTestCase* aTestCase ) |
|
596 { |
|
597 |
|
598 TInt count = iTestCases.Count(); |
|
599 for( TInt i=0; i<count; i++ ) |
|
600 { |
|
601 if( aTestCase == &iTestCases[i] ) |
|
602 { |
|
603 return ETrue; |
|
604 } |
|
605 } |
|
606 |
|
607 return EFalse; |
|
608 |
|
609 } |
|
610 |
|
611 /* |
|
612 ------------------------------------------------------------------------------- |
|
613 |
|
614 Class: CStartedTestSet |
|
615 |
|
616 Method: TestCompleted |
|
617 |
|
618 Description: Test from this set completed. Start next or |
|
619 set result for set. |
|
620 |
|
621 Parameters: const CStartedTestCase* aTestCase: in: test case info |
|
622 TFullTestResult aResult: in: test result |
|
623 |
|
624 Return Values: Symbian OS error code |
|
625 |
|
626 Errors/Exceptions: None |
|
627 |
|
628 Status: Draft |
|
629 |
|
630 ------------------------------------------------------------------------------- |
|
631 */ |
|
632 TInt CStartedTestSet::TestCompleted( const CStartedTestCase* aTestCase, |
|
633 TFullTestResult aResult ) |
|
634 { |
|
635 |
|
636 TInt count = iTestCases.Count(); |
|
637 TInt index = 0; |
|
638 for( ; index<count; index++ ) |
|
639 { |
|
640 if( aTestCase == &iTestCases[index] ) |
|
641 { |
|
642 break; |
|
643 } |
|
644 } |
|
645 if( index == count ) |
|
646 { |
|
647 return KErrNotFound; |
|
648 } |
|
649 |
|
650 // Remove from running test cases |
|
651 iRunningCases--; |
|
652 |
|
653 if( iResultSet == EFalse ) |
|
654 { |
|
655 // Check test results |
|
656 if( ( aResult.iCaseExecutionResultType != |
|
657 TFullTestResult::ECaseExecuted ) || |
|
658 ( aResult.iTestResult.iResult != KErrNone ) ) |
|
659 { |
|
660 iResult = aResult; |
|
661 iResultSet = ETrue; |
|
662 } |
|
663 } |
|
664 |
|
665 // Start next test case |
|
666 if( StartNext() == KErrNone ) |
|
667 { |
|
668 // Test case was started |
|
669 return KErrNone; |
|
670 } |
|
671 |
|
672 if( iRunningCases > 0 ) |
|
673 { |
|
674 // Test cases still running in test set |
|
675 return KErrNone; |
|
676 } |
|
677 |
|
678 iStatus = CUIStoreIf::ESetExecuted; |
|
679 if( iResultSet == EFalse ) |
|
680 { |
|
681 // Use the result of last test case all |
|
682 // test cases where succesfull |
|
683 iResult = aResult; |
|
684 } |
|
685 |
|
686 // Set test case completed |
|
687 if( ( iResult.iCaseExecutionResultType != |
|
688 TFullTestResult::ECaseExecuted ) || |
|
689 ( iResult.iTestResult.iResult != KErrNone ) ) |
|
690 { |
|
691 iStatus = CUIStoreIf::ESetFailed; |
|
692 } |
|
693 else |
|
694 { |
|
695 iStatus = CUIStoreIf::ESetPassed; |
|
696 } |
|
697 |
|
698 return KErrNone; |
|
699 |
|
700 } |
|
701 |
|
702 /* |
|
703 ------------------------------------------------------------------------------- |
|
704 |
|
705 Class: CStartedTestSet |
|
706 |
|
707 Method: SetNotExecutedCasesMode |
|
708 |
|
709 Description: Sets mode in which only not executed tests will be run. |
|
710 |
|
711 Parameters: TBool aNotExecutedCasesMode: desired mode |
|
712 |
|
713 Return Values: None |
|
714 |
|
715 Errors/Exceptions: None |
|
716 |
|
717 Status: Approved |
|
718 |
|
719 ------------------------------------------------------------------------------- |
|
720 */ |
|
721 void CStartedTestSet::SetNotStartedCasesMode(TBool aNotStartedCasesMode) |
|
722 { |
|
723 iNotStartedCasesMode = aNotStartedCasesMode; |
|
724 } |
|
725 |
|
726 /* |
|
727 ------------------------------------------------------------------------------- |
|
728 |
|
729 Class: CStartedTestSet |
|
730 |
|
731 Method: GetOriginalTestSet |
|
732 |
|
733 Description: Returns pointer to original test set. |
|
734 |
|
735 Parameters: None |
|
736 |
|
737 Return Values: Pointer to original test set. |
|
738 |
|
739 Errors/Exceptions: None |
|
740 |
|
741 Status: Approved |
|
742 |
|
743 ------------------------------------------------------------------------------- |
|
744 */ |
|
745 CTestSetInfo* CStartedTestSet::GetOriginalTestSet() |
|
746 { |
|
747 return iOriginalTestSet; |
|
748 } |
|
749 |
|
750 /* |
|
751 ------------------------------------------------------------------------------- |
|
752 |
|
753 Class: CStartedTestSet |
|
754 |
|
755 Method: NullOriginalTestSet |
|
756 |
|
757 Description: Sets pointer to original test set to NULL. |
|
758 |
|
759 Parameters: None |
|
760 |
|
761 Return Values: None |
|
762 |
|
763 Errors/Exceptions: None |
|
764 |
|
765 Status: Approved |
|
766 |
|
767 ------------------------------------------------------------------------------- |
|
768 */ |
|
769 void CStartedTestSet::NullOriginalTestSet() |
|
770 { |
|
771 iOriginalTestSet = NULL; |
|
772 } |
|
773 |
|
774 /* |
|
775 ------------------------------------------------------------------------------- |
|
776 |
|
777 DESCRIPTION |
|
778 |
|
779 This module contains implementation of CTestProgress class |
|
780 member functions. |
|
781 |
|
782 ------------------------------------------------------------------------------- |
|
783 */ |
|
784 |
|
785 // ================= MEMBER FUNCTIONS ========================================= |
|
786 |
|
787 /* |
|
788 ------------------------------------------------------------------------------- |
|
789 |
|
790 Class: CTestProgress |
|
791 |
|
792 Method: NewL |
|
793 |
|
794 Description: Create CTestProgress. |
|
795 |
|
796 Parameters: TTestProgress& aProgress: in: info from test module |
|
797 |
|
798 Return Values: CTestProgress* : pointer to created object |
|
799 |
|
800 Errors/Exceptions: Leaves if memory allocation for object fails |
|
801 Leaves if ConstructL leaves |
|
802 |
|
803 Status: Draft |
|
804 |
|
805 ------------------------------------------------------------------------------- |
|
806 */ |
|
807 CTestProgress* CTestProgress::NewL( const TTestProgress& aProgress ) |
|
808 { |
|
809 |
|
810 CTestProgress* self = new ( ELeave ) CTestProgress(); |
|
811 CleanupStack::PushL( self ); |
|
812 self->ConstructL( aProgress ); |
|
813 CleanupStack::Pop( self ); |
|
814 return self; |
|
815 |
|
816 } |
|
817 |
|
818 /* |
|
819 ------------------------------------------------------------------------------- |
|
820 |
|
821 Class: CTestProgress |
|
822 |
|
823 Method: ConstructL |
|
824 |
|
825 Description: Second level constructor. |
|
826 |
|
827 Parameters: TTestProgress& aProgress: in: print info |
|
828 |
|
829 Return Values: None |
|
830 |
|
831 Errors/Exceptions: Leaves if TTestProgress copying fails |
|
832 |
|
833 Status: Draft |
|
834 |
|
835 ------------------------------------------------------------------------------- |
|
836 */ |
|
837 void CTestProgress::ConstructL( const TTestProgress& aProgress ) |
|
838 { |
|
839 |
|
840 iPosition = aProgress.iPosition; |
|
841 iDescriptionBuf = aProgress.iDescription.AllocL(); |
|
842 iTextBuf = aProgress.iText.AllocL(); |
|
843 iDescription.Set( iDescriptionBuf->Des() ); |
|
844 iText.Set( iTextBuf->Des() ); |
|
845 |
|
846 } |
|
847 |
|
848 /* |
|
849 ------------------------------------------------------------------------------- |
|
850 |
|
851 Class: CTestProgress |
|
852 |
|
853 Method: ~CTestProgress |
|
854 |
|
855 Description: Destructor. |
|
856 |
|
857 Parameters: None |
|
858 |
|
859 Return Values: None |
|
860 |
|
861 Errors/Exceptions: None |
|
862 |
|
863 Status: Draft |
|
864 |
|
865 ------------------------------------------------------------------------------- |
|
866 */ |
|
867 CTestProgress::~CTestProgress() |
|
868 { |
|
869 |
|
870 delete iTextBuf; |
|
871 delete iDescriptionBuf; |
|
872 |
|
873 } |
|
874 |
|
875 /* |
|
876 ------------------------------------------------------------------------------- |
|
877 |
|
878 Class: CTestProgress |
|
879 |
|
880 Method: ReplaceTextL |
|
881 |
|
882 Description: Replace text with ne one. |
|
883 |
|
884 Parameters: const TTestProgress& aProgress: in: new info |
|
885 |
|
886 Return Values: None |
|
887 |
|
888 Errors/Exceptions: None |
|
889 |
|
890 Status: Draft |
|
891 |
|
892 ------------------------------------------------------------------------------- |
|
893 */ |
|
894 void CTestProgress::ReplaceTextL( const TTestProgress& aProgress ) |
|
895 { |
|
896 |
|
897 HBufC* tmp = iTextBuf; |
|
898 iTextBuf = 0; |
|
899 CleanupStack::PushL( tmp ); |
|
900 iTextBuf = aProgress.iText.AllocL(); |
|
901 iText.Set( iTextBuf->Des() ); |
|
902 CleanupStack::PopAndDestroy( tmp ); |
|
903 |
|
904 } |
|
905 |
|
906 // End of File |
|