diff -r a179b74831c9 -r c1f20ce4abcf kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp --- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp Thu Aug 19 11:14:22 2010 +0300 +++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp Tue Aug 31 16:34:26 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 "testcase0681.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "testcase0681Traces.h" +#endif #define _REPEATS (oOpenIterations*3) @@ -37,7 +41,10 @@ CTestCase0681* CTestCase0681::NewL(TBool aHost) { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_NEWL); + } CTestCase0681* self = new (ELeave) CTestCase0681(aHost); CleanupStack::PushL(self); self->ConstructL(); @@ -49,7 +56,10 @@ CTestCase0681::CTestCase0681(TBool aHost) : CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_CTESTCASE0681); + } } @@ -59,7 +69,10 @@ */ void CTestCase0681::ConstructL() { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_CONSTRUCTL); + } iDualRoleCase = ETrue; // another back-back @@ -69,7 +82,10 @@ CTestCase0681::~CTestCase0681() { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_DCTESTCASE0681); + } iCollector.DestroyObservers(); Cancel(); } @@ -77,7 +93,10 @@ void CTestCase0681::ExecuteTestCaseL() { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_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 CTestCase0681::DoCancel() { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_DOCANCEL); + } // cancel our timer iTimer.Cancel(); } @@ -98,16 +120,24 @@ if (gTestRoleMaster) { // "B" device test.Printf(_L("***** Important note *****\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS, "***** Important note *****\n"); test.Printf(_L("Before commencing test, please\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n"); test.Printf(_L("insert 'B'-cable end and activate\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n"); test.Printf(_L("the test on the 'A' device.\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n"); test.Printf(_L("Then, press any key to continue.\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n"); test.Printf(_L("**************************\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP05, "**************************\n"); } else { test.Printf(KInsertACablePrompt); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt); test.Printf(KPressAnyKeyToContinue); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue); } RequestCharacter(); @@ -116,7 +146,10 @@ // handle event completion void CTestCase0681::RunStepL() { - LOG_FUNC + if(gVerboseOutput) + { + OstTraceFunctionEntry0(CTESTCASE0681_RUNSTEPL); + } // Obtain the completion code for this CActive obj. TInt completionCode(iStatus.Int()); TBuf aDescription; @@ -192,6 +225,7 @@ case EPerformSrp: { test.Printf(_L("Into EPerformSrp step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP01, "Into EPerformSrp step...\n"); if (gTestRoleMaster) { @@ -231,6 +265,7 @@ case EAReceivedSrp: // A-Device step only! { test.Printf(_L("Into EAReceivedSrp step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { @@ -257,6 +292,7 @@ case ESwappedRoles: { test.Printf(_L("Into ESwappedRoles step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP03, "Into ESwappedRoles step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { iCollector.DestroyObservers(); @@ -282,6 +318,7 @@ case EAConfigured: // A-Device only step { test.Printf(_L("Into EAConfigured step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP04, "Into EAConfigured step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { iCollector.DestroyObservers(); @@ -297,6 +334,7 @@ case EASuspended: // A-Device only step { test.Printf(_L("Into EASuspended step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP05, "Into EASuspended step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { iCollector.DestroyObservers(); @@ -313,6 +351,7 @@ case EDefaultRoles: { test.Printf(_L("Into EDefaultRoles step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP06, "Into EDefaultRoles step...\n"); if ( --iHNPCounter >= 0) { @@ -345,6 +384,7 @@ case EBConfigured: // A B-Device only step! { test.Printf(_L("Into EBConfigured step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP07, "Into EBConfigured step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { iCollector.DestroyObservers(); @@ -359,6 +399,7 @@ case EBSuspended: { test.Printf(_L("Into EBSuspended step...\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP08, "Into EBSuspended step...\n"); if (KTestCaseWatchdogTO == iStatus.Int()) { iCollector.DestroyObservers(); @@ -367,6 +408,7 @@ // issue HNP test.Printf(_L("VBus present, attempting a swap.\n")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP09, "VBus present, attempting a swap.\n"); iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost); err = otgBusRequest(); // Request the host role @@ -374,6 +416,7 @@ if (KErrNone != err) { test.Printf(_L("BusRequest returned %d\n"),err); + OstTrace1(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP10, "BusRequest returned %d\n",err); return TestFailed(KErrAbort, _L("BusRequest() failed!")); } @@ -438,6 +481,7 @@ default: test.Printf(_L(" unknown test step")); + OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP11, " unknown test step"); Cancel(); return (TestFailed(KErrCorrupt, _L(" unknown test step"))); }