|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file is a helper for TestFramework Unit Test classes. |
|
15 // It subclasses the abstract CTestSuite to produce a working class we can test |
|
16 // |
|
17 // |
|
18 |
|
19 // EPOC includes |
|
20 #include <e32base.h> |
|
21 |
|
22 // Test system includes |
|
23 #include <testframework.h> |
|
24 #include "TestStepVirtualStub.h" |
|
25 #include "TestSuiteVirtualStub.h" |
|
26 |
|
27 |
|
28 // do not export if Unit Testing |
|
29 #if defined (__TSU_TESTFRAMEWORK__) |
|
30 #undef EXPORT_C |
|
31 #define EXPORT_C |
|
32 |
|
33 // define only if not Unit Testing |
|
34 #else |
|
35 |
|
36 |
|
37 // Create an instance of this test suite. |
|
38 // NewTestSuiteVirtualStubL is exported at ordinal 1. |
|
39 // This provides the interface to allow the Test Framework |
|
40 // to create instances of this test suite. |
|
41 EXPORT_C CTestSuiteVirtualStub* NewTestSuiteVirtualStubL() |
|
42 { |
|
43 CTestSuiteVirtualStub* result = new (ELeave) CTestSuiteVirtualStub; |
|
44 CleanupStack::PushL(result); |
|
45 result->ConstructL(); |
|
46 CleanupStack::Pop(); // result |
|
47 return result; |
|
48 } |
|
49 #endif |
|
50 |
|
51 // destructor |
|
52 CTestSuiteVirtualStub::~CTestSuiteVirtualStub() |
|
53 { |
|
54 } |
|
55 |
|
56 _LIT(KTxtVersion,"CTestSuiteVirtualStub Version"); |
|
57 |
|
58 // Get test suite version. |
|
59 TPtrC CTestSuiteVirtualStub::GetVersion() const |
|
60 { |
|
61 return KTxtVersion(); |
|
62 } |
|
63 |
|
64 // Initialiser for test suite. |
|
65 // This creates all the test steps and stores them |
|
66 // inside CTestSuiteVirtualStub |
|
67 void CTestSuiteVirtualStub::InitialiseL() |
|
68 { |
|
69 |
|
70 // store the name of this test suite |
|
71 iSuiteName = KTestSuiteVirtualStub; |
|
72 |
|
73 // add test steps |
|
74 AddTestStepL(RTestStepVirtualStub::NewL()); |
|
75 |
|
76 } |