os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/inc/teststepcomsdbg.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/inc/teststepcomsdbg.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,70 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This contains CTestStepFlogger which is the base class for all 
    1.18 +// the flogger suite test cases
    1.19 +
    1.20 +#if (!defined __TESTSTEPCOMSDBG_H__)
    1.21 +#define __TESTSTEPCOMSDBG_H__
    1.22 +
    1.23 +#include "TE_comsdbgServer.h"
    1.24 +
    1.25 +#include <comms-infras/commsdebugutility.h>
    1.26 +
    1.27 +class CTestSuite;
    1.28 +class CTE_comsdbgServer;
    1.29 +
    1.30 +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.
    1.31 +const TInt KTimeForDisplay1 = KTimeForDisplay;    // historially-different delay but now is unecessary
    1.32 +
    1.33 +const TInt KFloggerFileFlushTime = 	1000000;	 //< Flogger flushes its file buffer every second
    1.34 +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.
    1.35 +const TInt KFloggerWriteTime = 500000;		///< Give flogger 1/2 second to write the data.
    1.36 +const TInt KFloggerWriteLargeDataTime = 1500000;		///< Give flogger 1 and 1/2 second to write the data when there is a lot.
    1.37 +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.
    1.38 +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.
    1.39 +
    1.40 +const TInt KHeapBufSize = 50000; ///< Flogger doesn't expose the file write buf size, so we redefine it here
    1.41 +const TInt KHeapBufFillIterations = KHeapBufSize / KLogBufferSize;  ///< number of times we need to write a maximum-sized string to fill flogger's buffer
    1.42 +
    1.43 +
    1.44 +class CTestStepFlogger : public CTestStep
    1.45 +{
    1.46 +public:
    1.47 +	CTestStepFlogger();
    1.48 +	~CTestStepFlogger();
    1.49 +
    1.50 +	// pointer to suite which owns this test 
    1.51 +	CTE_comsdbgServer* iFloggerSuite;
    1.52 +
    1.53 +	
    1.54 +	TInt executeStep( CTestStepFlogger& aTestStep );
    1.55 +	TInt executeStep(CTestStepFlogger& aTestStep, TBool aStatus);
    1.56 +	TInt DoTestConnect(RFileLogger& aLogger);
    1.57 +	TInt executeStep ( TBool bypassChecks = EFalse );
    1.58 +	virtual TInt executeStepL();
    1.59 +	virtual TInt executeStepL(TBool aStatus);
    1.60 +	TVerdict doTestStepPostambleL();
    1.61 +	TInt doTestStepWithHeapFailureL( CTestStepFlogger& aTestStep, TInt aReturnValue, TInt lowMemory, TInt highMemory, TBool bypassChecks = EFalse);
    1.62 +	
    1.63 +	protected:
    1.64 +	TInt constructFloggerIniL( const TDesC8& additionalConfig );
    1.65 +	TInt replaceFloggerIniL( const TDesC8& newConfig );
    1.66 +	void ForceLogFlush(RFileLogger& aLogger);
    1.67 +	
    1.68 +	};
    1.69 +
    1.70 +
    1.71 +
    1.72 +
    1.73 +#endif /* __TESTSTEPCOMSDBG_H__ */