kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0489Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0489* CUT_PBASE_T_USBDI_0489::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0489* self = new (ELeave) CUT_PBASE_T_USBDI_0489(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0489::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0489::~CUT_PBASE_T_USBDI_0489()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -77,12 +67,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::ExecuteHostTestCaseL()	
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -99,13 +88,12 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device
 	
@@ -116,44 +104,40 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0489::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device (the activity timer and the error reporting)
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer
 	
@@ -168,13 +152,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -183,7 +166,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
+		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -191,7 +174,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
+		RDebug::Printf("<Error %d> Unable to open interface 0");
 		TestFailed(err);
 		}
 	
@@ -204,14 +187,13 @@
 	
 	// Wait 1 second then cancel EP0 transfer
 	User::After(1000000);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP03, "Cancelling EP0 transfer");
+	RDebug::Printf("Cancelling EP0 transfer");
 	iUsbInterface0.CancelEP0Transfer();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
 	switch(iCaseStep)
 		{
@@ -219,23 +201,23 @@
 			{
 			if(aCompletionCode != KErrCancel)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL, "<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
+				RDebug::Printf("<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 		
 			// No panic or leave so passed
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP01, "No leave or panic occured so open interface again and send test passed");
+			RDebug::Printf("No leave or panic occured so open interface again and send test passed");
 			
 			// Open the interface		
 			/*TODO DMA TInt err(iUsbInterface0.Open(iToken0));
 			if(err != KErrNone)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP02, "<Error %d> Unable to open interface 0"));
+				RDebug::Printf("<Error %d> Unable to open interface 0"));
 				return TestFailed(err);
 				}
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP03, "Interface 0 re-opened"));*/
+			RDebug::Printf("Interface 0 re-opened"));*/
 			
 			iCaseStep = EPassed;
 			TTestCasePassed request;
@@ -252,35 +234,32 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -288,15 +267,14 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -305,7 +283,7 @@
 */
 void CUT_PBASE_T_USBDI_0489::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -314,7 +292,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_EXIT, this );
 	}