kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp
changeset 253 d37db4dcc88d
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Tue Aug 24 14:42:58 2010 +0100
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Tue Aug 24 14:49:21 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0469.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0469Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0469* CTestCase0469::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_NEWL);
+	    }
 	CTestCase0469* self = new (ELeave) CTestCase0469(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -47,7 +54,10 @@
 CTestCase0469::CTestCase0469(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_CTESTCASE0469);
+	    }
 		
 	} 
 
@@ -56,7 +66,10 @@
 */
 void CTestCase0469::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_CONSTRUCTL);
+	    }
     iDualRoleCase = EFalse; // Not back to back
 	BaseConstructL();
 	}
@@ -64,7 +77,10 @@
 
 CTestCase0469::~CTestCase0469()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_DCTESTCASE0469);
+	    }
     iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -72,7 +88,10 @@
 
 void CTestCase0469::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iRepeats = 3;
 	
@@ -83,7 +102,10 @@
 	
 void CTestCase0469::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -91,7 +113,10 @@
 // handle event completion	
 void CTestCase0469::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -105,8 +130,11 @@
         iCaseStep = ELoadLdd;
         // prompt to insert connectors
         test.Printf(KInsertBCablePrompt);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP01, KInsertBCablePrompt);
         test.Printf(KRemoveAFromPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP02, KRemoveAFromPC);
         test.Printf(KPressAnyKeyToContinue);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP03, KPressAnyKeyToContinue);
         RequestCharacter();			
         break;
 			
@@ -149,12 +177,12 @@
 
         if (iRepeats--)
             {
-            RDebug::Printf("ELoopControl around again %d", iRepeats);
+            OstTrace1(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP04, "ELoopControl around again %d", iRepeats);
             iCaseStep = ETestVbusRise;
             }
         else
             {
-            RDebug::Printf("ELoopControl we're done");
+            OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP05, "ELoopControl we're done");
             iCaseStep = EUnloadLdd;
             }
         SelfComplete();
@@ -172,6 +200,7 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusRaised);
         iCaseStep = ETestVbusFall;
         test.Printf(KInsertAIntoPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP06, KInsertAIntoPC);
         SetActive();
         break;
 
@@ -187,19 +216,20 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusDropped);
         iCaseStep = ELoopControl;
         test.Printf(KRemoveAFromPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP07, KRemoveAFromPC);
         SetActive();
         break;
 
     case EUnloadLdd:
         LOG_STEPNAME(_L("EUnloadLdd"))
         iCollector.DestroyObservers();
-        RDebug::Printf("Destroyed observers");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP08, "Destroyed observers");
         if (EFalse == StepUnloadLDD())
             return TestFailed(KErrAbort,_L("unload Ldd failure"));	
-        RDebug::Printf("unloaded ldd");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP09, "unloaded ldd");
         if (!StepUnloadClient())
             return TestFailed(KErrAbort,_L("Client Unload Failure"));	
-        RDebug::Printf("unloaded client");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP10, "unloaded client");
 
         iCaseStep = ELastStep;
         SelfComplete();
@@ -212,6 +242,7 @@
 			
     default:
         test.Printf(_L("<Error> unknown test step"));
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP11, "<Error> unknown test step");
         Cancel();
         return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}