traceservices/tracefw/ost_trace_api/unit_test/te_ost/src/te_suite_step_base.cpp
changeset 0 08ec8eefde2f
child 23 26645d81f48d
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2007-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 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file te_utrace_suite_step_base.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 
       
    23 #include "te_suite_step_base.h"
       
    24 #include "te_suite_defs.h"
       
    25 #include "te_tracerecord.h"
       
    26 
       
    27 CTe_UTraceSuiteStepBase::~CTe_UTraceSuiteStepBase()
       
    28 	{
       
    29 	}
       
    30 
       
    31 CTe_UTraceSuiteStepBase::CTe_UTraceSuiteStepBase()
       
    32 	{
       
    33 	}
       
    34 
       
    35 TVerdict CTe_UTraceSuiteStepBase::doTestStepPreambleL()
       
    36 /**
       
    37  * @return - TVerdict
       
    38  * Implementation of CTestStep base class virtual
       
    39  * It is used for doing all initialisation common to derived classes in here.
       
    40  * Make it being able to leave if there are any errors here as there's no point in
       
    41  * trying to run a test step if anything fails.
       
    42  * The leave will be picked up by the framework.
       
    43  */
       
    44 	{
       
    45 	if(TestStepResult()==EPass)
       
    46 		{
       
    47 		TRAPD(error, iLogger.DeleteLogfileL());
       
    48 		error = ReadGeneralConfigs();
       
    49 		if(error)
       
    50 			{
       
    51 			SetTestStepResult(EFail);
       
    52 			INFO_PRINTF2(_L("Test step failed on doTestStepPreambleL with error %i"), error);
       
    53 			}
       
    54 		}
       
    55 	return TestStepResult();
       
    56 	}
       
    57 
       
    58 TInt CTe_UTraceSuiteStepBase::StartLoggingL(TTraceConfigs& aTraceData)
       
    59 	{
       
    60 	TInt err = iLogger.StartLoggingL(aTraceData);
       
    61 	return err;
       
    62 	}
       
    63 
       
    64 void CTe_UTraceSuiteStepBase::SetLogFilename(const TDesC& aFilename)
       
    65 	{
       
    66 	iLogger.SetLogFilename(aFilename);
       
    67 	}
       
    68 
       
    69 
       
    70 TInt CTe_UTraceSuiteStepBase::ReadGeneralConfigs()
       
    71 	{
       
    72 	iTraceData.iGroupId = KGroupId;
       
    73 	iTraceData.iTraceId = KTraceId;
       
    74 	iTraceData.iHasThreadId = KContextId; 
       
    75 	iTraceData.iHasProgramCounter = KPc; 	
       
    76 	#ifdef	EXECUTABLE_DEFAULT_COMPONENTID
       
    77 	iTraceData.iComponentId = EXECUTABLE_DEFAULT_COMPONENTID;
       
    78 	#else
       
    79 	iTraceData.iComponentId = KComponentId;	
       
    80 	#endif
       
    81 	return KErrNone;
       
    82 	}
       
    83 
       
    84 void CTe_UTraceSuiteStepBase::DeleteLogFile()
       
    85 	{
       
    86 	iLogger.DeleteLogfileL();
       
    87 	}
       
    88 
       
    89 TVerdict CTe_UTraceSuiteStepBase::doTestStepPostambleL()
       
    90 /**
       
    91  * @return - TVerdict
       
    92  * Implementation of CTestStep base class virtual
       
    93  * It is used for doing all after test treatment common to derived classes in here.
       
    94  * Make it being able to leave
       
    95  * The leave will be picked up by the framework.
       
    96  */
       
    97 	{
       
    98 	//not really doing anything here...
       
    99 	return TestStepResult();
       
   100 	}
       
   101 
       
   102 TInt CTe_UTraceSuiteStepBase::StopLogging()
       
   103 	{
       
   104 	return iLogger.StopLogging();
       
   105 	}