Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2000-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__WAPTESTUTILS_H__)
17 #define __WAPTESTUTILS_H__
24 #if !defined(__LOGGING)
32 const TUid KUidWapTestUtils = {0x10005188};
33 const TInt KMaxUserEntrySize = 50;
35 //Test Harness Logging
37 #define KLogsDir _L("c:\\logs\\")
38 #define KWapLogsDirName _L("WapTest")
40 #define KTestHeader _L("Test Results")
41 #define KTestStarting _L("Test %d Starting")
42 #define KTestStartingWithDesc _L("Test %d Starting (%S)")
43 #define KNextTestStepWithDesc _L("Test %d Step %d (%S)")
44 #define KTestPassed _L("Test %d OK")
45 #define KTestFailed _L("Test %d FAILED (error = %d)")
46 #define KTestHarnessCompleted _L("Tests Completed Ok")
47 #define KTestHarnessFailed _L("Test FAILED (%d failed test(s))")
48 #define KTestFailInfo _L("Test %d : %S failed with Error %d")
49 #define KTestCommentPrepend _L("\t")
52 class CWapTestHarness : public CBase
54 Test harness providing logging features
61 IMPORT_C static CWapTestHarness* NewLC(const TDesC& aTitle);
62 IMPORT_C static CWapTestHarness* NewL(const TDesC& aTitle);
65 IMPORT_C void StartTestL(const TDesC& aName);
66 IMPORT_C void NextStep(const TDesC& aStepName);
67 IMPORT_C void EndTest(TInt aErrorCode);
68 IMPORT_C void LogIt(TRefByValue<const TDesC> aFmt, ...);
69 IMPORT_C void operator()(TInt aResult,TInt aLineNum);
70 IMPORT_C void operator()(TInt aResult);
71 IMPORT_C void PressAnyKey();
72 IMPORT_C void DumpData(HBufC8& aData, TBool logIt = EFalse);
73 IMPORT_C void GetAnEntry(const TDesC & ourPrompt, TDes & currentstring);
74 IMPORT_C TInt GetSelection(const TDesC& ourPrompt, const TDesC& validChoices);
75 IMPORT_C void SetScript(RFile& scriptFile);
76 inline void DoResourceLeakTest(TBool aValue);
79 inline static void DefaultLogFileName(TDes& aFileName);
81 CWapTestHarness(const TDesC& aTitle);
82 void ConstructL(const TDesC& aTitle);
83 void Panic(TInt aPanic);
84 void TestHarnessFailed();
85 void TestHarnessComplete();
86 void ResourceLeakTest();
87 inline void CreateFlogger(const TDesC& aFileName, TInt aShowDate=ETrue, TInt aShowTime=ETrue);
88 inline void WriteComment(const TDesC& aComment);
89 TInt ReadLineFromScript(TDes& aBuffer);
92 // Helper class to store failed tests
102 RFileLogger iFlogger;
104 __DECLARE_LOG; // Does CLogClient* iLogPtr;
106 CArrayPtrFlat<CTestInfo>* iFailedTests;
110 TInt iStartHandleCount;
111 TBool iDoResourceLeakTest;
112 TBool iScriptRunning;
115 class CWapTestHarness::CTestInfo : public CBase
118 Holds test number and name
124 static CTestInfo* NewLC(const TDesC& aName, TInt aNumber, TInt aErrorCode);
125 static CTestInfo* NewL(const TDesC& aName, TInt aNumber, TInt aErrorCode);
128 void SetNameL(const TDesC& aName);
129 void SetNumber(TInt aNumber);
130 void SetErrorCode(TInt aErrorCode);
132 inline TPtr Name() const;
133 inline TInt Number() const;
134 inline TInt ErrorCode() const;
137 void ConstructL(const TDesC& aName, TInt aNumber, TInt aErrorCode);
144 #include <waptestutils.inl>
146 #endif // __WAPTESTUTILS_H__