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