--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp Tue Aug 24 14:42:58 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp Tue Aug 24 14:49:21 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
#include "testpolicy.h"
#include "modelleddevices.h"
#include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0495Traces.h"
+#endif
@@ -47,10 +51,12 @@
CUT_PBASE_T_USBDI_0495* CUT_PBASE_T_USBDI_0495::NewL(TBool aHostRole)
{
+ OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_NEWL_ENTRY, aHostRole );
CUT_PBASE_T_USBDI_0495* self = new (ELeave) CUT_PBASE_T_USBDI_0495(aHostRole);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_NEWL_EXIT, ( TUint )( self ) );
return self;
}
@@ -60,11 +66,14 @@
iCaseStep(EInProgress),
iRequestValidationResultPtr(NULL,0)
{
+ OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY, this );
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT, this );
}
void CUT_PBASE_T_USBDI_0495::ConstructL()
{
+ OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_ENTRY, this );
BaseBulkConstructL();
iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -80,36 +89,39 @@
iOutBufferPtr.Append(KLiteralEnglish5());
}
- RDebug::Printf("CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_CONSTRUCTL, "CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_EXIT, this );
}
CUT_PBASE_T_USBDI_0495::~CUT_PBASE_T_USBDI_0495()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY_DUP01, this );
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT_DUP01, this );
}
void CUT_PBASE_T_USBDI_0495::KillTransfers()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_ENTRY, this );
iOutTransfer[0]->Cancel();
iOutTransfer[1]->Cancel();
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_EXIT, this );
}
void CUT_PBASE_T_USBDI_0495::Ep0TransferCompleteL(TInt aCompletionCode)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_ENTRY, this );
- RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
+ OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
if(aCompletionCode != KErrNone)
{
if(iCaseStep == EFailed)
{// ignore error, nad catch the TestFailed method called further down.
- RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
}
else
{
@@ -117,10 +129,11 @@
KillTransfers();
_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
msg.Format(lit,aCompletionCode);
- RDebug::Print(msg);
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP02, msg);
iCaseStep = EFailed;
TTestCaseFailed request(aCompletionCode,msg);
iControlEp0->SendRequest(request,this);
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT, this );
return;
}
}
@@ -139,7 +152,7 @@
case ERequestRepeatedReadAndValidate:
{
- RDebug::Printf("Try to perform ALL transfers");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
iCaseStep = ETransfer;
@@ -149,7 +162,7 @@
{
_LIT(lit, "TEST FAILURE: No data to send!!");
TBuf<40> msg(lit);
- RDebug::Print(msg);
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP04, msg);
iCaseStep = EFailed;
TTestCaseFailed request(KErrAbort,msg);
return iControlEp0->SendRequest(request,this);
@@ -159,7 +172,7 @@
case ERequestPrepareEndpointValidationResult:
{
- RDebug::Printf("Asking client to prepare the result of its continuous validation");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to prepare the result of its continuous validation");
iCaseStep = ERequestValidationResult;
iRequestValidationResultPtr.Set( iInBuffer->Des());
iRequestValidationResultPtr.Zero(); //reset
@@ -171,14 +184,14 @@
case ERequestValidationResult:
{
- RDebug::Printf("Collect client's return validation result in a pass or fail string ...");
- RDebug::RawPrint(*iInBuffer);
- RDebug::Printf("\n");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP06, "Collect client's return validation result in a pass or fail string ...");
+ OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP56, "", iInBuffer->Ptr(), iInBuffer->Length());
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP07, "\n");
TPtr8 ptr(iInBuffer->Des());
if(ptr.Compare(KClientPassString) == 0)
{
- RDebug::Printf("Client Validation Result is a PASS");
- RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP08, "Client Validation Result is a PASS");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP09, "This is the FINAL check - the whole test has a PASSED");
iCaseStep = EPassed;
TTestCasePassed request;
iControlEp0->SendRequest(request,this);
@@ -188,7 +201,7 @@
TBuf<256> msg;
_LIT(lit, "<Error> Bulk data VALIDATION check was NOT successful");
msg.Format(lit);
- RDebug::Print(msg);
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP10, msg);
iCaseStep = EFailed;
TTestCaseFailed request(KErrCorrupt,msg);
iControlEp0->SendRequest(request,this);
@@ -197,20 +210,21 @@
break;
default:
- RDebug::Printf("<Error> Unknown test step");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP11, "<Error> Unknown test step");
TestFailed(KErrUnknown);
break;
}
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
}
void CUT_PBASE_T_USBDI_0495::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_ENTRY, this );
Cancel();
TInt err(KErrNone);
TBuf<256> msg;
- RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+ OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
switch(iCaseStep)
@@ -235,7 +249,7 @@
break;
}
- RDebug::Printf("Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
+ OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed - num bytes sent = %u", aTransferId, iNumWriteBytesRequested);
iTransferComplete |= PerformNextTransfer(aTransferId);
@@ -244,10 +258,10 @@
/*
Transfers all complete - now ask device to validate first interface's transfer OUT
*/
- RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+ OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP02, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
if(err==KErrNone)
{
- RDebug::Printf("Asking client to post validation recorded on the endpoint on its interface - ready for collection");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP03, "Asking client to post validation recorded on the endpoint on its interface - ready for collection");
iCaseStep = ERequestPrepareEndpointValidationResult;
TRecordedValidationResultRequest request(1,1);
iControlEp0->SendRequest(request,this);
@@ -273,19 +287,20 @@
if(err!=KErrNone)
{
KillTransfers();
- RDebug::Print(msg);
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP04, msg);
iCaseStep = EFailed;
TTestCaseFailed request(err,msg);
return iControlEp0->SendRequest(request,this);
}
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_EXIT, this );
}
void CUT_PBASE_T_USBDI_0495::DeviceInsertedL(TUint aDeviceHandle)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_ENTRY, this );
Cancel();
- RDebug::Printf("this - %08x", this);
+ OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL, "this - %08x", this);
TBuf<256> msg;
TInt err = KErrNone;
@@ -312,7 +327,7 @@
iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferOutId[1]);
// Initialise the descriptors for transfer
- RDebug::Printf("Initialising the transfer descriptors - interface 1");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
err = iUsbInterface1.InitialiseTransferDescriptors();
if(err != KErrNone)
{
@@ -323,18 +338,19 @@
}
if(err != KErrNone)
{
- RDebug::Print(msg);
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP02, msg);
iCaseStep = EFailed;
TTestCaseFailed request(err,msg);
iControlEp0->SendRequest(request,this);
}
else
{
- RDebug::Printf("Asking client for continuous 'Read' and 'Validate'");
+ OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP03, "Asking client for continuous 'Read' and 'Validate'");
iCaseStep = ERequestRepeatedReadAndValidate;
TRepeatedReadAndValidateDataRequest request(1,1,KLiteralEnglish5,KDeviceNumReadBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
iControlEp0->SendRequest(request,this);
}
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_EXIT, this );
}
TInt CUT_PBASE_T_USBDI_0495::PerformNextTransfer(TInt aTransferId)
@@ -345,12 +361,13 @@
transfer ID.
*/
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_ENTRY, this );
if(iNumWriteBytesRequested >= KTotalBytesToTransfer)
{
- RDebug::Printf("****ALL DONE for Transfer using ID %d****", aTransferId);
- RDebug::Printf("Num bytes actually written = %d, num bytes required to be written = %d", iNumWriteBytesRequested, KTotalBytesToTransfer);
+ OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER, "****ALL DONE for Transfer using ID %d****", aTransferId);
+ OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_DUP01, "Num bytes actually written = %u, num bytes required to be written = %u", iNumWriteBytesRequested, KTotalBytesToTransfer);
+ OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT, this, aTransferId );
return aTransferId; //Not writing any more - signal to user that no more transfers are required on this transfer ID
}
TUint bytesToWrite = KTotalBytesToTransfer - iNumWriteBytesRequested;
@@ -362,6 +379,7 @@
bulkTransfer.TransferOut(iOutBufferPtr.Mid(iNumWriteBytesRequested%(KLiteralEnglish5().Length()), numWriteBytes), EFalse);
iNumWriteBytesRequested += numWriteBytes;
+ OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT_DUP01, this );
return 0; //Signal to the user that another transfer is queued on the specified transfer ID
}