mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/inc/AudioStreamTestApp.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     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:  AudioInputStreamTestApp test module.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef AUDIO_STREAM_TESTAPP_H
       
    21 #define AUDIO_STREAM_TESTAPP_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "StifTestModule.h"
       
    25 #include <StifLogger.h>
       
    26 #include <StifParser.h>
       
    27 #include <f32file.h>
       
    28 #include <s32file.h>
       
    29 
       
    30 #include <MdaAudioTonePlayer.h>
       
    31 #include "AudioStreamConstants.h"
       
    32 
       
    33 // CONSTANTS
       
    34 //const ?type ?constant_var = ?constant;
       
    35 
       
    36     
       
    37 // MACROS
       
    38 //#define ?macro ?macro_def
       
    39 
       
    40 // Logging path
       
    41 //_LIT( KAudioInputStreamTestAppLogPath, "\\logs\\testframework\\AudioInputStreamTestApp\\" ); 
       
    42 // Log file
       
    43 //_LIT( KAudioInputStreamTestAppLogFile, "AudioInputStreamTestApp.txt" ); 
       
    44 
       
    45 // DATA TYPES
       
    46 //enum ?declaration
       
    47 //typedef ?declaration
       
    48 //extern ?data_type;
       
    49 
       
    50 // FUNCTION PROTOTYPES
       
    51 //?type ?function_name(?arg_list);
       
    52 
       
    53 // FORWARD DECLARATIONS
       
    54 //class ?FORWARD_CLASSNAME;
       
    55 
       
    56 // CLASS DECLARATION
       
    57 
       
    58 /**
       
    59 *  This a AudioInputStreamTestApp class.
       
    60 *  ?other_description_lines
       
    61 *
       
    62 *  @lib ?library
       
    63 *  @since ?Series60_version
       
    64 */
       
    65 NONSHARABLE_CLASS(CAudioStreamTestApp) : public CTestModuleBase
       
    66     {
       
    67     public:  // Constructors and destructor
       
    68 
       
    69         /**
       
    70         * Two-phased constructor.
       
    71         */
       
    72         static CAudioStreamTestApp* NewL();
       
    73 
       
    74         /**
       
    75         * Destructor.
       
    76         */
       
    77         virtual ~CAudioStreamTestApp();
       
    78 
       
    79     public: // New functions
       
    80 
       
    81         /**
       
    82         * ?member_description.
       
    83         * @since ?Series60_version
       
    84         * @param ?arg1 ?description
       
    85         * @return ?description
       
    86         */
       
    87         //?type ?member_function( ?type ?arg1 );
       
    88 
       
    89     public: // Functions from base classes
       
    90 
       
    91         /**
       
    92         * From CTestModuleBase InitL is used to initialize the AudioInputStreamTestApp. 
       
    93         *       It is called once for every instance of AudioInputStreamTestApp after
       
    94         *       its creation.
       
    95         * @since ?Series60_version
       
    96         * @param aIniFile Initialization file for the test module (optional)
       
    97         * @param aFirstTime Flag is true when InitL is executed for first 
       
    98         *               created instance of AudioInputStreamTestApp.
       
    99         * @return Symbian OS error code
       
   100         */
       
   101         TInt InitL( TFileName& aIniFile, TBool aFirstTime );
       
   102 
       
   103         /**
       
   104         * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
       
   105         *   from AudioInputStreamTestApp. 
       
   106         * @since ?Series60_version
       
   107         * @param aTestCaseFile Test case file (optional)
       
   108         * @param aTestCases  Array of TestCases returned to test framework
       
   109         * @return Symbian OS error code
       
   110         */
       
   111         TInt GetTestCasesL( const TFileName& aTestCaseFile, 
       
   112                             RPointerArray<TTestCaseInfo>& aTestCases );
       
   113 
       
   114         /**
       
   115         * From CTestModuleBase RunTestCaseL is used to run an individual 
       
   116         *   test case. 
       
   117         * @since ?Series60_version
       
   118         * @param aCaseNumber Test case number
       
   119         * @param aTestCaseFile Test case file (optional)
       
   120         * @param aResult Test case result returned to test framework (PASS/FAIL)
       
   121         * @return Symbian OS error code (test case execution error, which is 
       
   122         *           not reported in aResult parameter as test case failure).
       
   123         */   
       
   124         TInt RunTestCaseL( const TInt aCaseNumber, 
       
   125                            const TFileName& aTestCaseFile,
       
   126                            TTestResult& aResult );
       
   127 
       
   128         /**
       
   129         * From CTestModuleBase; OOMTestQueryL is used to specify is particular
       
   130         * test case going to be executed using OOM conditions
       
   131         * @param aTestCaseFile Test case file (optional)
       
   132         * @param aCaseNumber Test case number (optional)
       
   133         * @param aFailureType OOM failure type (optional)
       
   134         * @param aFirstMemFailure The first heap memory allocation failure value (optional)
       
   135         * @param aLastMemFailure The last heap memory allocation failure value (optional)
       
   136         * @return TBool
       
   137         */
       
   138         virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
       
   139                                      const TInt /* aCaseNumber */, 
       
   140                                      TOOMFailureType& /* aFailureType */,
       
   141                                      TInt& /* aFirstMemFailure */, 
       
   142                                      TInt& /* aLastMemFailure */ );
       
   143 
       
   144         /**
       
   145         * From CTestModuleBase; User may add implementation for OOM test 
       
   146         * environment initialization. Usually no implementation is required.
       
   147         * @param aTestCaseFile Test case file (optional)
       
   148         * @param aCaseNumber Test case number (optional)
       
   149         * @return None
       
   150         */
       
   151         virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
       
   152                                     const TInt /* aCaseNumber */ ); 
       
   153 
       
   154         /**
       
   155         * From CTestModuleBase; OOMHandleWarningL. User may add implementation 
       
   156         * for OOM test warning handling. Usually no implementation is required.
       
   157         * @param aTestCaseFile Test case file (optional)
       
   158         * @param aCaseNumber Test case number (optional)
       
   159         * @param aFailNextValue FailNextValue for OOM test execution (optional)
       
   160         * @return None
       
   161         */
       
   162         virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
       
   163                                         const TInt /* aCaseNumber */, 
       
   164                                         TInt& /* aFailNextValue */);
       
   165 
       
   166         /**
       
   167         * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
       
   168         * test environment. Usually no implementation is required.
       
   169         * @param aTestCaseFile Test case file (optional)
       
   170         * @param aCaseNumber Test case number (optional)
       
   171         * @return None
       
   172         */
       
   173         virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
       
   174                                        const TInt /* aCaseNumber */ );
       
   175 
       
   176     protected:  // New functions
       
   177 
       
   178         /**
       
   179         * ?member_description.
       
   180         * @since ?Series60_version
       
   181         * @param ?arg1 ?description
       
   182         * @return ?description
       
   183         */
       
   184         //?type ?member_function( ?type ?arg1 );
       
   185         
       
   186 		HBufC8 *GetDescriptor8LC(const TFileName &aFileName);
       
   187 		TInt GetIntL(CStifSectionParser *aSection, const TDesC &aTag, TBool &aUsingDefault, const TInt &aDefaultInt, TBool aContinue=EFalse) ;
       
   188 		TTimeIntervalMicroSeconds32 GetTimeIntervalL(CStifSectionParser *aSection, const TDesC &aTag, TBool &aUsingDefault, const TTimeIntervalMicroSeconds32 &aDefaultInterval, TBool aContinue=EFalse);
       
   189         void InitLoggerL( const TFileName& aLogPath , const TFileName& aLogFile );
       
   190 		void InitLoggerL();
       
   191 		TInt RunTestCaseFunctionL(TInt id, CStifSectionParser *aSection, TTestResult &aResult);
       
   192 
       
   193         TInt TestCaseInputNewL(CStifSectionParser *aSection, TTestResult & aResult);
       
   194         TInt TestCaseInputNewWithParamL(CStifSectionParser *aSection, TTestResult & aResult);
       
   195         TInt TestCaseInputSetPropL(CStifSectionParser *aSection, TTestResult & aResult);
       
   196         TInt TestCaseInputSetGainL(CStifSectionParser *aSection, TTestResult & aResult);
       
   197         TInt TestCaseInputSetBalanceL(CStifSectionParser *aSection, TTestResult & aResult);
       
   198         TInt TestCaseInputSetPriorityL(CStifSectionParser *aSection, TTestResult & aResult);
       
   199         TInt TestCaseInputSetDataTypeL(CStifSectionParser *aSection, TTestResult & aResult);
       
   200         TInt TestCaseInputOpenL(CStifSectionParser *aSection, TTestResult & aResult);
       
   201         TInt TestCaseInputRecordL(CStifSectionParser *aSection, TTestResult & aResult);
       
   202         TInt TestCaseInputBitRateL(CStifSectionParser *aSection, TTestResult & aResult);
       
   203 
       
   204         TInt TestCaseOutputNewL(CStifSectionParser *aSection, TTestResult & aResult);
       
   205         TInt TestCaseOutputNewWithParamL(CStifSectionParser *aSection, TTestResult & aResult);
       
   206         TInt TestCaseOutputSetPropL(CStifSectionParser *aSection, TTestResult & aResult);
       
   207         TInt TestCaseOutputOpenL(CStifSectionParser *aSection, TTestResult & aResult);
       
   208         TInt TestCaseOutputSetVolumeL(CStifSectionParser *aSection, TTestResult & aResult);
       
   209         TInt TestCaseOutputSetPriorityL(CStifSectionParser *aSection, TTestResult & aResult);
       
   210         TInt TestCaseOutputPlayL(CStifSectionParser *aSection, TTestResult & aResult);
       
   211         TInt TestCaseOutputSetBalanceL(CStifSectionParser *aSection, TTestResult & aResult);
       
   212         TInt TestCaseOutputSetDataTypeL(CStifSectionParser *aSection, TTestResult & aResult);
       
   213         TInt TestCaseOutputStopL(CStifSectionParser *aSection, TTestResult & aResult);
       
   214 
       
   215 		//void testPlay (COutputStreamer *os1, CStifSectionParser *section, TTestResult & aResult);
       
   216 
       
   217     protected:  // Functions from base classes
       
   218 
       
   219         /**
       
   220         * From ?base_class ?member_description
       
   221         */
       
   222         //?type ?member_function();
       
   223 
       
   224     private:
       
   225 
       
   226         /**
       
   227         * C++ default constructor.
       
   228         */
       
   229         CAudioStreamTestApp();
       
   230 
       
   231         /**
       
   232         * By default Symbian 2nd phase constructor is private.
       
   233         */
       
   234         void ConstructL();
       
   235 
       
   236         // Prohibit copy constructor if not deriving from CBase.
       
   237         // ?classname( const ?classname& );
       
   238         // Prohibit assigment operator if not deriving from CBase.
       
   239         // ?classname& operator=( const ?classname& );
       
   240 		TMdaPriorityPreference IntToPriorityPreference (TInt aPriorityPreference) ;
       
   241 		TDesC& GetErrorDes(TInt aErr);
       
   242 
       
   243     public:     // Data
       
   244         // ?one_line_short_description_of_data
       
   245         //?data_declaration;
       
   246     	RFs				iFs;
       
   247 		RFile			iFile;
       
   248 
       
   249     protected:  // Data
       
   250         // ?one_line_short_description_of_data
       
   251         //?data_declaration;
       
   252 
       
   253     private:    // Data
       
   254         // ?one_line_short_description_of_data
       
   255         //?data_declaration;
       
   256         static const TInt MAX_TESTCASE_ID;
       
   257 
       
   258 		static const TInt KToneMinCaseId;
       
   259 		static const TInt KToneMaxCaseId;
       
   260 
       
   261 		static const TInt KTestCaseCallbacks;
       
   262 		static const TInt KTestCaseVolume;
       
   263 		static const TInt KTestCaseBalance;
       
   264 		static const TInt KTestCaseOutputPriorities;
       
   265 		static const TInt KTestCaseInputPriorities;
       
   266 
       
   267         static const TInt KTestCaseInputNew;
       
   268         static const TInt KTestCaseInputNewWithParam;
       
   269         static const TInt KTestCaseInputSetAudioProperties;
       
   270         static const TInt KTestCaseInputSetGain;
       
   271         static const TInt KTestCaseInputSetBalance;
       
   272         static const TInt KTestCaseInputSetPriority;
       
   273         static const TInt KTestCaseInputSetDataType;
       
   274         static const TInt KTestCaseInputOpen;
       
   275         static const TInt KTestCaseInputRecord;
       
   276         static const TInt KTestCaseInputBitRate;
       
   277         
       
   278         static const TInt KTestCaseOutputNew;
       
   279         static const TInt KTestCaseOutputNewWithParam;
       
   280         static const TInt KTestCaseOutputSetAudioProperties;
       
   281         static const TInt KTestCaseOutputOpen;
       
   282         static const TInt KTestCaseOutputSetVolume;
       
   283         static const TInt KTestCaseOutputSetPriority;
       
   284         static const TInt KTestCaseOutputPlay;
       
   285         static const TInt KTestCaseOutputSetBalance;
       
   286         static const TInt KTestCaseOutputSetDataType;
       
   287         static const TInt KTestCaseOutputStop;
       
   288 
       
   289         CStifLogger * iLogger;
       
   290 		CActiveScheduler* iScheduler;
       
   291 
       
   292 		TBuf<50>	iErrName[47];
       
   293 		TBuf<50>    iErrBuf;
       
   294 		
       
   295         // Reserved pointer for future extension
       
   296         //TAny* iReserved;
       
   297 
       
   298     public:     // Friend classes
       
   299         //?friend_class_declaration;
       
   300     protected:  // Friend classes
       
   301         //?friend_class_declaration;
       
   302     private:    // Friend classes
       
   303         //?friend_class_declaration;
       
   304 
       
   305     };
       
   306 
       
   307 #endif      // AUDIO_STREAM_TESTAPP_H
       
   308 
       
   309 // End of File