traceservices/tracefw/ulogger/unit_test/te-client/teststopstep.cpp
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Example CTestStep derived implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file TestStopStep.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "teststopstep.h"
       
    23 #include "te_uloggerclientsuitedefs.h"
       
    24 
       
    25 CTestStopStep::~CTestStopStep()
       
    26 /**
       
    27  * Destructor
       
    28  */
       
    29 	{
       
    30 	}
       
    31 
       
    32 CTestStopStep::CTestStopStep()
       
    33 /**
       
    34  * Constructor
       
    35  */
       
    36 	{
       
    37 	// **MUST** call SetTestStepName in the constructor as the controlling
       
    38 	// framework uses the test step name immediately following construction to set
       
    39 	// up the step's unique logging ID.
       
    40 	SetTestStepName(KTestStopStep);
       
    41 	}
       
    42 
       
    43 TVerdict CTestStopStep::doTestStepPreambleL()
       
    44 /**
       
    45  * @return - TVerdict code
       
    46  * Override of base class virtual
       
    47  */
       
    48 	{
       
    49 		CTestUloggerClientApiStepBase::doTestStepPreambleL();
       
    50 		return TestStepResult();
       
    51 	}
       
    52 
       
    53 
       
    54 TVerdict CTestStopStep::doTestStepL()
       
    55 /**
       
    56  * @return - TVerdict code
       
    57  * Override of base class pure virtual
       
    58  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    59  * not leave. That being the case, the current test result value will be EPass.
       
    60  */
       
    61 	{
       
    62 	  CTestUloggerClientApiStepBase::prepareForStopTestL();	
       
    63 	  if (TestStepResult()== EPass)
       
    64 		{
       
    65 			TInt iErrCode = iSession->Stop();
       
    66 			if(KErrNone == iErrCode || KErrNotReady == iErrCode)
       
    67 			{
       
    68 				INFO_PRINTF1(_L("Logging has been stoped"));
       
    69 				SetTestStepResult(EPass);
       
    70 			}
       
    71 			else
       
    72 			{
       
    73 				INFO_PRINTF2(_L("Stop Logging failed with error : %d"), iErrCode);
       
    74 				SetTestStepResult(EFail);
       
    75 			}
       
    76 		}
       
    77 		
       
    78 	  return TestStepResult();
       
    79 	}
       
    80 
       
    81 
       
    82 
       
    83 TVerdict CTestStopStep::doTestStepPostambleL()
       
    84 /**
       
    85  * @return - TVerdict code
       
    86  * Override of base class virtual
       
    87  */
       
    88 {
       
    89 	INFO_PRINTF1(_L("TestStopStep completed"));
       
    90 
       
    91 	// SetTestStepResult(EPass);		// or EFail
       
    92 	CTestUloggerClientApiStepBase::doTestStepPostambleL();
       
    93 	return TestStepResult();
       
    94 }