|
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: |
|
15 * |
|
16 */ |
|
17 #ifndef SYMBIANUNITTESTRESULT_H |
|
18 #define SYMBIANUNITTESTRESULT_H |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32base.h> |
|
22 #include <symbianunittestmacros.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CSymbianUnitTestFailure; |
|
26 |
|
27 // CLASS DECLARATION |
|
28 class CSymbianUnitTestResult : public CBase |
|
29 { |
|
30 public: // Constructors and destructor |
|
31 |
|
32 static CSymbianUnitTestResult* NewLC(); |
|
33 static CSymbianUnitTestResult* NewL(); |
|
34 ~CSymbianUnitTestResult(); |
|
35 |
|
36 public: // New functions |
|
37 |
|
38 TInt TestCount() const; |
|
39 |
|
40 TInt PassedTestCount() const; |
|
41 |
|
42 RPointerArray< CSymbianUnitTestFailure >& Failures(); |
|
43 |
|
44 void StartTestL( const TDesC& aTestName ); |
|
45 void EndTestL(); |
|
46 |
|
47 void AddSetupErrorL( |
|
48 TInt aError ); |
|
49 |
|
50 void AddLeaveFromTestL( |
|
51 TInt aLeaveCode, |
|
52 TInt aAllocFailureRate ); |
|
53 |
|
54 void AddMemoryLeakInfoL( |
|
55 TInt aLeakedMemory, |
|
56 TInt aAllocFailureRate ); |
|
57 |
|
58 void AddPanicInfoL( |
|
59 const TExitCategoryName& aPanicCategory, |
|
60 TInt aPanicReason, |
|
61 TInt aAllocFailureRate ); |
|
62 |
|
63 TInt AddAssertFailure( |
|
64 const TDesC8& aFailureMessage, |
|
65 TInt aLineNumber, |
|
66 const TDesC8& aFileName ); |
|
67 |
|
68 void AddTimeOutErrorL( |
|
69 TInt aTimeOut); |
|
70 |
|
71 private: // Constructors |
|
72 |
|
73 CSymbianUnitTestResult(); |
|
74 void ConstructL(); |
|
75 |
|
76 private: // New functions |
|
77 |
|
78 void AddAssertFailureL( |
|
79 const TDesC8& aFailureMessage, |
|
80 TInt aLineNumber, |
|
81 const TDesC8& aFileName ); |
|
82 |
|
83 TInt AddFailure( |
|
84 const TDesC8& aFailureText, |
|
85 TInt aAllocFailureRate ); |
|
86 |
|
87 void AddFailureL( |
|
88 const TDesC8& aFailureText, |
|
89 TInt aAllocFailureRate ); |
|
90 |
|
91 private: // Data |
|
92 |
|
93 RHeap& iOriginalHeap; |
|
94 RPointerArray< CSymbianUnitTestFailure > iFailures; |
|
95 TInt iTestCount; |
|
96 HBufC* iCurrentTestName; |
|
97 TTime iTime; |
|
98 TBool iCurrentResult; |
|
99 |
|
100 private: // Test |
|
101 |
|
102 SYMBIAN_UNIT_TEST_CLASS( UT_CSymbianUnitTestResult ) |
|
103 }; |
|
104 |
|
105 #endif // SYMBIANUNITTESTRESULT_H |
|
106 |
|
107 |