os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-client/teststartstep.cpp
Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Example CTestStep derived implementation
19 @file TestStartStep.cpp
22 #include "teststartstep.h"
23 #include "te_uloggerclientsuitedefs.h"
25 CTestStartStep::~CTestStartStep()
32 CTestStartStep::CTestStartStep()
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(KTestStartStep);
43 TVerdict CTestStartStep::doTestStepPreambleL()
45 * @return - TVerdict code
46 * Override of base class virtual
49 CTestUloggerClientApiStepBase::doTestStepPreambleL();
50 return TestStepResult();
53 TVerdict CTestStartStep::doTestStepL()
55 * @return - TVerdict code
56 * Override of base class pure virtual
57 * Our implementation only gets called if the base class doTestStepPreambleL() did
58 * not leave. That being the case, the current test result value will be EPass.
61 if (TestStepResult() == EPass)
63 TInt iErrCode = KErrNone;
64 //iErrCode = iSession->Start();
65 //if( KErrNone != iErrCode )
67 CTestUloggerClientApiStepBase::prepareForStartTestL();
68 iErrCode = iSession->ActivateOutputPlugin(_L8("uloggerfileplugin"));
69 if(!( (iErrCode==KErrNone) || (iErrCode==KErrAlreadyExists) ))
71 INFO_PRINTF2(_L("Failed to Set ActiveOutput plugin : %d"), iErrCode);
72 SetTestStepResult(EFail);
76 iErrCode = iSession->Start();
77 if( KErrNone == iErrCode || KErrInUse == iErrCode)
79 INFO_PRINTF1(_L("Logging started"));
80 SetTestStepResult(EPass);
82 else if(KErrNotFound == iErrCode)
84 INFO_PRINTF2(_L("Logging failed to start with error KErrNotFound (%d)"), iErrCode);
85 SetTestStepResult(EPass);
89 INFO_PRINTF2(_L("Logging failed to start with error: %d"), iErrCode);
90 SetTestStepResult(EFail);
96 //INFO_PRINTF1(_L("Session returned sucess without connection"));
97 //SetTestStepResult(EFail);
101 return TestStepResult();
104 TVerdict CTestStartStep::doTestStepPostambleL()
106 * @return - TVerdict code
107 * Override of base class virtual
110 INFO_PRINTF1(_L("TestStartStep completed"));
111 CTestUloggerClientApiStepBase::doTestStepPostambleL();
112 return TestStepResult();