Update contrib.
1 // Copyright (c) 2002-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 // This file is a helper for TestFramework Unit Test classes.
15 // It subclasses the abstract RTestStep to produce a working class we can test
22 // Test system includes
23 #include <testframework.h>
25 #include "TestStepVirtualStub.h"
27 // --------------------------------------------
28 // RTestStepVirtualStub
30 RTestStepVirtualStub* RTestStepVirtualStub::NewL()
32 RTestStepVirtualStub* self = new(ELeave) RTestStepVirtualStub;
36 // Each test step initialises its own name
37 RTestStepVirtualStub::RTestStepVirtualStub()
39 iTestStepName = KTestStepVirtualStubName;
41 iPreambleRun = EFalse;
42 iPostambleRun = EFalse;
47 TVerdict RTestStepVirtualStub::OpenL()
49 INFO_PRINTF1(_L("RTestStepVirtualStub::OpenL() has been called"));
51 return iTestStepResult = EPass;
55 void RTestStepVirtualStub::Close()
57 INFO_PRINTF1(_L("RTestStepVirtualStub::Close() has been called"));
58 iPostambleRun = ETrue;
62 TVerdict RTestStepVirtualStub::DoTestStepL()
64 INFO_PRINTF1(_L("RTestStepVirtualStub::DoTestStepL() has been called"));
66 return iTestStepResult = EPass;
69 // Extra methods by which RTestStep accessors can be tested.
70 // Not for use by anything except Test Harnesses
71 CTestSuite* RTestStepVirtualStub::TestGetSuite() const
76 TVerdict RTestStepVirtualStub::TestGetResult() const
78 return iTestStepResult;
81 void RTestStepVirtualStub::TestSetStepName(const TDesC& aName)
83 iTestStepName = aName;
86 TBool RTestStepVirtualStub::PreambleRun()
91 TBool RTestStepVirtualStub::PostambleRun()
96 TBool RTestStepVirtualStub::StepRun()
101 TBool RTestStepVirtualStub::TestGetBoolFromConfig(const TDesC &aSectName, const TDesC &aKeyName, TBool &aResult)
103 return GetBoolFromConfig(aSectName, aKeyName, aResult);
107 // --------------------------------------------
108 // RTestStepVirtualStub2
110 RTestStepVirtualStub2* RTestStepVirtualStub2::NewL()
112 RTestStepVirtualStub2* self = new(ELeave) RTestStepVirtualStub2;
116 // Each test step initialises its own name
117 RTestStepVirtualStub2::RTestStepVirtualStub2()
119 iTestStepName = KTestStepVirtualStub2Name;
121 iPreambleRun = EFalse;
122 iPostambleRun = EFalse;