stif/TestCombiner/inc/TestCombinerUtils.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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: This file contains the header file of the 
       
    15 * TestCombinerUtils.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TESTCOMBINERUTILS_H
       
    20 #define TESTCOMBINERUTILS_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 #include <StifTestInterface.h>
       
    27 
       
    28 #include "TestCombinerEvent.h"
       
    29 
       
    30 // CONSTANTS
       
    31 // None
       
    32 
       
    33 // MACROS
       
    34 // None
       
    35 
       
    36 // DATA TYPES
       
    37 // None
       
    38 
       
    39 // FUNCTION PROTOTYPES
       
    40 // None
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 // None
       
    44     
       
    45 // CLASS DECLARATION
       
    46 
       
    47 // DESCRIPTION
       
    48 // Testcase starting information
       
    49 NONSHARABLE_CLASS(CStartInfo)
       
    50     :public CBase
       
    51     {
       
    52     public: // Constructors and destructor
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static CStartInfo* NewL();
       
    57         
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CStartInfo();
       
    62             
       
    63     public: // New functions
       
    64         /**
       
    65         * Set module name.
       
    66         */
       
    67         void SetModuleNameL( TDesC& aModule, TInt aExtLength=0 );
       
    68             
       
    69         /**
       
    70         * Set initialization file name.
       
    71         */
       
    72         void SetIniFileL( TDesC& aIni );
       
    73             
       
    74         /**
       
    75         * Set configuration file name.
       
    76         */
       
    77         void SetConfigL( TDesC& aConfig );
       
    78             
       
    79         /**
       
    80         * Set test identifier.
       
    81         */
       
    82         void SetTestIdL( TDesC& aTestId );
       
    83 
       
    84         /**
       
    85         * Delete module name buffer for creating new module name.
       
    86         */
       
    87         void DeleteModuleName();
       
    88         
       
    89         /**
       
    90         * Set test case title.
       
    91         */
       
    92         void SetTitleL(TDesC& aTitle);
       
    93 
       
    94         /**
       
    95          * Sets test case arguments.
       
    96          */
       
    97         void SetTestCaseArgumentsL( const TDesC& aTestCaseArguments );
       
    98 
       
    99     private:
       
   100         /**
       
   101         * C++ default constructor.
       
   102         */
       
   103         CStartInfo();
       
   104                     
       
   105         /**
       
   106         * By default Symbian OS constructor is private.
       
   107         */
       
   108         void ConstructL();
       
   109                 
       
   110     public:
       
   111         TPtr    iModule;
       
   112         TPtrC   iIniFile;
       
   113         TPtrC   iConfig;
       
   114         TPtrC   iTestId;
       
   115         TInt    iCaseNum;
       
   116         TInt    iExpectedResult;
       
   117         TFullTestResult::TCaseExecutionResult iCategory;
       
   118         TInt    iTimeout;
       
   119         TPtrC   iTitle;
       
   120 		TPtrC   iTestCaseArguments;
       
   121         
       
   122     private:
       
   123         HBufC*  iModuleBuf;
       
   124         HBufC*  iIniFileBuf;
       
   125         HBufC*  iConfigBuf;
       
   126         HBufC*  iTestIdBuf;
       
   127         HBufC*  iTitleBuf;
       
   128         HBufC*  iTestCaseArgumentsBuf;
       
   129     };
       
   130     
       
   131 // CLASS DECLARATION
       
   132 
       
   133 // DESCRIPTION
       
   134 // Slave information structure
       
   135 NONSHARABLE_CLASS(CSlaveInfo)
       
   136     :public CBase
       
   137     {
       
   138     public:
       
   139         enum TSlaveState
       
   140             {
       
   141             ESlaveIdle,
       
   142             ESlaveReserveSent,
       
   143             ESlaveReserved,
       
   144             ESlaveReleaseSent,
       
   145             ESlaveReleased,
       
   146             };        
       
   147             
       
   148     public: // Constructors and destructor
       
   149         /**
       
   150         * Two-phased constructor.
       
   151         */
       
   152         static CSlaveInfo* NewL( TDesC& aName, TUint32 aMaster );
       
   153         
       
   154         /**
       
   155         * Destructor.
       
   156         */
       
   157         virtual ~CSlaveInfo();
       
   158             
       
   159     public:            
       
   160         
       
   161         /**
       
   162         * Get event name requested from slave.
       
   163         */    
       
   164         TEventTc* GetEvent( TDesC& aEventName );
       
   165         
       
   166     private:
       
   167         /**
       
   168         * C++ default constructor.
       
   169         */
       
   170         CSlaveInfo( TUint32 aMaster );
       
   171         
       
   172         /**
       
   173         * By default Symbian OS constructor is private.
       
   174         */
       
   175         void ConstructL( TDesC& aName );
       
   176         
       
   177     public:
       
   178         TInt    iState;
       
   179 
       
   180         TPtrC   iName;
       
   181         TUint32 iMasterId;
       
   182         TUint32 iSlaveDevId;
       
   183         
       
   184         RPointerArray<TEventTc>         iEvents;
       
   185         
       
   186     private:
       
   187         HBufC*  iNameBuf;
       
   188         
       
   189     };     
       
   190 
       
   191 // CLASS DECLARATION
       
   192 
       
   193 // DESCRIPTION
       
   194 // Predefined value entry
       
   195 NONSHARABLE_CLASS(CDefinedValue)
       
   196     :public CBase
       
   197     {
       
   198     public: // Constructors and destructor
       
   199         /**
       
   200         * Two-phased constructor.
       
   201         */
       
   202         static CDefinedValue* NewL( TDesC& aName, TDesC& aValue );
       
   203         
       
   204         /**
       
   205         * Destructor.
       
   206         */
       
   207         virtual ~CDefinedValue();
       
   208 
       
   209     public: // New functions
       
   210         /**
       
   211         * Returns define name.
       
   212         */
       
   213         TDesC& Name();
       
   214         
       
   215         /**
       
   216         * Returns define value.
       
   217         */
       
   218         TDesC& Value();
       
   219         
       
   220         /**
       
   221         * Returns new define value.
       
   222         */
       
   223         void SetValueL( TDesC& aValue );
       
   224 
       
   225     private:
       
   226         /**
       
   227         * C++ default constructor.
       
   228         */
       
   229         CDefinedValue();
       
   230         
       
   231         /**
       
   232         * By default Symbian OS constructor is private.
       
   233         */
       
   234         void ConstructL( TDesC& aName, TDesC& aValue );
       
   235         
       
   236     private: // Data
       
   237         // Define name
       
   238         HBufC* iNameBuf;
       
   239         TPtrC  iName;
       
   240 
       
   241         // Define value
       
   242         HBufC* iValueBuf;
       
   243         TPtrC  iValue;
       
   244 
       
   245     };
       
   246     
       
   247 #endif        // TESTCOMBINERUTILS_H
       
   248 
       
   249 // End of File