traceservices/commsdebugutility/TE_commsdebugutility/inc/teststepcomsdbg.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This contains CTestStepFlogger which is the base class for all 
       
    15 // the flogger suite test cases
       
    16 
       
    17 #if (!defined __TESTSTEPCOMSDBG_H__)
       
    18 #define __TESTSTEPCOMSDBG_H__
       
    19 
       
    20 #include "TE_comsdbgServer.h"
       
    21 
       
    22 #include <comms-infras/commsdebugutility.h>
       
    23 
       
    24 class CTestSuite;
       
    25 class CTE_comsdbgServer;
       
    26 
       
    27 const TInt KTimeForDisplay = 0;   ///< Usually set to zero. Set to 1000000, or likewise when debugging to see progress output on console or when using serial output.
       
    28 const TInt KTimeForDisplay1 = KTimeForDisplay;    // historially-different delay but now is unecessary
       
    29 
       
    30 const TInt KFloggerFileFlushTime = 	1000000;	 //< Flogger flushes its file buffer every second
       
    31 const TInt KFloggerIdleTimeWait = 1000000;	 //< A guess (!) at how long the system needs to be idle before flogger's lower-priority thread kicks in and writes the data.
       
    32 const TInt KFloggerWriteTime = 500000;		///< Give flogger 1/2 second to write the data.
       
    33 const TInt KFloggerWriteLargeDataTime = 1500000;		///< Give flogger 1 and 1/2 second to write the data when there is a lot.
       
    34 const TInt KTimeToLog = KFloggerFileFlushTime + KFloggerIdleTimeWait + KFloggerWriteTime;   //< 2.5-second delay used to guarantee the logger will have written to the log file before reading the message.
       
    35 const TInt KTimeToLogLargeData = KFloggerFileFlushTime + KFloggerIdleTimeWait + KFloggerWriteLargeDataTime;   //< 2.5-second delay used to guarantee the logger will have written to the log file before reading the message.
       
    36 
       
    37 const TInt KHeapBufSize = 50000; ///< Flogger doesn't expose the file write buf size, so we redefine it here
       
    38 const TInt KHeapBufFillIterations = KHeapBufSize / KLogBufferSize;  ///< number of times we need to write a maximum-sized string to fill flogger's buffer
       
    39 
       
    40 
       
    41 class CTestStepFlogger : public CTestStep
       
    42 {
       
    43 public:
       
    44 	CTestStepFlogger();
       
    45 	~CTestStepFlogger();
       
    46 
       
    47 	// pointer to suite which owns this test 
       
    48 	CTE_comsdbgServer* iFloggerSuite;
       
    49 
       
    50 	
       
    51 	TInt executeStep( CTestStepFlogger& aTestStep );
       
    52 	TInt executeStep(CTestStepFlogger& aTestStep, TBool aStatus);
       
    53 	TInt DoTestConnect(RFileLogger& aLogger);
       
    54 	TInt executeStep ( TBool bypassChecks = EFalse );
       
    55 	virtual TInt executeStepL();
       
    56 	virtual TInt executeStepL(TBool aStatus);
       
    57 	TVerdict doTestStepPostambleL();
       
    58 	TInt doTestStepWithHeapFailureL( CTestStepFlogger& aTestStep, TInt aReturnValue, TInt lowMemory, TInt highMemory, TBool bypassChecks = EFalse);
       
    59 	
       
    60 	protected:
       
    61 	TInt constructFloggerIniL( const TDesC8& additionalConfig );
       
    62 	TInt replaceFloggerIniL( const TDesC8& newConfig );
       
    63 	void ForceLogFlush(RFileLogger& aLogger);
       
    64 	
       
    65 	};
       
    66 
       
    67 
       
    68 
       
    69 
       
    70 #endif /* __TESTSTEPCOMSDBG_H__ */