camerasrv_plat/imaging_configuration_manager_api/tsrc/inc/ICMSTIF.h
changeset 0 9b3e960ffc8a
child 42 605672cc2a86
equal deleted inserted replaced
-1:000000000000 0:9b3e960ffc8a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  ICMSTIF test module.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ICMSTIF_H
       
    21 #define ICMSTIF_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "StifTestModule.h"
       
    25 #include <StifLogger.h>
       
    26 #include "imagingconfigmanager.h"
       
    27 
       
    28 // CONSTANTS
       
    29 //const ?type ?constant_var = ?constant;
       
    30 
       
    31 // MACROS
       
    32 // Function pointer related internal definitions
       
    33 // Hack around known GCC bug.
       
    34 #ifndef __GCC32__
       
    35 #define GETPTR
       
    36 #else
       
    37 #define GETPTR &
       
    38 #endif  
       
    39 #define ENTRY(str,func) {(TText*)L##str, GETPTR func}
       
    40 
       
    41 
       
    42 // Logging path
       
    43 _LIT( KICMSTIFLogPath, "\\logs\\testframework\\ICMSTIF\\" ); 
       
    44 // Log file
       
    45 _LIT( KICMSTIFLogFile, "ICMSTIF.txt" ); 
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 class CICMSTIF;
       
    49 
       
    50 // DATA TYPES
       
    51 typedef TInt (CICMSTIF::* TestFunction)(TTestResult&);    
       
    52 
       
    53 //enum ?declaration
       
    54 //typedef ?declaration
       
    55 //extern ?data_type;
       
    56 /**
       
    57 *  An internal structure containing a test case name and
       
    58 *  the pointer to function doing the test
       
    59 *
       
    60 */
       
    61 class TCaseInfoInternal
       
    62     {
       
    63     public:
       
    64         const TText* iCaseName;
       
    65         TestFunction iMethod;
       
    66     };
       
    67 
       
    68 /**
       
    69 *  A structure containing a test case name and
       
    70 *  the pointer to function doing the test
       
    71 *
       
    72 */
       
    73 class TCaseInfo
       
    74     {
       
    75     public:
       
    76         TPtrC iCaseName;    
       
    77         TestFunction iMethod;
       
    78 
       
    79     TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
       
    80         {        
       
    81         };
       
    82 
       
    83     };
       
    84 
       
    85 // FUNCTION PROTOTYPES
       
    86 //?type ?function_name(?arg_list);
       
    87 
       
    88 // FORWARD DECLARATIONS
       
    89 //class ?FORWARD_CLASSNAME;
       
    90 
       
    91 // CLASS DECLARATION
       
    92 
       
    93 /**
       
    94 *  This a ICMSTIF class.
       
    95 *  ?other_description_lines
       
    96 *
       
    97 *  @lib ?library
       
    98 *  @since ?Series60_version
       
    99 */
       
   100 NONSHARABLE_CLASS(CICMSTIF) : public CTestModuleBase
       
   101     {
       
   102     public:  // Constructors and destructor
       
   103 
       
   104         /**
       
   105         * Two-phased constructor.
       
   106         */
       
   107         static CICMSTIF* NewL();
       
   108 
       
   109         /**
       
   110         * Destructor.
       
   111         */
       
   112         virtual ~CICMSTIF();
       
   113 
       
   114     public: // New functions
       
   115 
       
   116         /**
       
   117         * ?member_description.
       
   118         * @since ?Series60_version
       
   119         * @param ?arg1 ?description
       
   120         * @return ?description
       
   121         */
       
   122         //?type ?member_function( ?type ?arg1 );
       
   123 
       
   124     public: // Functions from base classes
       
   125 
       
   126         /**
       
   127         * From CTestModuleBase InitL is used to initialize the ICMSTIF. 
       
   128         *       It is called once for every instance of ICMSTIF after
       
   129         *       its creation.
       
   130         * @since ?Series60_version
       
   131         * @param aIniFile Initialization file for the test module (optional)
       
   132         * @param aFirstTime Flag is true when InitL is executed for first 
       
   133         *               created instance of ICMSTIF.
       
   134         * @return Symbian OS error code
       
   135         */
       
   136         TInt InitL( TFileName& aIniFile, TBool aFirstTime );
       
   137 
       
   138         /**
       
   139         * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
       
   140         *   from ICMSTIF. 
       
   141         * @since ?Series60_version
       
   142         * @param aTestCaseFile Test case file (optional)
       
   143         * @param aTestCases  Array of TestCases returned to test framework
       
   144         * @return Symbian OS error code
       
   145         */
       
   146         TInt GetTestCasesL( const TFileName& aTestCaseFile, 
       
   147                             RPointerArray<TTestCaseInfo>& aTestCases );
       
   148 
       
   149         /**
       
   150         * From CTestModuleBase RunTestCaseL is used to run an individual 
       
   151         *   test case. 
       
   152         * @since ?Series60_version
       
   153         * @param aCaseNumber Test case number
       
   154         * @param aTestCaseFile Test case file (optional)
       
   155         * @param aResult Test case result returned to test framework (PASS/FAIL)
       
   156         * @return Symbian OS error code (test case execution error, which is 
       
   157         *           not reported in aResult parameter as test case failure).
       
   158         */   
       
   159         TInt RunTestCaseL( const TInt aCaseNumber, 
       
   160                            const TFileName& aTestCaseFile,
       
   161                            TTestResult& aResult );
       
   162 
       
   163         /**
       
   164         * From CTestModuleBase; OOMTestQueryL is used to specify is particular
       
   165         * test case going to be executed using OOM conditions
       
   166         * @param aTestCaseFile Test case file (optional)
       
   167         * @param aCaseNumber Test case number (optional)
       
   168         * @param aFailureType OOM failure type (optional)
       
   169         * @param aFirstMemFailure The first heap memory allocation failure value (optional)
       
   170         * @param aLastMemFailure The last heap memory allocation failure value (optional)
       
   171         * @return TBool
       
   172         */
       
   173         virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
       
   174                                      const TInt /* aCaseNumber */, 
       
   175                                      TOOMFailureType& /* aFailureType */,
       
   176                                      TInt& /* aFirstMemFailure */, 
       
   177                                      TInt& /* aLastMemFailure */ );
       
   178 
       
   179         /**
       
   180         * From CTestModuleBase; User may add implementation for OOM test 
       
   181         * environment initialization. Usually no implementation is required.
       
   182         * @param aTestCaseFile Test case file (optional)
       
   183         * @param aCaseNumber Test case number (optional)
       
   184         * @return None
       
   185         */
       
   186         virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
       
   187                                     const TInt /* aCaseNumber */ ); 
       
   188 
       
   189         /**
       
   190         * From CTestModuleBase; OOMHandleWarningL. User may add implementation 
       
   191         * for OOM test warning handling. Usually no implementation is required.
       
   192         * @param aTestCaseFile Test case file (optional)
       
   193         * @param aCaseNumber Test case number (optional)
       
   194         * @param aFailNextValue FailNextValue for OOM test execution (optional)
       
   195         * @return None
       
   196         */
       
   197         virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
       
   198                                         const TInt /* aCaseNumber */, 
       
   199                                         TInt& /* aFailNextValue */);
       
   200 
       
   201         /**
       
   202         * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
       
   203         * test environment. Usually no implementation is required.
       
   204         * @param aTestCaseFile Test case file (optional)
       
   205         * @param aCaseNumber Test case number (optional)
       
   206         * @return None
       
   207         */
       
   208         virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
       
   209                                        const TInt /* aCaseNumber */ );
       
   210 
       
   211     protected:  // New functions
       
   212 
       
   213         /**
       
   214         * ?member_description.
       
   215         * @since ?Series60_version
       
   216         * @param ?arg1 ?description
       
   217         * @return ?description
       
   218         */
       
   219         //?type ?member_function( ?type ?arg1 );
       
   220 
       
   221     protected:  // Functions from base classes
       
   222 
       
   223         /**
       
   224         * From ?base_class ?member_description
       
   225         */
       
   226         //?type ?member_function();
       
   227 
       
   228     private:
       
   229 
       
   230         /**
       
   231         * C++ default constructor.
       
   232         */
       
   233         CICMSTIF();
       
   234 
       
   235         /**
       
   236         * By default Symbian 2nd phase constructor is private.
       
   237         */
       
   238         void ConstructL();
       
   239 
       
   240         // Prohibit copy constructor if not deriving from CBase.
       
   241         // ?classname( const ?classname& );
       
   242         // Prohibit assigment operator if not deriving from CBase.
       
   243         // ?classname& operator=( const ?classname& );
       
   244 
       
   245         /**
       
   246         * Function returning test case name and pointer to test case function.
       
   247         * @since ?Series60_version
       
   248         * @param aCaseNumber test case number
       
   249         * @return TCaseInfo 
       
   250         */
       
   251         const TCaseInfo Case ( const TInt aCaseNumber ) const;
       
   252 
       
   253         /**
       
   254         * Test cases
       
   255         */
       
   256 		TInt TestCase_001L( TTestResult& aResult );
       
   257 		TInt TestCase_002L( TTestResult& aResult );
       
   258 		TInt TestCase_003L( TTestResult& aResult );
       
   259 		TInt TestCase_004L( TTestResult& aResult );
       
   260 		TInt TestCase_005L( TTestResult& aResult );
       
   261 		TInt TestCase_006L( TTestResult& aResult );
       
   262 		TInt TestCase_007L( TTestResult& aResult );
       
   263 		TInt TestCase_008L( TTestResult& aResult );
       
   264 		TInt TestCase_009L( TTestResult& aResult );
       
   265 		TInt TestCase_010L( TTestResult& aResult );
       
   266 		TInt TestCase_OOML( TTestResult& aResult );
       
   267 		
       
   268 		
       
   269 		void AllocFailureSimulation (TBool aSwitchedOn);
       
   270 		void SetAllocFailureSimulation( RHeap::TAllocFail aAllocFailureType, TInt aAllocFailureRate );
       
   271 
       
   272     public:     // Data
       
   273         // Pointer to test (function) to be executed
       
   274         TestFunction iMethod;
       
   275 
       
   276     protected:  // Data
       
   277         // ?one_line_short_description_of_data
       
   278         //?data_declaration;
       
   279 
       
   280     private:    // Data
       
   281         // ?one_line_short_description_of_data
       
   282         //?data_declaration;
       
   283 
       
   284         CStifLogger * iLog;
       
   285         RHeap::TAllocFail iAllocFailureType;
       
   286         TInt iAllocFailureRate;
       
   287         TInt iCurrentAllocFailureRate;
       
   288         TBool iMemTestEnabled;
       
   289 
       
   290         // Reserved pointer for future extension
       
   291         //TAny* iReserved;
       
   292 
       
   293     public:     // Friend classes
       
   294         //?friend_class_declaration;
       
   295     protected:  // Friend classes
       
   296         //?friend_class_declaration;
       
   297     private:    // Friend classes
       
   298         //?friend_class_declaration;
       
   299 
       
   300     };
       
   301 
       
   302 #endif      // ICMSTIF_H
       
   303 
       
   304 // End of File