|
1 /* |
|
2 * Copyright (c) 2006 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 |
|
19 // CLASS HEADER |
|
20 #include "UT_CFOperationPluginManager.h" |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <EUnitMacros.h> |
|
24 #include <EUnitDecorators.h> |
|
25 |
|
26 |
|
27 // INTERNAL INCLUDES |
|
28 #include "cfoperationpluginmanager.h" |
|
29 #include "cfenvutils.h" |
|
30 |
|
31 // CONSTRUCTION |
|
32 UT_CFOperationPluginManager* UT_CFOperationPluginManager::NewL() |
|
33 { |
|
34 UT_CFOperationPluginManager* self = UT_CFOperationPluginManager::NewLC(); |
|
35 CleanupStack::Pop(); |
|
36 |
|
37 return self; |
|
38 } |
|
39 |
|
40 UT_CFOperationPluginManager* UT_CFOperationPluginManager::NewLC() |
|
41 { |
|
42 UT_CFOperationPluginManager* self = new( ELeave ) UT_CFOperationPluginManager(); |
|
43 CleanupStack::PushL( self ); |
|
44 |
|
45 self->ConstructL(); |
|
46 |
|
47 return self; |
|
48 } |
|
49 |
|
50 // Destructor (virtual by CBase) |
|
51 UT_CFOperationPluginManager::~UT_CFOperationPluginManager() |
|
52 { |
|
53 // Enable screen saver |
|
54 CFEnvUtils::EnableScreenSaver( ETrue ); |
|
55 } |
|
56 |
|
57 // Default constructor |
|
58 UT_CFOperationPluginManager::UT_CFOperationPluginManager() |
|
59 { |
|
60 } |
|
61 |
|
62 // Second phase construct |
|
63 void UT_CFOperationPluginManager::ConstructL() |
|
64 { |
|
65 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
66 // It generates the test case table. |
|
67 CEUnitTestSuiteClass::ConstructL(); |
|
68 |
|
69 // Disable screen saver |
|
70 CFEnvUtils::EnableScreenSaver( EFalse ); |
|
71 } |
|
72 |
|
73 // METHODS |
|
74 |
|
75 |
|
76 void UT_CFOperationPluginManager::SetupL( ) |
|
77 { |
|
78 iCCFOperationPluginManager = NULL; |
|
79 } |
|
80 |
|
81 |
|
82 void UT_CFOperationPluginManager::Teardown( ) |
|
83 { |
|
84 delete iCCFOperationPluginManager; |
|
85 iCCFOperationPluginManager = NULL; |
|
86 |
|
87 iArray.Close(); |
|
88 } |
|
89 |
|
90 //----------------------------------------------------------------------------- |
|
91 // UT_CFOperationPluginManager class unit tests |
|
92 //----------------------------------------------------------------------------- |
|
93 // |
|
94 void UT_CFOperationPluginManager::UT_CFOperationPluginManager_NewLL( ) |
|
95 { |
|
96 CCFOperationPluginManager* instance = |
|
97 CCFOperationPluginManager::NewL( *this ); |
|
98 CleanupStack::PushL( instance ); |
|
99 |
|
100 EUNIT_ASSERT_DESC( instance, "CCFOperationPluginManager instance not created!" ); |
|
101 |
|
102 CleanupStack::PopAndDestroy( instance ); |
|
103 } |
|
104 |
|
105 void UT_CFOperationPluginManager::UT_CFOperationPluginManager_NewLCL( ) |
|
106 { |
|
107 CCFOperationPluginManager* instance = |
|
108 CCFOperationPluginManager::NewLC( *this ); |
|
109 |
|
110 EUNIT_ASSERT_DESC( instance, "CCFOperationPluginManager instance not created!" ); |
|
111 |
|
112 CleanupStack::PopAndDestroy( instance ); |
|
113 } |
|
114 |
|
115 |
|
116 // TEST TABLE |
|
117 EUNIT_BEGIN_TEST_TABLE( |
|
118 UT_CFOperationPluginManager, |
|
119 "Add test suite description here.", |
|
120 "UNIT" ) |
|
121 |
|
122 EUNIT_TEST( |
|
123 "NewLC - test", |
|
124 "CCFOperationPluginManager", |
|
125 "NewLC", |
|
126 "FUNCTIONALITY", |
|
127 SetupL, UT_CFOperationPluginManager_NewLL, Teardown) |
|
128 |
|
129 EUNIT_TEST( |
|
130 "NewL - test", |
|
131 "CCFOperationPluginManager", |
|
132 "NewL", |
|
133 "FUNCTIONALITY", |
|
134 SetupL, UT_CFOperationPluginManager_NewLCL, Teardown) |
|
135 |
|
136 EUNIT_END_TEST_TABLE |
|
137 |
|
138 // END OF FILE |