sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file is a helper for TestFramework Unit Test classes. sl@0: // It subclasses the abstract RTestStep to produce a working class we can test sl@0: // sl@0: // sl@0: sl@0: // EPOC includes sl@0: #include sl@0: sl@0: // Test system includes sl@0: #include sl@0: sl@0: #include "TestStepVirtualStub.h" sl@0: sl@0: // -------------------------------------------- sl@0: // RTestStepVirtualStub sl@0: sl@0: RTestStepVirtualStub* RTestStepVirtualStub::NewL() sl@0: { sl@0: RTestStepVirtualStub* self = new(ELeave) RTestStepVirtualStub; sl@0: return self; sl@0: } sl@0: sl@0: // Each test step initialises its own name sl@0: RTestStepVirtualStub::RTestStepVirtualStub() sl@0: { sl@0: iTestStepName = KTestStepVirtualStubName; sl@0: sl@0: iPreambleRun = EFalse; sl@0: iPostambleRun = EFalse; sl@0: iStepRun = EFalse; sl@0: } sl@0: sl@0: // preamble sl@0: TVerdict RTestStepVirtualStub::OpenL() sl@0: { sl@0: INFO_PRINTF1(_L("RTestStepVirtualStub::OpenL() has been called")); sl@0: iPreambleRun = ETrue; sl@0: return iTestStepResult = EPass; sl@0: } sl@0: sl@0: // postamble sl@0: void RTestStepVirtualStub::Close() sl@0: { sl@0: INFO_PRINTF1(_L("RTestStepVirtualStub::Close() has been called")); sl@0: iPostambleRun = ETrue; sl@0: } sl@0: sl@0: // do the test step sl@0: TVerdict RTestStepVirtualStub::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("RTestStepVirtualStub::DoTestStepL() has been called")); sl@0: iStepRun = ETrue; sl@0: return iTestStepResult = EPass; sl@0: } sl@0: sl@0: // Extra methods by which RTestStep accessors can be tested. sl@0: // Not for use by anything except Test Harnesses sl@0: CTestSuite* RTestStepVirtualStub::TestGetSuite() const sl@0: { sl@0: return iSuite; sl@0: } sl@0: sl@0: TVerdict RTestStepVirtualStub::TestGetResult() const sl@0: { sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: void RTestStepVirtualStub::TestSetStepName(const TDesC& aName) sl@0: { sl@0: iTestStepName = aName; sl@0: } sl@0: sl@0: TBool RTestStepVirtualStub::PreambleRun() sl@0: { sl@0: return iPreambleRun; sl@0: } sl@0: sl@0: TBool RTestStepVirtualStub::PostambleRun() sl@0: { sl@0: return iPostambleRun; sl@0: } sl@0: sl@0: TBool RTestStepVirtualStub::StepRun() sl@0: { sl@0: return iStepRun; sl@0: } sl@0: sl@0: TBool RTestStepVirtualStub::TestGetBoolFromConfig(const TDesC &aSectName, const TDesC &aKeyName, TBool &aResult) sl@0: { sl@0: return GetBoolFromConfig(aSectName, aKeyName, aResult); sl@0: }; sl@0: sl@0: sl@0: // -------------------------------------------- sl@0: // RTestStepVirtualStub2 sl@0: sl@0: RTestStepVirtualStub2* RTestStepVirtualStub2::NewL() sl@0: { sl@0: RTestStepVirtualStub2* self = new(ELeave) RTestStepVirtualStub2; sl@0: return self; sl@0: } sl@0: sl@0: // Each test step initialises its own name sl@0: RTestStepVirtualStub2::RTestStepVirtualStub2() sl@0: { sl@0: iTestStepName = KTestStepVirtualStub2Name; sl@0: sl@0: iPreambleRun = EFalse; sl@0: iPostambleRun = EFalse; sl@0: iStepRun = EFalse; sl@0: } sl@0: