kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
--- a/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -27,10 +27,6 @@
 #include "testcasewd.h"
 #include "testcasefactory.h"
 #include "exampletestcase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "exampletestcaseTraces.h"
-#endif
 
 
 
@@ -43,10 +39,7 @@
 
 CExampleTestCase* CExampleTestCase::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_NEWL);
-	    }
+	LOG_FUNC
 	CExampleTestCase* self = new (ELeave) CExampleTestCase(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -58,19 +51,13 @@
 CExampleTestCase::CExampleTestCase(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CEXAMPLETESTCASE);
-	    }
+	LOG_FUNC
 	} 
 
 
 void CExampleTestCase::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	BaseConstructL();
 	iWDTimer = CTestCaseWatchdog::NewL();
 	}
@@ -78,10 +65,7 @@
 
 CExampleTestCase::~CExampleTestCase()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DCEXAMPLETESTCASE);
-	    }
+	LOG_FUNC
 
 	delete iWDTimer;
 	Cancel();
@@ -90,10 +74,7 @@
 
 void CExampleTestCase::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EFirstStep;
 
 	//	
@@ -106,15 +87,11 @@
 void CExampleTestCase::DescribePreconditions()
 	{
 	test.Printf(_L("This is an example test, there is nothing to do beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_DESCRIBEPRECONDITIONS, "This is an example test, there is nothing to do beforehand.\n");
 	}
 	
 void CExampleTestCase::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	}
 
@@ -130,7 +107,6 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncA cancel a keyboard Read() @@@\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCA, "@@@ FuncA cancel a keyboard Read(@@@\n"));
 
 	p->iConsole->ReadCancel();
 
@@ -141,7 +117,6 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncB cancel a 'B' keyboard Read() @@@\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCB, "@@@ FuncB cancel a 'B' keyboard Read(@@@\n"));
 
 	p->Cancel();
 	p->iConsole->ReadCancel();
@@ -158,55 +133,43 @@
 // handle event completion	
 void CExampleTestCase::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
-	OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP01, "Example test iStatus compl.=%d\n", completionCode);
+	RDebug::Printf("Example test iStatus compl.=%d\n", completionCode);
+	//test.Printf(_L("Example test iStatus compl.=%d\n"), completionCode);
 
 	switch(iCaseStep)
 		{
 		case EFirstStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("Test step 1\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP03, "Test step 1\n");
 
 			SelfComplete();
 			break;
 		case ESecondStep:
 			iCaseStep=EThirdStep;
 			test.Printf(_L("Test step 2\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP04, "Test step 2\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP05, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press ANY key once you have removed the 'A' connector...\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP06, "Press ANY key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncA);
 			break;
 		case EThirdStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP07, "key was a '%c'\n", iKeyCodeInput);
 			iWDTimer->Cancel();
 			iCaseStep=EFourthStep;
 			test.Printf(_L("Test step 3\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP08, "Test step 3\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP09, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press <SPACE> key once you have removed the 'A' connector...\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP10, "Press <SPACE> key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncB);
 			
 			break;
 		case EFourthStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP11, "key was a '%c'\n", iKeyCodeInput);
 			test.Printf(_L("Test step 4\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP12, "Test step 4\n");
 			iWDTimer->Cancel();
 
 			iCaseStep=EFifthStep;
@@ -220,16 +183,13 @@
 		case EFifthStep:
 			iCaseStep=ESixthStep;
 			test.Printf(_L("Test step 5\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP13, "Test step 5\n");
 			test.Printf(_L("(this test uses a delay)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP14, "(this test uses a delay\n"));
 			iTimer.After(iStatus, 500000);
 			SetActive();
 			break;
 		case ESixthStep:
 			iCaseStep=ELastStep;
 			test.Printf(_L("Test step 6(%d)\n"), completionCode);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP15, "Test step 6(%d)\n", completionCode);
 			RequestCharacter();
 			iConsole->ReadCancel();
 			Cancel();
@@ -240,12 +200,12 @@
 		case ELastStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("LAST step7 code (%d)\n"), completionCode);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP16, "LAST step7 code (%d)\n", completionCode);
 			TestPolicy().SignalTestComplete(KErrNone);
 			return TestPassed();
 			//break;
 
 		default:
+			//test.Printf(_L("<Error> unknown test step"));
 			Cancel();
 			TestFailed(KErrCorrupt, _L("unknown test step"));
 			break;