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 inline RTest& CWapTestHarness::Test()
23 inline void CWapTestHarness::DoResourceLeakTest(TBool aValue)
25 // Turn on/off the resource handle leak test
27 iDoResourceLeakTest = aValue;
30 inline void CWapTestHarness::DefaultLogFileName(TDes& aFileName)
32 // Sets aFilename to "KLogsDir\LWapLogsDirName\<TEST HARNESS NAME>.<PLATFORM>.<VARIANT>.log"
34 aFileName.Copy(RProcess().FileName());
35 TInt start = aFileName.LocateReverse('\\');
36 TInt end = aFileName.LocateReverse('.');
37 aFileName = aFileName.Mid(start + 1, end - start - 1);
39 // create the log filename
40 aFileName.Insert(0, _L("\\"));
41 aFileName.Insert(0, KWapLogsDirName);
42 aFileName.Insert(0, KLogsDir);
45 aFileName.Append(_L(".WINS."));
47 aFileName.Append(_L(".MARM."));
51 aFileName.Append(_L("DEB."));
53 aFileName.Append(_L("REL."));
56 aFileName.Append(_L("LOG"));
59 inline void CWapTestHarness::WriteComment(const TDesC& aComment)
61 // Writes aComment to test log file, logging file and test harness
63 if(aComment.Length() < (KMaxFileName - 2))
65 iTest.Printf(_L("%S\n"), &aComment);
66 iFlogger.Write(aComment);
69 #if defined (__LOGGING)
70 __ASSERT_DEBUG(iLogPtr,Panic(EBadCLogPtr));
75 inline void CWapTestHarness::CreateFlogger(const TDesC& aFileName, TInt aShowDate, TInt aShowTime)
77 // Create log file in directory KLogsdir\KWapLogsDirName - Note: ingore Drive and Path of aFilename
81 p.Set(aFileName, NULL, NULL);
82 iFlogger.CreateLog(KWapLogsDirName, p.NameAndExt(), EFileLoggingModeOverwrite);
83 iFlogger.SetDateAndTime(aShowDate, aShowTime);
84 iFlogger.Write(KTestHeader);
87 inline TPtr CWapTestHarness::CTestInfo::Name() const
94 inline TInt CWapTestHarness::CTestInfo::Number() const
101 inline TInt CWapTestHarness::CTestInfo::ErrorCode() const