|
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: STIF normal test module declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TESTMODULEXXX_H |
|
19 #define TESTMODULEXXX_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "StifTestModule.h" |
|
23 #include <StifLogger.h> |
|
24 #include <NormalHardcodedAssert.h> |
|
25 |
|
26 // CONSTANTS |
|
27 //const ?type ?constant_var = ?constant; |
|
28 |
|
29 // MACROS |
|
30 //#define ?macro ?macro_def |
|
31 #define TEST_MODULE_VERSION_MAJOR 0 |
|
32 #define TEST_MODULE_VERSION_MINOR 0 |
|
33 #define TEST_MODULE_VERSION_BUILD 0 |
|
34 |
|
35 // Logging path |
|
36 _LIT( KTestModuleXXXLogPath, "\\logs\\testframework\\TestModuleXXX\\" ); |
|
37 // Log file |
|
38 _LIT( KTestModuleXXXLogFile, "TestModuleXXX.txt" ); |
|
39 _LIT( KTestModuleXXXLogFileWithTitle, "TestModuleXXX_[%S].txt" ); |
|
40 |
|
41 // DATA TYPES |
|
42 //enum ?declaration |
|
43 //typedef ?declaration |
|
44 //extern ?data_type; |
|
45 |
|
46 // FUNCTION PROTOTYPES |
|
47 //?type ?function_name(?arg_list); |
|
48 |
|
49 // FORWARD DECLARATIONS |
|
50 //class ?FORWARD_CLASSNAME; |
|
51 |
|
52 // CLASS DECLARATION |
|
53 |
|
54 /** |
|
55 * This a TestModuleXXX class. |
|
56 * ?other_description_lines |
|
57 * |
|
58 * @lib ?library |
|
59 * @since ?Series60_version |
|
60 */ |
|
61 NONSHARABLE_CLASS(CTestModuleXXX) : public CTestModuleBase |
|
62 { |
|
63 public: // Constructors and destructor |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 static CTestModuleXXX* NewL(); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 virtual ~CTestModuleXXX(); |
|
74 |
|
75 public: // New functions |
|
76 |
|
77 /** |
|
78 * ?member_description. |
|
79 * @since ?Series60_version |
|
80 * @param ?arg1 ?description |
|
81 * @return ?description |
|
82 */ |
|
83 //?type ?member_function( ?type ?arg1 ); |
|
84 |
|
85 public: // Functions from base classes |
|
86 |
|
87 /** |
|
88 * From CTestModuleBase InitL is used to initialize the TestModuleXXX. |
|
89 * It is called once for every instance of TestModuleXXX after |
|
90 * its creation. |
|
91 * @since ?Series60_version |
|
92 * @param aIniFile Initialization file for the test module (optional) |
|
93 * @param aFirstTime Flag is true when InitL is executed for first |
|
94 * created instance of TestModuleXXX. |
|
95 * @return Symbian OS error code |
|
96 */ |
|
97 TInt InitL( TFileName& aIniFile, TBool aFirstTime ); |
|
98 |
|
99 /** |
|
100 * From CTestModuleBase GetTestCasesL is used to inquiry test cases |
|
101 * from TestModuleXXX. |
|
102 * @since ?Series60_version |
|
103 * @param aTestCaseFile Test case file (optional) |
|
104 * @param aTestCases Array of TestCases returned to test framework |
|
105 * @return Symbian OS error code |
|
106 */ |
|
107 TInt GetTestCasesL( const TFileName& aTestCaseFile, |
|
108 RPointerArray<TTestCaseInfo>& aTestCases ); |
|
109 |
|
110 /** |
|
111 * From CTestModuleBase RunTestCaseL is used to run an individual |
|
112 * test case. |
|
113 * @since ?Series60_version |
|
114 * @param aCaseNumber Test case number |
|
115 * @param aTestCaseFile Test case file (optional) |
|
116 * @param aResult Test case result returned to test framework (PASS/FAIL) |
|
117 * @return Symbian OS error code (test case execution error, which is |
|
118 * not reported in aResult parameter as test case failure). |
|
119 */ |
|
120 TInt RunTestCaseL( const TInt aCaseNumber, |
|
121 const TFileName& aTestCaseFile, |
|
122 TTestResult& aResult ); |
|
123 |
|
124 /** |
|
125 * From CTestModuleBase; OOMTestQueryL is used to specify is particular |
|
126 * test case going to be executed using OOM conditions |
|
127 * @param aTestCaseFile Test case file (optional) |
|
128 * @param aCaseNumber Test case number (optional) |
|
129 * @param aFailureType OOM failure type (optional) |
|
130 * @param aFirstMemFailure The first heap memory allocation failure value (optional) |
|
131 * @param aLastMemFailure The last heap memory allocation failure value (optional) |
|
132 * @return TBool |
|
133 */ |
|
134 virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, |
|
135 const TInt /* aCaseNumber */, |
|
136 TOOMFailureType& /* aFailureType */, |
|
137 TInt& /* aFirstMemFailure */, |
|
138 TInt& /* aLastMemFailure */ ); |
|
139 |
|
140 /** |
|
141 * From CTestModuleBase; User may add implementation for OOM test |
|
142 * environment initialization. Usually no implementation is required. |
|
143 * @param aTestCaseFile Test case file (optional) |
|
144 * @param aCaseNumber Test case number (optional) |
|
145 * @return None |
|
146 */ |
|
147 virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, |
|
148 const TInt /* aCaseNumber */ ); |
|
149 |
|
150 /** |
|
151 * From CTestModuleBase; OOMHandleWarningL. User may add implementation |
|
152 * for OOM test warning handling. Usually no implementation is required. |
|
153 * @param aTestCaseFile Test case file (optional) |
|
154 * @param aCaseNumber Test case number (optional) |
|
155 * @param aFailNextValue FailNextValue for OOM test execution (optional) |
|
156 * @return None |
|
157 */ |
|
158 virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, |
|
159 const TInt /* aCaseNumber */, |
|
160 TInt& /* aFailNextValue */); |
|
161 |
|
162 /** |
|
163 * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM |
|
164 * test environment. Usually no implementation is required. |
|
165 * @param aTestCaseFile Test case file (optional) |
|
166 * @param aCaseNumber Test case number (optional) |
|
167 * @return None |
|
168 */ |
|
169 virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, |
|
170 const TInt /* aCaseNumber */ ); |
|
171 |
|
172 /** |
|
173 * Method used to log version of test module |
|
174 */ |
|
175 void SendTestModuleVersion(); |
|
176 |
|
177 |
|
178 protected: // New functions |
|
179 |
|
180 /** |
|
181 * ?member_description. |
|
182 * @since ?Series60_version |
|
183 * @param ?arg1 ?description |
|
184 * @return ?description |
|
185 */ |
|
186 //?type ?member_function( ?type ?arg1 ); |
|
187 |
|
188 protected: // Functions from base classes |
|
189 |
|
190 /** |
|
191 * From ?base_class ?member_description |
|
192 */ |
|
193 //?type ?member_function(); |
|
194 |
|
195 private: |
|
196 |
|
197 /** |
|
198 * C++ default constructor. |
|
199 */ |
|
200 CTestModuleXXX(); |
|
201 |
|
202 /** |
|
203 * By default Symbian 2nd phase constructor is private. |
|
204 */ |
|
205 void ConstructL(); |
|
206 |
|
207 /** |
|
208 * Check for settings and create logger with test case title in file name. |
|
209 */ |
|
210 void CreateTitleLoggerL(void); |
|
211 |
|
212 /** |
|
213 * Check for logger settings and delete title logger. |
|
214 */ |
|
215 void DeleteTitleLogger(void); |
|
216 |
|
217 // Prohibit copy constructor if not deriving from CBase. |
|
218 // ?classname( const ?classname& ); |
|
219 // Prohibit assigment operator if not deriving from CBase. |
|
220 // ?classname& operator=( const ?classname& ); |
|
221 |
|
222 public: // Data |
|
223 // ?one_line_short_description_of_data |
|
224 //?data_declaration; |
|
225 |
|
226 protected: // Data |
|
227 // ?one_line_short_description_of_data |
|
228 //?data_declaration; |
|
229 |
|
230 private: // Data |
|
231 // ?one_line_short_description_of_data |
|
232 //?data_declaration; |
|
233 |
|
234 CStifLogger * iLog; |
|
235 |
|
236 // Standard logger |
|
237 CStifLogger *iStdLog; |
|
238 |
|
239 // Logger for currently running test case |
|
240 CStifLogger *iTCLog; |
|
241 |
|
242 // Flag saying if test case title should be added to log file name |
|
243 TBool iAddTestCaseTitleToLogName; |
|
244 |
|
245 // Flag saying if test module version was already sent |
|
246 TBool iVersionLogged; |
|
247 |
|
248 // Reserved pointer for future extension |
|
249 //TAny* iReserved; |
|
250 |
|
251 public: // Friend classes |
|
252 //?friend_class_declaration; |
|
253 protected: // Friend classes |
|
254 //?friend_class_declaration; |
|
255 private: // Friend classes |
|
256 //?friend_class_declaration; |
|
257 |
|
258 }; |
|
259 |
|
260 #endif // TESTMODULEXXX_H |
|
261 |
|
262 // End of File |