author | Johnson Ma <johnson.ma@nokia.com> |
Mon, 29 Mar 2010 14:46:27 +0800 | |
changeset 1 | bbd31066657e |
parent 0 | 3e07fef1e154 |
permissions | -rw-r--r-- |
0 | 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> |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
22 |
#include <badesca.h> |
0 | 23 |
#include <symbianunittestmacros.h> |
24 |
||
25 |
// FORWARD DECLARATIONS |
|
26 |
class CSymbianUnitTestFailure; |
|
27 |
||
28 |
// CLASS DECLARATION |
|
29 |
class CSymbianUnitTestResult : public CBase |
|
30 |
{ |
|
31 |
public: // Constructors and destructor |
|
32 |
||
33 |
static CSymbianUnitTestResult* NewLC(); |
|
34 |
static CSymbianUnitTestResult* NewL(); |
|
35 |
~CSymbianUnitTestResult(); |
|
36 |
||
37 |
public: // New functions |
|
38 |
||
39 |
TInt TestCount() const; |
|
40 |
||
41 |
TInt PassedTestCount() const; |
|
42 |
||
43 |
RPointerArray< CSymbianUnitTestFailure >& Failures(); |
|
44 |
||
45 |
void StartTestL( const TDesC& aTestName ); |
|
46 |
void EndTestL(); |
|
47 |
||
48 |
void AddSetupErrorL( |
|
49 |
TInt aError ); |
|
50 |
||
51 |
void AddLeaveFromTestL( |
|
52 |
TInt aLeaveCode, |
|
53 |
TInt aAllocFailureRate ); |
|
54 |
||
55 |
void AddMemoryLeakInfoL( |
|
56 |
TInt aLeakedMemory, |
|
57 |
TInt aAllocFailureRate ); |
|
58 |
||
59 |
void AddPanicInfoL( |
|
60 |
const TExitCategoryName& aPanicCategory, |
|
61 |
TInt aPanicReason, |
|
62 |
TInt aAllocFailureRate ); |
|
63 |
||
64 |
TInt AddAssertFailure( |
|
65 |
const TDesC8& aFailureMessage, |
|
66 |
TInt aLineNumber, |
|
67 |
const TDesC8& aFileName ); |
|
68 |
||
69 |
void AddTimeOutErrorL( |
|
70 |
TInt aTimeOut); |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
71 |
|
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
72 |
const CDesCArray& TestCaseNames() const; |
0 | 73 |
|
74 |
private: // Constructors |
|
75 |
||
76 |
CSymbianUnitTestResult(); |
|
77 |
void ConstructL(); |
|
78 |
||
79 |
private: // New functions |
|
80 |
||
81 |
void AddAssertFailureL( |
|
82 |
const TDesC8& aFailureMessage, |
|
83 |
TInt aLineNumber, |
|
84 |
const TDesC8& aFileName ); |
|
85 |
||
86 |
TInt AddFailure( |
|
87 |
const TDesC8& aFailureText, |
|
88 |
TInt aAllocFailureRate ); |
|
89 |
||
90 |
void AddFailureL( |
|
91 |
const TDesC8& aFailureText, |
|
92 |
TInt aAllocFailureRate ); |
|
93 |
||
94 |
private: // Data |
|
95 |
||
96 |
RHeap& iOriginalHeap; |
|
97 |
RPointerArray< CSymbianUnitTestFailure > iFailures; |
|
98 |
TInt iTestCount; |
|
99 |
HBufC* iCurrentTestName; |
|
100 |
TTime iTime; |
|
101 |
TBool iCurrentResult; |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
102 |
CDesCArray * iTestCaseNames; |
0 | 103 |
|
104 |
private: // Test |
|
105 |
||
106 |
SYMBIAN_UNIT_TEST_CLASS( UT_CSymbianUnitTestResult ) |
|
107 |
}; |
|
108 |
||
109 |
#endif // SYMBIANUNITTESTRESULT_H |
|
110 |
||
111 |