kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp
changeset 259 57b9594f5772
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
247:d8d70de2bd36 259:57b9594f5772
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    27 #include <e32def.h>
    27 #include <e32def.h>
    28 #include <e32def_private.h>
    28 #include <e32def_private.h>
    29 #include <d32otgdi.h>		// OTGDI header
    29 #include <d32otgdi.h>		// OTGDI header
    30 #include <d32usbc.h>		// USBCC header
    30 #include <d32usbc.h>		// USBCC header
    31 #include "testcaseroot.h"
    31 #include "testcaseroot.h"
       
    32 #include "OstTraceDefinitions.h"
       
    33 #ifdef OST_TRACE_COMPILER_IN_USE
       
    34 #include "testcaserootTraces.h"
       
    35 #endif
    32 
    36 
    33 /* Implemention of classes CTestCaseRoot, CTestCaseB2BRoot
    37 /* Implemention of classes CTestCaseRoot, CTestCaseB2BRoot
    34  *
    38  *
    35  */ 
    39  */ 
    36 
    40 
    46 	}
    50 	}
    47 
    51 
    48 	
    52 	
    49 void CTestCaseRoot::BaseConstructL()
    53 void CTestCaseRoot::BaseConstructL()
    50 	{
    54 	{
    51 	LOG_FUNC
    55 	if(gVerboseOutput)
       
    56 	    {
       
    57 	    OstTraceFunctionEntry0(CTESTCASEROOT_BASECONSTRUCTL);
       
    58 	    }
    52 	
    59 	
    53 
    60 
    54 	TInt err(iTimer.CreateLocal());
    61 	TInt err(iTimer.CreateLocal());
    55 	if (err == KErrNone)
    62 	if (err == KErrNone)
    56 		{
    63 		{
    57 		LOG_VERBOSE1(_L("Test case timer created"));
    64 		LOG_VERBOSE1(_L("Test case timer created"));
       
    65 		if(gVerboseOutput)
       
    66 		    {
       
    67 		    OstTrace0(TRACE_VERBOSE, CTESTCASEROOT_BASECONSTRUCTL_DUP01, "Test case timer created");
       
    68 		    }
    58 		}
    69 		}
    59 	else
    70 	else
    60 		{
    71 		{
    61 		RDebug::Printf("<Error %d> Test case timer could not be created",err);
    72 		OstTrace1(TRACE_NORMAL, CTESTCASEROOT_BASECONSTRUCTL_DUP02, "<Error %d> Test case timer could not be created",err);
    62 		User::Leave(err);
    73 		User::Leave(err);
    63 		}
    74 		}
    64 	//
    75 	//
    65 	iConsole = test.Console();
    76 	iConsole = test.Console();
    66 	iRequestedChar = EFalse;
    77 	iRequestedChar = EFalse;
    67 	}
    78 	}
    68 	
    79 	
    69 	
    80 	
    70 CTestCaseRoot::~CTestCaseRoot()
    81 CTestCaseRoot::~CTestCaseRoot()
    71 	{
    82 	{
    72 	LOG_FUNC
    83 	if(gVerboseOutput)
       
    84 	    {
       
    85 	    OstTraceFunctionEntry0(CTESTCASEROOT_DCTESTCASEROOT);
       
    86 	    }
    73 	Cancel();
    87 	Cancel();
    74 	}
    88 	}
    75 
    89 
    76 // utility GUI methods
    90 // utility GUI methods
    77 void CTestCaseRoot::DisplayTestCaseOptions()
    91 void CTestCaseRoot::DisplayTestCaseOptions()
    78 	{
    92 	{
    79 	LOG_FUNC
    93 	if(gVerboseOutput)
       
    94 	    {
       
    95 	    OstTraceFunctionEntry0(CTESTCASEROOT_DISPLAYTESTCASEOPTIONS);
       
    96 	    }
    80 
    97 
    81 	// commonly overridden to display any options for that test
    98 	// commonly overridden to display any options for that test
    82 	test.Printf(_L("Press <ESC> to end the test.\n"));	
    99 	test.Printf(_L("Press <ESC> to end the test.\n"));	
       
   100 	OstTrace0(TRACE_NORMAL, CTESTCASEROOT_DISPLAYTESTCASEOPTIONS_DUP01, "Press <ESC> to end the test.\n");	
    83 	}
   101 	}
    84 
   102 
    85     
   103     
    86 /***********************************************************************/
   104 /***********************************************************************/
    87 //
   105 //
    98 	}
   116 	}
    99 	
   117 	
   100 
   118 
   101 void CTestCaseRoot::DoCancel()
   119 void CTestCaseRoot::DoCancel()
   102 	{
   120 	{
   103 	LOG_FUNC
   121 	if(gVerboseOutput)
       
   122 	    {
       
   123 	    OstTraceFunctionEntry0(CTESTCASEROOT_DOCANCEL);
       
   124 	    }
   104 	}
   125 	}
   105 
   126 
   106     
   127     
   107 /** ProcessKey
   128 /** ProcessKey
   108 override this method to perform other tasks, the base-class does nothing so that 
   129 override this method to perform other tasks, the base-class does nothing so that 
   114 	}
   135 	}
   115     
   136     
   116     
   137     
   117 void CTestCaseRoot::ProcessEngineKey(TKeyCode &aKey)
   138 void CTestCaseRoot::ProcessEngineKey(TKeyCode &aKey)
   118 	{
   139 	{
   119 	LOG_FUNC
   140 	if(gVerboseOutput)
       
   141 	    {
       
   142 	    OstTraceFunctionEntry0(CTESTCASEROOT_PROCESSENGINEKEY);
       
   143 	    }
   120 	
   144 	
   121 	if (EKeyEscape == aKey)
   145 	if (EKeyEscape == aKey)
   122 		{
   146 		{
   123 		AssertionFailed( 1, _L("Test aborted by the user <ESC>\n"));
   147 		AssertionFailed( 1, _L("Test aborted by the user <ESC>\n"));
   124 		CActiveScheduler::Stop();
   148 		CActiveScheduler::Stop();
   133 	}
   157 	}
   134     
   158     
   135 
   159 
   136 void CTestCaseRoot::RequestCharacter()
   160 void CTestCaseRoot::RequestCharacter()
   137 	{
   161 	{
   138 	LOG_FUNC
   162 	if(gVerboseOutput)
       
   163 	    {
       
   164 	    OstTraceFunctionEntry0(CTESTCASEROOT_REQUESTCHARACTER);
       
   165 	    }
   139 	  // A request is issued to the CConsoleBase to accept a
   166 	  // A request is issued to the CConsoleBase to accept a
   140 	  // character from the keyboard.
   167 	  // character from the keyboard.
   141 
   168 
   142 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KMsgAlreadyActive, EPanicAlreadyActive));
   169 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KMsgAlreadyActive, EPanicAlreadyActive));
   143 	  
   170 	  
   147 	}
   174 	}
   148 
   175 
   149 
   176 
   150 void CTestCaseRoot::RunL()
   177 void CTestCaseRoot::RunL()
   151 	{
   178 	{
   152 	LOG_FUNC
   179 	if(gVerboseOutput)
       
   180 	    {
       
   181 	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNL);
       
   182 	    }
   153 	TInt complCode(iStatus.Int());
   183 	TInt complCode(iStatus.Int());
   154 	if (iRequestedChar)
   184 	if (iRequestedChar)
   155 		{
   185 		{
   156 		
   186 		
   157 		TKeyCode k(iConsole->KeyCode());
   187 		TKeyCode k(iConsole->KeyCode());
   173 		{
   203 		{
   174 		// run the next test step
   204 		// run the next test step
   175 		TInt currentStep(GetStepIndex());
   205 		TInt currentStep(GetStepIndex());
   176 		PreRunStep();
   206 		PreRunStep();
   177 		LOG_VERBOSE2(_L("\n<< RunStepL() step=%d\n"), currentStep);
   207 		LOG_VERBOSE2(_L("\n<< RunStepL() step=%d\n"), currentStep);
       
   208 		if(gVerboseOutput)
       
   209 		    {
       
   210 		    OstTrace1(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP01, "\n<< RunStepL() step=%d\n", currentStep);
       
   211 		    }
   178 		RunStepL();
   212 		RunStepL();
   179 		LOG_VERBOSE3(_L(">> RunStepL() step=%d->%d\n"), currentStep, GetStepIndex());
   213 		LOG_VERBOSE3(_L(">> RunStepL() step=%d->%d\n"), currentStep, GetStepIndex());
       
   214 		if(gVerboseOutput)
       
   215 		    {
       
   216 		    OstTraceExt2(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP02, ">> RunStepL() step=%d->%d\n", currentStep, GetStepIndex());
       
   217 		    }
   180 		PostRunStep();
   218 		PostRunStep();
   181 		}
   219 		}
   182 	}
   220 	}
   183 
   221 
   184 
   222 
   192 		// default impl.
   230 		// default impl.
   193 	}
   231 	}
   194 
   232 
   195 TInt CTestCaseRoot::RunError(TInt aError)
   233 TInt CTestCaseRoot::RunError(TInt aError)
   196 	{
   234 	{
   197 	LOG_FUNC
   235 	if(gVerboseOutput)
       
   236 	    {
       
   237 	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNERROR);
       
   238 	    }
   198 	test.Printf(_L("Test case C%lS::RunL left with %d"), &iTestCaseId, aError);
   239 	test.Printf(_L("Test case C%lS::RunL left with %d"), &iTestCaseId, aError);
       
   240 	OstTraceExt2(TRACE_NORMAL, CTESTCASEROOT_RUNERROR_DUP01, "Test case C%lS::RunL left with %d", iTestCaseId, aError);
   199 	AssertionFailed(aError, _L("RunError"));
   241 	AssertionFailed(aError, _L("RunError"));
   200 	return KErrNone;
   242 	return KErrNone;
   201 	}
   243 	}
   202 	
   244 	
   203 	
   245 	
   222 	}
   264 	}
   223 
   265 
   224 
   266 
   225 void CTestCaseRoot::TestFailed(TInt aFailResult, const TDesC &aErrorDescription)
   267 void CTestCaseRoot::TestFailed(TInt aFailResult, const TDesC &aErrorDescription)
   226 	{
   268 	{
   227 	LOG_FUNC
   269 	if(gVerboseOutput)
       
   270 	    {
       
   271 	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED);
       
   272 	    }
   228 	iTestResult = aFailResult;
   273 	iTestResult = aFailResult;
   229 	test.Printf(_L("Test %S\n"), &TestCaseId());
   274 	test.Printf(_L("Test %S\n"), &TestCaseId());
       
   275 	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP01, "Test %S\n", TestCaseId());
   230 	test.Printf(_L("Failed (%d)\n"), aFailResult);
   276 	test.Printf(_L("Failed (%d)\n"), aFailResult);
       
   277 	OstTrace1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP02, "Failed (%d)\n", aFailResult);
   231 	test.Printf(_L("%S!\n"), &aErrorDescription);
   278 	test.Printf(_L("%S!\n"), &aErrorDescription);
       
   279 	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP03, "%S!\n", aErrorDescription);
   232 	if (!iAutomated)
   280 	if (!iAutomated)
   233 		{
   281 		{
   234 		test.Printf(_L("\n"));
   282 		test.Printf(_L("\n"));
       
   283 		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP04, "\n");
   235 		test.Printf(KPressAnyKeyToContinue);
   284 		test.Printf(KPressAnyKeyToContinue);
       
   285 		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP05, KPressAnyKeyToContinue);
   236 		iConsole->Getch();
   286 		iConsole->Getch();
   237 		}
   287 		}
   238 	// the next call panics the framework!
   288 	// the next call panics the framework!
   239 	TestPolicy().SignalTestComplete(iTestResult);
   289 	TestPolicy().SignalTestComplete(iTestResult);
   240 	}
   290 	}
   241 	
   291 	
   242 	
   292 	
   243 void CTestCaseRoot::TestFailed2(TInt aFailResult, const TDesC &aErrorDescription, TInt errorCode)
   293 void CTestCaseRoot::TestFailed2(TInt aFailResult, const TDesC &aErrorDescription, TInt errorCode)
   244 	{
   294 	{
   245 	LOG_FUNC
   295 	if(gVerboseOutput)
       
   296 	    {
       
   297 	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED2);
       
   298 	    }
   246 	iTestResult = aFailResult;
   299 	iTestResult = aFailResult;
   247 	test.Printf(_L("Test %S FAILED %d '%S %d'!\n"), 
   300 	test.Printf(_L("Test %S FAILED %d '%S %d'!\n"), 
   248 	            &TestCaseId(), 
   301 	            &TestCaseId(), 
   249 	            aFailResult, 
   302 	            aFailResult, 
   250 	            &aErrorDescription, 
   303 	            &aErrorDescription, 
   251 	            errorCode);
   304 	            errorCode);
       
   305 	OstTraceExt4(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED2_DUP01, "Test %S FAILED %d '%S %d'!\n", 
       
   306 	            TestCaseId(), 
       
   307 	            aFailResult, 
       
   308 	            aErrorDescription, 
       
   309 	            errorCode);
   252 	// the next call panics the framework!
   310 	// the next call panics the framework!
   253 	TestPolicy().SignalTestComplete(iTestResult);
   311 	TestPolicy().SignalTestComplete(iTestResult);
   254 	}
   312 	}
   255 	
   313 	
   256 	
   314 	
   257 	
   315 	
   258 void CTestCaseRoot::TestPassed()
   316 void CTestCaseRoot::TestPassed()
   259 	{
   317 	{
   260 	LOG_FUNC
   318 	if(gVerboseOutput)
       
   319 	    {
       
   320 	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTPASSED);
       
   321 	    }
   261 	iTestResult = KErrNone;
   322 	iTestResult = KErrNone;
   262 	TestPolicy().SignalTestComplete(iTestResult);
   323 	TestPolicy().SignalTestComplete(iTestResult);
   263 	}
   324 	}
   264 	
   325 	
   265 	
   326 	
   283 void CTestCaseRoot::PrintStepName(const TDesC &aStepName)
   344 void CTestCaseRoot::PrintStepName(const TDesC &aStepName)
   284 	{
   345 	{
   285 	if (gVerboseOutput) 
   346 	if (gVerboseOutput) 
   286 		{
   347 		{
   287 		test.Printf(_L("--------------\n %S "), &aStepName);
   348 		test.Printf(_L("--------------\n %S "), &aStepName);
       
   349 		OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
   288 		// B2B class method dumps the engine state
   350 		// B2B class method dumps the engine state
   289 		//
   351 		//
   290 		test.Printf(_L("\n--------------\n"));
   352 		test.Printf(_L("\n--------------\n"));
       
   353 		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME_DUP01, "\n--------------\n");
   291 		}
   354 		}
   292 	}
   355 	}
   293 
   356 
   294 
   357 
   295 /* **************************************************************************************
   358 /* **************************************************************************************
   296  * 
   359  * 
   297  */
   360  */
   298 CTestCaseB2BRoot::CTestCaseB2BRoot(const TDesC& aTestCaseId, TBool aHost, TRequestStatus &aStatus) 
   361 CTestCaseB2BRoot::CTestCaseB2BRoot(const TDesC& aTestCaseId, TBool aHost, TRequestStatus &aStatus) 
   299 	: CTestCaseRoot(aTestCaseId, aHost) , iCollector(aStatus)
   362 	: CTestCaseRoot(aTestCaseId, aHost) , iCollector(aStatus)
   300 	{
   363 	{
   301 	LOG_FUNC
   364 	if(gVerboseOutput)
       
   365 	    {
       
   366 	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_CTESTCASEB2BROOT);
       
   367 	    }
   302 	
   368 	
   303 	}
   369 	}
   304 
   370 
   305 
   371 
   306 CTestCaseB2BRoot::~CTestCaseB2BRoot()
   372 CTestCaseB2BRoot::~CTestCaseB2BRoot()
   307 	{
   373 	{
   308 	LOG_FUNC
   374 	if(gVerboseOutput)
       
   375 	    {
       
   376 	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_DCTESTCASEB2BROOT);
       
   377 	    }
   309 	
   378 	
   310 	}
   379 	}
   311 
   380 
   312 /* Print step name : B2B override displays the OTG Engine state as well
   381 /* Print step name : B2B override displays the OTG Engine state as well
   313  */
   382  */
   314 void CTestCaseB2BRoot::PrintStepName(const TDesC &aStepName)
   383 void CTestCaseB2BRoot::PrintStepName(const TDesC &aStepName)
   315 	{
   384 	{
   316 	if (gVerboseOutput) 
   385 	if (gVerboseOutput) 
   317 		{
   386 		{
   318 		test.Printf(_L("--------------\n %S "), &aStepName);
   387 		test.Printf(_L("--------------\n %S "), &aStepName);
       
   388 		OstTraceExt1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
   319 		// engine state
   389 		// engine state
   320 		CNotifyWatcherBase *pWatcher = iCollector.GetWatcher(EWatcherState);
   390 		CNotifyWatcherBase *pWatcher = iCollector.GetWatcher(EWatcherState);
   321 		if (pWatcher)
   391 		if (pWatcher)
   322 			{
   392 			{
   323 			TBuf<MAX_DSTRLEN> aDescription;
   393 			TBuf<MAX_DSTRLEN> aDescription;
   324 			RUsbOtgDriver::TOtgState aState = static_cast<RUsbOtgDriver::TOtgState>(pWatcher->GetEventValue());
   394 			RUsbOtgDriver::TOtgState aState = static_cast<RUsbOtgDriver::TOtgState>(pWatcher->GetEventValue());
   325 			
   395 			
   326 			OtgStateString(aState, aDescription);
   396 			OtgStateString(aState, aDescription);
   327 			LOG_VERBOSE3(_L("OTGState %d '%S' \n"), aState, &aDescription);
   397 			LOG_VERBOSE3(_L("OTGState %d '%S' \n"), aState, &aDescription);
       
   398 			if(gVerboseOutput)
       
   399 			    {
       
   400 			    OstTraceExt2(TRACE_VERBOSE, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP01, "OTGState %d '%S' \n", aState, aDescription);
       
   401 			    }
   328 			}
   402 			}
   329 		test.Printf(_L(" : time = %dms\n--------------\n"), iCollector.DurationElapsed());
   403 		test.Printf(_L(" : time = %dms\n--------------\n"), iCollector.DurationElapsed());
       
   404 		OstTrace1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP02, " : time = %dms\n--------------\n", iCollector.DurationElapsed());
   330 		}
   405 		}
   331 	}
   406 	}
   332 
   407 
   333 /* Default implementation which describes this as a B2B test-case 
   408 /* Default implementation which describes this as a B2B test-case 
   334  */
   409  */
   335 void CTestCaseB2BRoot::DescribePreconditions()
   410 void CTestCaseB2BRoot::DescribePreconditions()
   336 	{
   411 	{
   337 	test.Printf(KTestTypeB2BMsg); // B2B
   412 	test.Printf(KTestTypeB2BMsg); // B2B
       
   413 	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS, KTestTypeB2BMsg); // B2B
   338 	if (gTestRoleMaster)
   414 	if (gTestRoleMaster)
       
   415 	   {
   339 		test.Printf(KRoleMasterMsg);
   416 		test.Printf(KRoleMasterMsg);
       
   417 		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP01, KRoleMasterMsg);
       
   418 		}
   340 	else
   419 	else
       
   420 	    {
   341 		test.Printf(KRoleSlaveMsg);
   421 		test.Printf(KRoleSlaveMsg);
       
   422 		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP02, KRoleSlaveMsg);
       
   423 		}
   342 	}
   424 	}
   343 
   425 
   344 
   426 
   345 void CTestCaseB2BRoot::StepB2BPreconditions()
   427 void CTestCaseB2BRoot::StepB2BPreconditions()
   346 	{
   428 	{
   347 	// prompt to insert connector
   429 	// prompt to insert connector
   348 	if (gTestRoleMaster)
   430 	if (gTestRoleMaster)
   349 		{ // "B" device
   431 		{ // "B" device
   350 		test.Printf(KInsertBCablePrompt);
   432 		test.Printf(KInsertBCablePrompt);
       
   433 		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS, KInsertBCablePrompt);
   351 		}
   434 		}
   352 	else
   435 	else
   353 		{
   436 		{
   354 		test.Printf(KInsertACablePrompt);
   437 		test.Printf(KInsertACablePrompt);
       
   438 		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP01, KInsertACablePrompt);
   355 		}
   439 		}
   356 	if (iAutomated)
   440 	if (iAutomated)
   357 		{
   441 		{
   358 
   442 
   359 		SelfComplete();
   443 		SelfComplete();
   360 		return;
   444 		return;
   361 		}
   445 		}
   362 	test.Printf(KPressAnyKeyToContinue);
   446 	test.Printf(KPressAnyKeyToContinue);
       
   447 	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP02, KPressAnyKeyToContinue);
   363 	RequestCharacter();	
   448 	RequestCharacter();	
   364 	}
   449 	}
   365 
   450 
   366 
   451 
   367 /* Test for A or B plug as relevant for MASTER/SLAVE role, fail the test if wrong
   452 /* Test for A or B plug as relevant for MASTER/SLAVE role, fail the test if wrong
   371 	if (gTestRoleMaster)
   456 	if (gTestRoleMaster)
   372 		{
   457 		{
   373 		if (otgIdPinPresent())
   458 		if (otgIdPinPresent())
   374 			{ // oops
   459 			{ // oops
   375 			test.Printf(KMsgErrorPreconditionFailed);
   460 			test.Printf(KMsgErrorPreconditionFailed);
       
   461 			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS, KMsgErrorPreconditionFailed);
   376 			return TestFailed(KErrAbort, KMsgBPlugNotFound);
   462 			return TestFailed(KErrAbort, KMsgBPlugNotFound);
   377 			}
   463 			}
   378 		}
   464 		}
   379 	else
   465 	else
   380 		{
   466 		{
   381 		if (!otgIdPinPresent())
   467 		if (!otgIdPinPresent())
   382 			{ // oops
   468 			{ // oops
   383 			test.Printf(KMsgErrorPreconditionFailed);
   469 			test.Printf(KMsgErrorPreconditionFailed);
       
   470 			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS_DUP01, KMsgErrorPreconditionFailed);
   384 			return TestFailed(KErrAbort, KMsgAPlugNotFound);
   471 			return TestFailed(KErrAbort, KMsgAPlugNotFound);
   385 			}
   472 			}
   386 		}
   473 		}
   387 	}
   474 	}
   388 
   475 
   390 /* Clears the expected event Q just before calling the step, but not the 
   477 /* Clears the expected event Q just before calling the step, but not the 
   391  * recieved Q since the step may still inspect it using the EventReceivedAlready() method.
   478  * recieved Q since the step may still inspect it using the EventReceivedAlready() method.
   392  */
   479  */
   393 void CTestCaseB2BRoot::PreRunStep()
   480 void CTestCaseB2BRoot::PreRunStep()
   394 	{
   481 	{
   395 	LOG_FUNC
   482 	if(gVerboseOutput)
       
   483 	    {
       
   484 	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_PRERUNSTEP);
       
   485 	    }
   396 		
   486 		
   397 		iCollector.ClearAllEvents(EFalse, ETrue);
   487 		iCollector.ClearAllEvents(EFalse, ETrue);
   398 	}
   488 	}
   399 
   489 
   400 
   490 
   401 void CTestCaseB2BRoot::PostRunStep()
   491 void CTestCaseB2BRoot::PostRunStep()
   402 	{
   492 	{
   403 	LOG_FUNC
   493 	if(gVerboseOutput)
       
   494 	    {
       
   495 	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_POSTRUNSTEP);
       
   496 	    }
   404 		// clear the recieved event Q, but not the expected Q
   497 		// clear the recieved event Q, but not the expected Q
   405 		iCollector.ClearAllEvents(ETrue, EFalse);
   498 		iCollector.ClearAllEvents(ETrue, EFalse);
   406 	
   499 	
   407 	}
   500 	}
   408 
   501