diff -r 8b0c979bbe8c -r ac5daea24fb0 keepalive/flextimer/test/testflextimer/docs/html/testflextimer_8h_source.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/keepalive/flextimer/test/testflextimer/docs/html/testflextimer_8h_source.html Wed Oct 27 17:43:56 2010 +0300 @@ -0,0 +1,322 @@ + + + +
+ +00001 /* +00002 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +00003 * All rights reserved. +00004 * This component and the accompanying materials are made available +00005 * under the terms of "Eclipse Public License v1.0" +00006 * which accompanies this distribution, and is available +00007 * at the URL "http://www.eclipse.org/legal/epl-v10.html". +00008 * +00009 * Initial Contributors: +00010 * Nokia Corporation - initial contribution. +00011 * +00012 * Contributors: +00013 * +00014 * Description: STIF normal test module declaration +00015 * +00016 */ +00017 +00018 #ifndef TESTFLEXTIMER_H +00019 #define TESTFLEXTIMER_H +00020 +00021 // INCLUDES +00022 #include "StifTestModule.h" +00023 #include <StifLogger.h> +00024 #include <NormalHardcodedAssert.h> +00025 +00026 // MACROS +00027 #define TEST_MODULE_VERSION_MAJOR 0 +00028 #define TEST_MODULE_VERSION_MINOR 0 +00029 #define TEST_MODULE_VERSION_BUILD 0 +00030 +00031 // Logging path +00032 _LIT( KTestFlexTimerLogPath, "\\logs\\testframework\\TestFlexTimer\\" ); +00033 // Log file +00034 _LIT( KTestFlexTimerLogFile, "TestFlexTimer.txt" ); +00035 _LIT( KTestFlexTimerLogFileWithTitle, "TestFlexTimer_[%S].txt" ); +00036 +00037 _LIT( KTestFlexTimerPanicCategory, "FLEX-TEST" ); +00038 +00039 // Function pointer related internal definitions +00040 #define GETPTR & +00041 #define ENTRY(str,func) {_S(str), GETPTR func,0,0,0} +00042 #define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0} +00043 #define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c} +00044 #define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c} +00045 +00046 +00047 // Forward declaration +00048 class CTestFlexTimer; +00049 +00050 // A typedef for function that does the actual testing, +00051 // function is a type +00052 // TInt CDemoModule::<NameOfFunction> ( TTestResult& aResult, CTestFlexTimer *cb ) +00053 typedef TInt (*TestFunction)(TTestResult&, CTestFlexTimer*); +00054 +00055 const TInt KTimerAccuracyMicroSeconds = 1000 * 1000; //1s - accuracy of symbian At timer. +00056 const double KDefaultWindowMultiplier = 0.2; //default window. defined in flextimersession.cpp +00057 const TUint KTickInMicroSeconds( 1000000 / 64 ); // One tick = 1/64 sec +00058 +00059 +00060 // CLASS DECLARATION +00061 +00069 class TCaseInfoInternal +00070 { +00071 public: +00072 const TText* iCaseName; +00073 TestFunction iMethod; +00074 TBool iIsOOMTest; +00075 TInt iFirstMemoryAllocation; +00076 TInt iLastMemoryAllocation; +00077 }; +00078 +00079 // CLASS DECLARATION +00080 +00088 class TCaseInfo +00089 { +00090 public: +00091 TPtrC iCaseName; +00092 TestFunction iMethod; +00093 TBool iIsOOMTest; +00094 TInt iFirstMemoryAllocation; +00095 TInt iLastMemoryAllocation; +00096 +00097 TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) +00098 { +00099 }; +00100 }; +00101 +00102 //Exteded result that can "return" also status code to CB function +00103 class TExtendedTestResult +00104 { +00105 public: +00106 TTestResult *iTestResult; //the real test result +00107 TInt iStatusCode; //Return code from timer +00108 TBool iCaseAlreadyFailed; +00109 TInt iTimerID; +00110 TInt64 iTimerStartedTime; +00111 TInt64 iTimerStoppedTime; +00112 TInt64 iTimerExpiryTime; +00113 +00114 TExtendedTestResult(TTestResult *aResult) : iTestResult( aResult ), iStatusCode(0), iCaseAlreadyFailed(EFalse), +00115 iTimerID(0), iTimerStartedTime(0), iTimerStoppedTime(0) {}; +00116 }; +00117 // CLASS DECLARATION +00118 +00125 NONSHARABLE_CLASS(CTestFlexTimer) : public CTestModuleBase +00126 { +00127 public: // Constructors and destructor +00128 +00132 static CTestFlexTimer* NewL(); +00133 +00137 virtual ~CTestFlexTimer(); +00138 +00139 public: // Functions from base classes +00140 +00141 +00152 TInt InitL( TFileName& aIniFile, TBool aFirstTime ); +00153 +00162 TInt GetTestCasesL( const TFileName& aTestCaseFile, +00163 RPointerArray<TTestCaseInfo>& aTestCases ); +00164 +00175 TInt RunTestCaseL( const TInt aCaseNumber, +00176 const TFileName& aTestCaseFile, +00177 TTestResult& aResult ); +00178 +00189 virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, +00190 const TInt /* aCaseNumber */, +00191 TOOMFailureType& /* aFailureType */, +00192 TInt& /* aFirstMemFailure */, +00193 TInt& /* aLastMemFailure */ ); +00194 +00202 virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, +00203 const TInt /* aCaseNumber */ ); +00204 +00213 virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, +00214 const TInt /* aCaseNumber */, +00215 TInt& /* aFailNextValue */); +00216 +00224 virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, +00225 const TInt /* aCaseNumber */ ); +00226 +00230 void SendTestModuleVersion(); +00231 +00232 +00233 private: +00234 +00238 CTestFlexTimer(); +00239 +00243 void ConstructL(); +00244 +00248 void CreateTitleLoggerL(void); +00249 +00253 void DeleteTitleLogger(void); +00254 +00261 const TCaseInfo Case( const TInt aCaseNumber ) const; +00262 +00263 //RFlextimer cases +00264 +00276 TInt Funct26( TTestResult& aResult, CTestFlexTimer *cb); +00277 +00289 TInt Funct27( TTestResult& aResult, CTestFlexTimer *cb ); +00290 +00302 TInt Funct28( TTestResult& aResult, CTestFlexTimer *cb ); +00303 +00318 TInt Funct29( TTestResult& aResult, CTestFlexTimer *cb ); +00319 +00320 //CFlexPeriodic cases +00321 +00332 TInt Funct30( TTestResult& aResult, CTestFlexTimer *cb ); +00333 +00345 TInt Funct31( TTestResult& aResult, CTestFlexTimer *cb ); +00346 +00361 TInt Funct32( TTestResult& aResult, CTestFlexTimer *cb ); +00362 +00377 TInt Funct33( TTestResult& aResult, CTestFlexTimer *cb ); +00378 +00393 TInt Funct34( TTestResult& aResult, CTestFlexTimer *cb ); +00394 +00415 TInt Funct35( TTestResult& aResult, CTestFlexTimer *cb ); +00416 +00429 TInt Funct36( TTestResult& aResult, CTestFlexTimer *cb ); +00430 +00443 TInt Funct37( TTestResult& aResult, CTestFlexTimer *cb ); +00444 +00457 TInt Funct38( TTestResult& aResult, CTestFlexTimer *cb ); +00458 +00471 TInt Funct39( TTestResult& aResult, CTestFlexTimer *cb ); +00472 +00485 TInt Funct40( TTestResult& aResult, CTestFlexTimer *cb ); +00486 +00499 TInt Funct41( TTestResult& aResult, CTestFlexTimer *cb ); +00500 +00514 TInt Funct42( TTestResult& aResult, CTestFlexTimer *cb ); +00515 +00531 TInt Funct43( TTestResult& aResult, CTestFlexTimer *cb ); +00532 +00554 TInt Funct44( TTestResult& aResult, CTestFlexTimer *cb ); +00555 +00567 TInt Funct45( TTestResult& aResult, CTestFlexTimer *cb ); +00568 +00581 TInt Funct46( TTestResult& aResult, CTestFlexTimer *cb ); +00582 +00596 static TInt StartSecondServerL( +00597 TTestResult& aResult, +00598 CTestFlexTimer* aCallback ); +00599 +00607 static TInt SetThreadPriorityMuchMore( +00608 TTestResult& aResult, +00609 CTestFlexTimer* aCallback ); +00610 +00618 static TInt SetThreadPriorityNormal( +00619 TTestResult& aResult, +00620 CTestFlexTimer* aCallback ); +00621 +00622 public: // Data +00623 // ?one_line_short_description_of_data +00624 //?data_declaration; +00625 +00626 protected: // Data +00627 // ?one_line_short_description_of_data +00628 //?data_declaration; +00629 +00630 private: // Data +00631 // ?one_line_short_description_of_data +00632 //?data_declaration; +00633 +00634 CStifLogger * iLog; +00635 +00636 // Standard logger +00637 CStifLogger *iStdLog; +00638 +00639 // Logger for currently running test case +00640 CStifLogger *iTCLog; +00641 +00642 // Flag saying if test case title should be added to log file name +00643 TBool iAddTestCaseTitleToLogName; +00644 +00645 // Flag saying if test module version was already sent +00646 TBool iVersionLogged; +00647 +00648 // Reserved pointer for future extension +00649 //TAny* iReserved; +00650 +00651 // Pointer to test (function) to be executed +00652 TestFunction iMethod; +00653 +00654 //CTimer CB failed case +00655 TBool iCTimerCBFailedCase; +00656 +00657 public: // Friend classes +00658 //?friend_class_declaration; +00659 protected: // Friend classes +00660 //?friend_class_declaration; +00661 private: // Friend classes +00662 //?friend_class_declaration; +00663 +00664 }; +00665 +00666 #endif // TESTFLEXTIMER_H +00667 +00668 // End of File +