os/persistentdata/traceservices/commsdebugutility/TE_commsdebugutility/inc/teststepcomsdbg.h
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This contains CTestStepFlogger which is the base class for all
15 // the flogger suite test cases
17 #if (!defined __TESTSTEPCOMSDBG_H__)
18 #define __TESTSTEPCOMSDBG_H__
20 #include "TE_comsdbgServer.h"
22 #include <comms-infras/commsdebugutility.h>
25 class CTE_comsdbgServer;
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
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.
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
41 class CTestStepFlogger : public CTestStep
47 // pointer to suite which owns this test
48 CTE_comsdbgServer* iFloggerSuite;
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);
61 TInt constructFloggerIniL( const TDesC8& additionalConfig );
62 TInt replaceFloggerIniL( const TDesC8& newConfig );
63 void ForceLogFlush(RFileLogger& aLogger);
70 #endif /* __TESTSTEPCOMSDBG_H__ */