--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.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 "testcasewd.h"
#include "testcase0467.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0467Traces.h"
+#endif
@@ -37,7 +41,10 @@
CTestCase0467* CTestCase0467::NewL(TBool aHost)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_NEWL);
+ }
CTestCase0467* self = new (ELeave) CTestCase0467(aHost);
CleanupStack::PushL(self);
self->ConstructL();
@@ -49,7 +56,10 @@
CTestCase0467::CTestCase0467(TBool aHost)
: CTestCaseRoot(KTestCaseId, aHost)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_CTESTCASE0467);
+ }
}
@@ -59,7 +69,10 @@
*/
void CTestCase0467::ConstructL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_CONSTRUCTL);
+ }
iRepeats = INSERT_REPEATS;
iWDTimer = CTestCaseWatchdog::NewL();
@@ -69,7 +82,10 @@
CTestCase0467::~CTestCase0467()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_DCTESTCASE0467);
+ }
Cancel();
delete iWDTimer;
@@ -79,7 +95,10 @@
void CTestCase0467::ExecuteTestCaseL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_EXECUTETESTCASEL);
+ }
iCaseStep = EPreconditions;
iRepeats = KOperationRetriesMax; // VBus event rise retries
@@ -92,7 +111,10 @@
void CTestCase0467::DoCancel()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_DOCANCEL);
+ }
// cancel our timer
iTimer.Cancel();
@@ -111,7 +133,10 @@
void CTestCase0467::CancelIdPin(CTestCaseRoot *pThis)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_CANCELIDPIN);
+ }
CTestCase0467 * p = REINTERPRET_CAST(CTestCase0467 *,pThis);
// cancel any pending call, and then complete our active obj with a timeout value
@@ -124,14 +149,19 @@
void CTestCase0467::DescribePreconditions()
{
test.Printf(_L("Remove 'A' connector beforehand.\n"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS, "Remove 'A' connector beforehand.\n");
test.Printf(_L("ID_PIN detection and VBus driving tests must already pass.\n"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS_DUP01, "ID_PIN detection and VBus driving tests must already pass.\n");
}
// handle event completion
void CTestCase0467::RunStepL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0467_RUNSTEPL);
+ }
// Obtain the completion code for this CActive obj.
TInt completionCode(iStatus.Int());
TBuf<MAX_DSTRLEN> aDescription;
@@ -148,7 +178,9 @@
}
// prompt to remove connector
test.Printf(KRemoveAConnectorPrompt);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
test.Printf(KPressAnyKeyToContinue);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
RequestCharacter();
break;
@@ -166,6 +198,7 @@
case ERepeatLoop: // 2
test.Printf(_L("Repeat test %d/%d\n"), INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
+ OstTraceExt2(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP03, "Repeat test %d/%d\n", INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
if (--iRepeats)
iCaseStep = EWaitForIDPresent;
@@ -177,6 +210,7 @@
case EWaitForIDPresent:
// 3. prompt for insertion
test.Printf(KInsertAConnectorPrompt);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP04, KInsertAConnectorPrompt);
otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
SetActive();
@@ -187,6 +221,10 @@
case EVerifyIDPresent:
// 4. detect id_pin event
LOG_VERBOSE1(_L("STEP4 - detect id_pin event 'A'\n"));
+ if(gVerboseOutput)
+ {
+ OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP05, "STEP4 - detect id_pin event 'A'\n");;
+ }
// retrieve the current ID_PIN value
otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
@@ -224,6 +262,7 @@
case EWaitForIDGone:
// 5. prompt for insertion
test.Printf(KRemoveAConnectorPrompt);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP06, KRemoveAConnectorPrompt);
otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
SetActive();
iCaseStep = EVerifyIDGone;
@@ -232,13 +271,19 @@
case EVerifyIDGone:
// 6. detect id_pin gone event
LOG_VERBOSE1(_L("STEP4 - detect id_pin remove event 'B'\n"));
+ if(gVerboseOutput)
+ {
+ OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP07, "STEP4 - detect id_pin remove event 'B'\n");;
+ }
test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
+ OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP08, "ID_PIN=%d\n", iOTGIdPin);
User::After(5000); // 5ms
otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
otgCancelOtgIdPinNotification();
User::WaitForRequest(iStatus); // swallow it
test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
+ OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP09, "ID_PIN=%d\n", iOTGIdPin);
if (iOTGIdPin != RUsbOtgDriver::EIdPinBPlug)
{
@@ -278,6 +323,7 @@
default:
test.Printf(_L("<Error> unknown test step"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP10, "<Error> unknown test step");
Cancel();
return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
}