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 |
||
18 |
#ifndef UT_SYMBIANUNITTEST_H |
|
19 |
#define UT_SYMBIANUNITTEST_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <symbianunittest.h> |
|
23 |
#include "symbianunittestobserver.h" |
|
24 |
#include <badesca.h> |
|
25 |
||
26 |
// FORWARD DECLARATIONS |
|
27 |
class CSymbianUnitTestResult; |
|
28 |
||
29 |
// CLASS DECLARATION |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
30 |
NONSHARABLE_CLASS(UT_CSymbianUnitTest) : |
0 | 31 |
public CSymbianUnitTest, |
32 |
public MSymbianUnitTestObserver |
|
33 |
{ |
|
34 |
public: // Constructors and destructor |
|
35 |
||
36 |
static UT_CSymbianUnitTest* NewL(); |
|
37 |
static UT_CSymbianUnitTest* NewLC(); |
|
38 |
~UT_CSymbianUnitTest(); |
|
39 |
||
40 |
public: // From MSymbianUnitTestObserver |
|
41 |
||
42 |
void IncrementExecutedTestsCount(); |
|
43 |
||
44 |
protected: // Test functions |
|
45 |
||
46 |
void SetupL(); |
|
47 |
void Teardown(); |
|
48 |
void UT_NameL(); |
|
49 |
void UT_IsMemoryAllocationFailureSimulationUsedL(); |
|
50 |
void UT_PanicInTestL(); |
|
51 |
void UT_ErrorInSetupL(); |
|
52 |
void UT_LeaveInTestL(); |
|
53 |
void UT_MemoryLeakInTestL(); |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
54 |
void UT_EqualsAssertsL(); |
0 | 55 |
void UT_FailingAssertsL(); |
56 |
void UT_PassingAssertsL(); |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
57 |
void UT_TestCaseNamesL(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
58 |
void UT_TimeoutL(); |
0 | 59 |
|
60 |
protected: // Failing functions to simulate failing tests |
|
61 |
||
62 |
void SimulatePanicL(); |
|
63 |
void SimulateLeaveL(); |
|
64 |
void SimulateMemoryLeakL(); |
|
65 |
void SimulateFailingAssertL(); |
|
66 |
void SimulateFailingAssertWithIntsL(); |
|
67 |
void SimulateFailingAssertWithDesC8sL(); |
|
68 |
void SimulateFailingAssertWithDesC16sL(); |
|
69 |
void SimulateFailingAssertLeaveL(); |
|
70 |
void SimulateFailingAssertLeaveWithSpecificValueL(); |
|
71 |
void SimulateTimeoutL(); |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
72 |
void SimulateEqualsAssertWithStringL(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
73 |
void SimulateEqualsAssertWithStringFailL(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
74 |
void SimulateEqualsAssertWithString8L(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
75 |
void SimulateEqualsAssertWithString8FailL(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
76 |
void SimulateEqualsAssertWithIntL(); |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
77 |
void SimulateEqualsAssertWithIntFailL(); |
0 | 78 |
|
79 |
protected: // Dummy function to simulate setup and teardown |
|
80 |
||
81 |
void Dummy(); |
|
82 |
||
83 |
private: // Contructors |
|
84 |
||
85 |
UT_CSymbianUnitTest(); |
|
86 |
void ConstructL(); |
|
87 |
||
88 |
private: // Data |
|
89 |
||
90 |
CSymbianUnitTestResult* iTestResult; |
|
91 |
UT_CSymbianUnitTest* iUnitTest; |
|
92 |
TInt iExecutedTestCount; |
|
93 |
CDesCArray* iTestCaseNames; |
|
94 |
}; |
|
95 |
||
96 |
#endif // UT_SYMBIANUNITTEST_H |