kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp
changeset 259 57b9594f5772
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0682.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0682Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0682* CTestCase0682::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_NEWL);
+	    }
 	CTestCase0682* self = new (ELeave) CTestCase0682(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 : 	CTestCaseB2BRoot(KTestCaseId, aHost, iStatus),
 	iFirstRoleSwap(ETrue)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_CTESTCASE0682);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0682::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -69,7 +82,10 @@
 
 CTestCase0682::~CTestCase0682()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_DCTESTCASE0682);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -77,7 +93,10 @@
 
 void CTestCase0682::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -87,7 +106,10 @@
 	
 void CTestCase0682::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -98,16 +120,24 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(_L("***** Important note *****\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS, "***** Important note *****\n");
 		test.Printf(_L("Before commencing test, please\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n");
 		test.Printf(_L("insert 'B'-cable end and activate\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n");
 		test.Printf(_L("the test on the 'A' device.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n");
 		test.Printf(_L("Then, press any key to continue.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n");
 		test.Printf(_L("**************************\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP05, "**************************\n");
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt);
 		test.Printf(KPressAnyKeyToContinue);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue);
 		}
 
 	RequestCharacter();	
@@ -116,7 +146,10 @@
 // handle event completion	
 void CTestCase0682::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -167,6 +200,7 @@
 		case EPerformSrp:
 			{
 			test.Printf(_L("Into EPerformSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP01, "Into EPerformSrp step...\n");
 
 			if (gTestRoleMaster)
 				{
@@ -200,6 +234,7 @@
 		case EAReceivedSrp:		//	A-Device step only!
 			{
 			test.Printf(_L("Into EAReceivedSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -228,6 +263,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP03, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -260,6 +296,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -274,6 +311,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP05, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -292,6 +330,7 @@
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
+					OstTrace1(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP06, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 				}
@@ -309,6 +348,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -334,6 +374,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP08, "Into EWaitTillAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -349,6 +390,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP09, "Into EWaitTillASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -416,6 +458,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP10, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}