os/persistentdata/loggingservices/rfilelogger/Logger/te_RFileLogger/src/conn_closeStep.cpp
Update contrib.
1 // Copyright (c) 2004-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 conn_closeStep.cpp
21 #include "conn_closeStep.h"
22 #include "Te_RFileLoggerSuiteDefs.h"
24 Cconn_closeStep::~Cconn_closeStep()
31 Cconn_closeStep::Cconn_closeStep()
36 // **MUST** call SetTestStepName in the constructor as the controlling
37 // framework uses the test step name immediately following construction to set
38 // up the step's unique logging ID.
39 SetTestStepName(Kconn_closeStep);
42 TVerdict Cconn_closeStep::doTestStepPreambleL()
44 * @return - TVerdict code
45 * Override of base class virtual
48 CTe_RFileLoggerSuiteStepBase::doTestStepPreambleL();
49 return TestStepResult();
53 TVerdict Cconn_closeStep::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()==EFail) return TestStepResult();
63 INFO_PRINTF1(_L("1. Connect test ..."));
65 err=ilogger.Connect();
68 ERR_PRINTF2(_L("Connect error. The error number = %d"),err);
69 SetTestStepResult(EFail);
70 return TestStepResult();
72 else INFO_PRINTF1(_L("Connect test passed"));
73 err=ilogger.Connect();
74 INFO_PRINTF1(_L("2. Connect again test after connected"));
75 if(err==KErrAlreadyExists)
77 INFO_PRINTF2(_L("Test pass. Return value = %d as expected"),err);
81 ERR_PRINTF2(_L("Failed. the error = %d"), err);
82 SetTestStepResult(EFail);
83 return TestStepResult();
86 INFO_PRINTF1(_L("3. Close test..."));
88 err=ilogger.Connect();
91 INFO_PRINTF1(_L("Close test passed"));
95 ERR_PRINTF2(_L("Close error value = %d"),err);
96 SetTestStepResult(EFail);
97 return TestStepResult();
100 INFO_PRINTF1(_L("4. CreateLog test..."));
101 err=ilogger.CreateLog(KLogFile1,RFileFlogger::ELogModeAppend);
104 INFO_PRINTF1(_L("CreateLog test passed"));
108 ERR_PRINTF2(_L("CreateLog error value = %d"),err);
109 SetTestStepResult(EFail);
110 return TestStepResult();
115 return TestStepResult();
120 TVerdict Cconn_closeStep::doTestStepPostambleL()
122 * @return - TVerdict code
123 * Override of base class virtual
126 return TestStepResult();