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 |
#include "ut_symbianunittestsuite.h" |
|
19 |
#include "symbianunittestsuite.h" |
|
20 |
#include <symbianunittestmacros.h> |
|
21 |
||
22 |
_LIT( KTestSuiteName, "TestSuite" ); |
|
23 |
||
24 |
// --------------------------------------------------------------------------- |
|
25 |
// |
|
26 |
// --------------------------------------------------------------------------- |
|
27 |
// |
|
28 |
UT_CSymbianUnitTestSuite* UT_CSymbianUnitTestSuite::NewL() |
|
29 |
{ |
|
30 |
UT_CSymbianUnitTestSuite* self = UT_CSymbianUnitTestSuite::NewLC(); |
|
31 |
CleanupStack::Pop( self ); |
|
32 |
return self; |
|
33 |
} |
|
34 |
||
35 |
// --------------------------------------------------------------------------- |
|
36 |
// |
|
37 |
// --------------------------------------------------------------------------- |
|
38 |
// |
|
39 |
UT_CSymbianUnitTestSuite* UT_CSymbianUnitTestSuite::NewLC() |
|
40 |
{ |
|
41 |
UT_CSymbianUnitTestSuite* self = |
|
42 |
new( ELeave )UT_CSymbianUnitTestSuite(); |
|
43 |
CleanupStack::PushL( self ); |
|
44 |
self->ConstructL(); |
|
45 |
return self; |
|
46 |
} |
|
47 |
||
48 |
// --------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
// --------------------------------------------------------------------------- |
|
51 |
// |
|
52 |
UT_CSymbianUnitTestSuite::UT_CSymbianUnitTestSuite() |
|
53 |
{ |
|
54 |
} |
|
55 |
||
56 |
// --------------------------------------------------------------------------- |
|
57 |
// |
|
58 |
// --------------------------------------------------------------------------- |
|
59 |
// |
|
60 |
void UT_CSymbianUnitTestSuite::ConstructL() |
|
61 |
{ |
|
62 |
BASE_CONSTRUCT |
|
1
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
63 |
|
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
64 |
DEFINE_TEST_CLASS( UT_CSymbianUnitTestSuite ) |
bbd31066657e
publish symbianunittest v1.1.0
Johnson Ma <johnson.ma@nokia.com>
parents:
0
diff
changeset
|
65 |
|
0 | 66 |
ADD_SUT( UT_NameL ) |
67 |
ADD_SUT( UT_AddL ) |
|
68 |
} |
|
69 |
||
70 |
// --------------------------------------------------------------------------- |
|
71 |
// |
|
72 |
// --------------------------------------------------------------------------- |
|
73 |
// |
|
74 |
UT_CSymbianUnitTestSuite::~UT_CSymbianUnitTestSuite() |
|
75 |
{ |
|
76 |
} |
|
77 |
||
78 |
// --------------------------------------------------------------------------- |
|
79 |
// |
|
80 |
// --------------------------------------------------------------------------- |
|
81 |
// |
|
82 |
void UT_CSymbianUnitTestSuite::SetupL() |
|
83 |
{ |
|
84 |
iUnitTestSuite = CSymbianUnitTestSuite::NewL( KTestSuiteName ); |
|
85 |
} |
|
86 |
||
87 |
// --------------------------------------------------------------------------- |
|
88 |
// |
|
89 |
// --------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
void UT_CSymbianUnitTestSuite::Teardown() |
|
92 |
{ |
|
93 |
delete iUnitTestSuite; |
|
94 |
iUnitTestSuite = NULL; |
|
95 |
} |
|
96 |
||
97 |
// --------------------------------------------------------------------------- |
|
98 |
// |
|
99 |
// --------------------------------------------------------------------------- |
|
100 |
// |
|
101 |
void UT_CSymbianUnitTestSuite::UT_NameL() |
|
102 |
{ |
|
103 |
SUT_ASSERT_EQUALS( KTestSuiteName, iUnitTestSuite->Name() ) |
|
104 |
} |
|
105 |
||
106 |
// --------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
// --------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
void UT_CSymbianUnitTestSuite::UT_AddL() |
|
111 |
{ |
|
112 |
SUT_ASSERT_EQUALS( 0, iUnitTestSuite->TestCaseCount() ) |
|
113 |
||
114 |
UT_CSymbianUnitTestSuite* thisTest = UT_CSymbianUnitTestSuite::NewLC(); |
|
115 |
iUnitTestSuite->AddL( thisTest ); |
|
116 |
CleanupStack::Pop( thisTest ); |
|
117 |
SUT_ASSERT_EQUALS( |
|
118 |
thisTest->TestCaseCount(), iUnitTestSuite->TestCaseCount() ) |
|
119 |
} |