Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef WIDECHARCLASSAPIBCTEST_H
20 #define WIDECHARCLASSAPIBCTEST_H
23 #include "StifTestModule.h"
24 #include <StifLogger.h>
25 #include <stl\_cwchar.h>
28 //const ?type ?constant_var = ?constant;
31 //#define ?macro ?macro_def
32 #define TEST_MODULE_VERSION_MAJOR 50
33 #define TEST_MODULE_VERSION_MINOR 9
34 #define TEST_MODULE_VERSION_BUILD 06
37 _LIT( KwidecharclassapiBCTestLogPath, "\\logs\\testframework\\widecharclassapiBCTest\\" );
39 _LIT( KwidecharclassapiBCTestLogFile, "widecharclassapiBCTest.txt" );
40 _LIT( KwidecharclassapiBCTestLogFileWithTitle, "widecharclassapiBCTest_[%S].txt" );
43 #define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
44 #define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
45 #define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
46 #define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
48 // FUNCTION PROTOTYPES
49 //?type ?function_name(?arg_list);
51 // FORWARD DECLARATIONS
52 //class ?FORWARD_CLASSNAME;
53 class CwidecharclassapiBCTest;
57 //typedef ?declaration
59 // A typedef for function that does the actual testing,
61 // TInt CwidecharclassapiBCTest::<NameOfFunction> ( TTestResult& aResult )
62 typedef TInt (CwidecharclassapiBCTest::* TestFunction)(TTestResult&);
67 * An internal structure containing a test case name and
68 * the pointer to function doing the test
71 * @since ?Series60_version
73 class TCaseInfoInternal
76 const TText* iCaseName;
79 TInt iFirstMemoryAllocation;
80 TInt iLastMemoryAllocation;
86 * A structure containing a test case name and
87 * the pointer to function doing the test
90 * @since ?Series60_version
98 TInt iFirstMemoryAllocation;
99 TInt iLastMemoryAllocation;
101 TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
111 * This a widecharclassapiBCTest class.
112 * ?other_description_lines
115 * @since ?Series60_version
117 NONSHARABLE_CLASS(CwidecharclassapiBCTest) : public CTestModuleBase
119 public: // Constructors and destructor
123 * Two-phased constructor.
125 static CwidecharclassapiBCTest* NewL();
130 virtual ~CwidecharclassapiBCTest();
132 public: // New functions
135 * ?member_description.
136 * @since ?Series60_version
137 * @param ?arg1 ?description
138 * @return ?description
140 //?type ?member_function( ?type ?arg1 );
142 public: // Functions from base classes
145 * From CTestModuleBase InitL is used to initialize the
146 * widecharclassapiBCTest. It is called once for every instance of
147 * TestModulewidecharclassapiBCTest after its creation.
148 * @since ?Series60_version
149 * @param aIniFile Initialization file for the test module (optional)
150 * @param aFirstTime Flag is true when InitL is executed for first
151 * created instance of widecharclassapiBCTest.
152 * @return Symbian OS error code
154 TInt InitL( TFileName& aIniFile, TBool aFirstTime );
157 * From CTestModuleBase GetTestCasesL is used to inquiry test cases
158 * from widecharclassapiBCTest.
159 * @since ?Series60_version
160 * @param aTestCaseFile Test case file (optional)
161 * @param aTestCases Array of TestCases returned to test framework
162 * @return Symbian OS error code
164 TInt GetTestCasesL( const TFileName& aTestCaseFile,
165 RPointerArray<TTestCaseInfo>& aTestCases );
168 * From CTestModuleBase RunTestCaseL is used to run an individual
170 * @since ?Series60_version
171 * @param aCaseNumber Test case number
172 * @param aTestCaseFile Test case file (optional)
173 * @param aResult Test case result returned to test framework (PASS/FAIL)
174 * @return Symbian OS error code (test case execution error, which is
175 * not reported in aResult parameter as test case failure).
177 TInt RunTestCaseL( const TInt aCaseNumber,
178 const TFileName& aTestCaseFile,
179 TTestResult& aResult );
182 * From CTestModuleBase; OOMTestQueryL is used to specify is particular
183 * test case going to be executed using OOM conditions
184 * @param aTestCaseFile Test case file (optional)
185 * @param aCaseNumber Test case number (optional)
186 * @param aFailureType OOM failure type (optional)
187 * @param aFirstMemFailure The first heap memory allocation failure value (optional)
188 * @param aLastMemFailure The last heap memory allocation failure value (optional)
191 virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */,
192 const TInt /* aCaseNumber */,
193 TOOMFailureType& aFailureType,
194 TInt& /* aFirstMemFailure */,
195 TInt& /* aLastMemFailure */ );
198 * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
200 * @param aTestCaseFile Test case file (optional)
201 * @param aCaseNumber Test case number (optional)
204 virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */,
205 const TInt /* aCaseNumber */ );
208 * From CTestModuleBase; OOMHandleWarningL
209 * @param aTestCaseFile Test case file (optional)
210 * @param aCaseNumber Test case number (optional)
211 * @param aFailNextValue FailNextValue for OOM test execution (optional)
214 * User may add implementation for OOM test warning handling. Usually no
215 * implementation is required.
217 virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
218 const TInt /* aCaseNumber */,
219 TInt& /* aFailNextValue */);
222 * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
224 * @param aTestCaseFile Test case file (optional)
225 * @param aCaseNumber Test case number (optional)
229 virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */,
230 const TInt /* aCaseNumber */ );
233 * Method used to log version of test module
235 void SendTestModuleVersion();
237 protected: // New functions
240 * ?member_description.
241 * @since ?Series60_version
242 * @param ?arg1 ?description
243 * @return ?description
245 //?type ?member_function( ?type ?arg1 );
247 protected: // Functions from base classes
250 * From ?base_class ?member_description
252 //?type ?member_function();
257 * C++ default constructor.
259 CwidecharclassapiBCTest();
262 * By default Symbian 2nd phase constructor is private.
266 // Prohibit copy constructor if not deriving from CBase.
267 // ?classname( const ?classname& );
268 // Prohibit assigment operator if not deriving from CBase.
269 // ?classname& operator=( const ?classname& );
272 * Function returning test case name and pointer to test case function.
273 * @since ?Series60_version
274 * @param aCaseNumber test case number
277 const TCaseInfo Case ( const TInt aCaseNumber ) const;
280 * [test case declarations] - do not remove
282 //ADD NEW METHOD DEC HERE"
285 * Printing test case.
286 * @since ?Series60_version
287 * @param aResult Test case result (PASS/FAIL)
288 * @return Symbian OS error code (test case execution error
289 * that is not returned as test case result in aResult)
291 TInt PrintTest( TTestResult& aResult );
294 * Printing loop test case.
295 * @since ?Series60_version
296 * @param aResult Test case result (PASS/FAIL)
297 * @return Symbian OS error code (test case execution error
298 * that is not returned as test case result in aResult)
300 TInt LoopTest( TTestResult& aResult );
302 TInt ArithmeticTest( TTestResult& aResult );
303 TInt FileManipulationTest( TTestResult& aResult );
304 TInt ConsoleOperationsTest( TTestResult& aResult );
305 TInt StringOperationsTest( TTestResult& aResult );
306 TInt ConversionOperationsTest( TTestResult& aResult );
309 // ?one_line_short_description_of_data
313 // ?one_line_short_description_of_data
317 // Pointer to test (function) to be executed
318 TestFunction iMethod;
324 CStifLogger* iStdLog;
329 // Flag saying if test case title should be added to log file name
330 TBool iAddTestCaseTitleToLogName;
332 // Flag saying if version of test module was already sent
333 TBool iVersionLogged;
335 // ?one_line_short_description_of_data
338 // Reserved pointer for future extension
341 public: // Friend classes
342 //?friend_class_declaration;
343 protected: // Friend classes
344 //?friend_class_declaration;
345 private: // Friend classes
346 //?friend_class_declaration;
350 #endif // WIDECHARCLASSAPIBCTEST_H