|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: CCollectionHelperTestClass implementation for STIF Test Framework TestScripter. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <Stiftestinterface.h> |
|
22 #include "CollectionHelperTestClass.h" |
|
23 |
|
24 // EXTERNAL DATA STRUCTURES |
|
25 //extern ?external_data; |
|
26 |
|
27 // EXTERNAL FUNCTION PROTOTYPES |
|
28 //extern ?external_function( ?arg_type,?arg_type ); |
|
29 |
|
30 // CONSTANTS |
|
31 //const ?type ?constant_var = ?constant; |
|
32 |
|
33 // MACROS |
|
34 //#define ?macro ?macro_def |
|
35 |
|
36 // LOCAL CONSTANTS AND MACROS |
|
37 //const ?type ?constant_var = ?constant; |
|
38 //#define ?macro_name ?macro_def |
|
39 |
|
40 // MODULE DATA STRUCTURES |
|
41 //enum ?declaration |
|
42 //typedef ?declaration |
|
43 |
|
44 // LOCAL FUNCTION PROTOTYPES |
|
45 //?type ?function_name( ?arg_type, ?arg_type ); |
|
46 |
|
47 // FORWARD DECLARATIONS |
|
48 //class ?FORWARD_CLASSNAME; |
|
49 |
|
50 // ============================= LOCAL FUNCTIONS =============================== |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // ?function_name ?description. |
|
54 // ?description |
|
55 // Returns: ?value_1: ?description |
|
56 // ?value_n: ?description_line1 |
|
57 // ?description_line2 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 /* |
|
61 ?type ?function_name( |
|
62 ?arg_type arg, // ?description |
|
63 ?arg_type arg) // ?description |
|
64 { |
|
65 |
|
66 ?code // ?comment |
|
67 |
|
68 // ?comment |
|
69 ?code |
|
70 } |
|
71 */ |
|
72 |
|
73 // ============================ MEMBER FUNCTIONS =============================== |
|
74 |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CCollectionHelperTestClass::CCollectionHelperTestClass |
|
78 // C++ default constructor can NOT contain any code, that |
|
79 // might leave. |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 CCollectionHelperTestClass::CCollectionHelperTestClass( |
|
83 CTestModuleIf& aTestModuleIf ): |
|
84 CScriptBase( aTestModuleIf ), |
|
85 iTestModuleIf(aTestModuleIf) |
|
86 { |
|
87 } |
|
88 |
|
89 CCollectionHelperTestClass::~CCollectionHelperTestClass() |
|
90 { |
|
91 |
|
92 // Delete resources allocated from test methods |
|
93 Delete(); |
|
94 |
|
95 // Delete logger |
|
96 delete iLog; |
|
97 delete iTimeoutController; |
|
98 |
|
99 iCollectionUtility->Close(); |
|
100 iCollectionUtility = NULL; |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CCollectionHelperTestClass::NewL |
|
105 // Two-phased constructor. |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 CCollectionHelperTestClass* CCollectionHelperTestClass::NewL( |
|
109 CTestModuleIf& aTestModuleIf ) |
|
110 { |
|
111 CCollectionHelperTestClass* self = new (ELeave) CCollectionHelperTestClass( aTestModuleIf ); |
|
112 |
|
113 CleanupStack::PushL( self ); |
|
114 self->ConstructL(); |
|
115 CleanupStack::Pop(); |
|
116 |
|
117 return self; |
|
118 |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // CCollectionHelperTestClass::ConstructL |
|
123 // Symbian 2nd phase constructor can leave. |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 void CCollectionHelperTestClass::ConstructL() |
|
127 { |
|
128 iLog = CStifLogger::NewL( KCollectionHelperTestClassLogPath, |
|
129 KCollectionHelperTestClassLogFile, |
|
130 CStifLogger::ETxt, |
|
131 CStifLogger::EFile, |
|
132 EFalse ); |
|
133 |
|
134 iTimeoutController = CSimpleTimeout::NewL (this, iLog); |
|
135 |
|
136 iCollectionUtility = MMPXCollectionUtility::NewL(this, KMcModeDefault); |
|
137 } |
|
138 |
|
139 |
|
140 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
141 |
|
142 // ----------------------------------------------------------------------------- |
|
143 // LibEntryL is a polymorphic Dll entry point. |
|
144 // Returns: CScriptBase: New CScriptBase derived object |
|
145 // ----------------------------------------------------------------------------- |
|
146 // |
|
147 EXPORT_C CScriptBase* LibEntryL( |
|
148 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
149 { |
|
150 |
|
151 return ( CScriptBase* ) CCollectionHelperTestClass::NewL( aTestModuleIf ); |
|
152 |
|
153 } |
|
154 |
|
155 // ----------------------------------------------------------------------------- |
|
156 // E32Dll is a DLL entry point function. |
|
157 // Returns: KErrNone |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 #ifndef EKA2 // Hide Dll entry point to EKA2 |
|
161 GLDEF_C TInt E32Dll( |
|
162 TDllReason /*aReason*/) // Reason code |
|
163 { |
|
164 return(KErrNone); |
|
165 |
|
166 } |
|
167 #endif // EKA2 |
|
168 |
|
169 // End of File |