--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.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 "testcasewd.h"
#include "testcase0675.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0675Traces.h"
+#endif
#define _REPEATS (oOpenIterations*3)
@@ -36,7 +40,10 @@
CTestCase0675* CTestCase0675::NewL(TBool aHost)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_NEWL);
+ }
CTestCase0675* self = new (ELeave) CTestCase0675(aHost);
CleanupStack::PushL(self);
self->ConstructL();
@@ -48,7 +55,10 @@
CTestCase0675::CTestCase0675(TBool aHost)
: CTestCaseRoot(KTestCaseId, aHost)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_CTESTCASE0675);
+ }
}
@@ -58,7 +68,10 @@
*/
void CTestCase0675::ConstructL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_CONSTRUCTL);
+ }
iWDTimer = CTestCaseWatchdog::NewL();
iRepeats = OPEN_REPEATS;
@@ -68,7 +81,10 @@
CTestCase0675::~CTestCase0675()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_DCTESTCASE0675);
+ }
Cancel();
delete iWDTimer;
@@ -78,7 +94,10 @@
void CTestCase0675::ExecuteTestCaseL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_EXECUTETESTCASEL);
+ }
iCaseStep = EPreconditions;
iRepeats = KOperationRetriesMax; // VBus event rise retries
@@ -91,7 +110,10 @@
void CTestCase0675::DoCancel()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_DOCANCEL);
+ }
// cancel our timer
iTimer.Cancel();
@@ -100,7 +122,10 @@
void CTestCase0675::CancelKB(CTestCaseRoot *pThis)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_CANCELKB);
+ }
CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
// cancel any pending call, and then complete our active obj with a cancel value
p->iConsole->ReadCancel();
@@ -110,7 +135,10 @@
void CTestCase0675::CancelNotify(CTestCaseRoot *pThis)
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_CANCELNOTIFY);
+ }
CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
// cancel any pending call, and then complete our active obj with a timeout value
p->otgCancelOtgVbusNotification();
@@ -122,12 +150,17 @@
void CTestCase0675::DescribePreconditions()
{
test.Printf(_L("Insert 'A' connector beforehand.\n"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
}
void CTestCase0675::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
{
LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
+ if(gVerboseOutput)
+ {
+ OstTrace1(TRACE_VERBOSE, CTESTCASE0675_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
+ }
iTimer.After(iStatus, aMicroSecs);
iCaseStep = aStep;
SetActive();
@@ -136,7 +169,10 @@
// handle event completion
void CTestCase0675::RunStepL()
{
- LOG_FUNC
+ if(gVerboseOutput)
+ {
+ OstTraceFunctionEntry0(CTESTCASE0675_RUNSTEPL);
+ }
// Obtain the completion code for this CActive obj.
TInt completionCode(iStatus.Int());
TBuf<MAX_DSTRLEN> aDescription;
@@ -155,7 +191,9 @@
}
// prompt to insert connector
test.Printf(KInsertAConnectorPrompt);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
test.Printf(KPressAnyKeyToContinue);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
RequestCharacter();
break;
@@ -181,7 +219,9 @@
if (!otgIdPinPresent())
{
test.Printf(KInsertAConnectorPrompt);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
test.Printf(KPressAnyKeyToContinue);
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
RequestCharacter();
iCaseStep = EDetectAPlug;
}
@@ -209,8 +249,10 @@
case ELoopDriveVBus1:
iWDTimer->Cancel();
test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+ OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
// test for VBus rise next
test.Printf(_L("Waiting for VBus Event\n"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
iStatus = KRequestPending;
otgQueueOtgVbusNotification( iOTGVBus, iStatus );
SetActive();
@@ -247,6 +289,7 @@
case ELoopDriveVBus2:
iWDTimer->Cancel();
test.Printf(_L("Drive VBus double, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+ OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP07, "Drive VBus double, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
err = otgBusRequest(); // duplicate turn on VBus, we expect an error
if (KErrUsbOtgVbusAlreadyRaised != err)
@@ -327,6 +370,7 @@
default:
test.Printf(_L("<Error> unknown test step"));
+ OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP08, "<Error> unknown test step");
Cancel();
return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
}