kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp
changeset 259 57b9594f5772
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -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"
@@ -25,6 +25,10 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0683.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0683Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -38,7 +42,10 @@
 
 CTestCase0683* CTestCase0683::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_NEWL);
+	    }
 	CTestCase0683* self = new (ELeave) CTestCase0683(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -50,7 +57,10 @@
 CTestCase0683::CTestCase0683(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_CTESTCASE0683);
+	    }
 		
 	} 
 
@@ -60,7 +70,10 @@
 */
 void CTestCase0683::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -70,7 +83,10 @@
 
 CTestCase0683::~CTestCase0683()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_DCTESTCASE0683);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -78,7 +94,10 @@
 
 void CTestCase0683::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -88,7 +107,10 @@
 	
 void CTestCase0683::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -97,7 +119,10 @@
 // handle event completion	
 void CTestCase0683::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -181,6 +206,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -229,6 +255,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP02, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -243,6 +270,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP03, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -253,12 +281,14 @@
 				{			
 				// issue bus request to trigger HNP
 				test.Printf(_L("VBus present, attempting a swap.\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP04, "VBus present, attempting a swap.\n");
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 				err = otgBusRequest();	//	Request the host role
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
+					OstTrace1(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP05, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 			
@@ -279,6 +309,7 @@
 		case EAIdleHostPriorToAPeripheral:	//	an "A-Device only" step
 			{
 			test.Printf(_L("Into EAIdleHostPriorToAPeripheral step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP06, "Into EAIdleHostPriorToAPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -296,6 +327,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -321,6 +353,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP08, "Into EAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -337,6 +370,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP09, "Into EASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -354,6 +388,7 @@
 		case EAIdleHostPriorToVBusDown:
 			{
 			test.Printf(_L("Into EAIdleHostPriorToVBusDown step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP10, "Into EAIdleHostPriorToVBusDown step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -422,6 +457,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}