|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 // INCLUDE FILES |
|
27 #include <Stiftestinterface.h> |
|
28 #include "hostconnTester.h" |
|
29 #include <SettingServerClient.h> |
|
30 |
|
31 // EXTERNAL DATA STRUCTURES |
|
32 //extern ?external_data; |
|
33 |
|
34 // EXTERNAL FUNCTION PROTOTYPES |
|
35 //extern ?external_function( ?arg_type,?arg_type ); |
|
36 |
|
37 // CONSTANTS |
|
38 //const ?type ?constant_var = ?constant; |
|
39 |
|
40 // MACROS |
|
41 //#define ?macro ?macro_def |
|
42 |
|
43 // LOCAL CONSTANTS AND MACROS |
|
44 //const ?type ?constant_var = ?constant; |
|
45 //#define ?macro_name ?macro_def |
|
46 |
|
47 // MODULE DATA STRUCTURES |
|
48 //enum ?declaration |
|
49 //typedef ?declaration |
|
50 |
|
51 // LOCAL FUNCTION PROTOTYPES |
|
52 //?type ?function_name( ?arg_type, ?arg_type ); |
|
53 |
|
54 // FORWARD DECLARATIONS |
|
55 //class ?FORWARD_CLASSNAME; |
|
56 |
|
57 // ============================= LOCAL FUNCTIONS =============================== |
|
58 |
|
59 |
|
60 // ============================ MEMBER FUNCTIONS =============================== |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // ChostconnTester::ChostconnTester |
|
64 // C++ default constructor can NOT contain any code, that |
|
65 // might leave. |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 ChostconnTester::ChostconnTester( |
|
69 CTestModuleIf& aTestModuleIf ): |
|
70 CScriptBase( aTestModuleIf ) |
|
71 { |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // ChostconnTester::ConstructL |
|
76 // Symbian 2nd phase constructor can leave. |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void ChostconnTester::ConstructL() |
|
80 { |
|
81 //Read logger settings to check whether test case name is to be |
|
82 //appended to log file name. |
|
83 iLog = CStifLogger::NewL( KSenHostletConnection_stifLogPath, |
|
84 KSenHostletConnection_stifLogFile); |
|
85 |
|
86 // Sample how to use logging |
|
87 _LIT( KLogStart, "KSenHostletConnection_stif logging starts!" ); |
|
88 iLog->Log( KLogStart ); |
|
89 |
|
90 // iActiveScheduler = new CActiveScheduler; |
|
91 // CActiveScheduler::Install( iActiveScheduler ); |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // ChostconnTester::NewL |
|
96 // Two-phased constructor. |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 ChostconnTester* ChostconnTester::NewL( |
|
100 CTestModuleIf& aTestModuleIf ) |
|
101 { |
|
102 ChostconnTester* self = new (ELeave) ChostconnTester( aTestModuleIf ); |
|
103 |
|
104 CleanupStack::PushL( self ); |
|
105 self->ConstructL(); |
|
106 CleanupStack::Pop(); |
|
107 |
|
108 return self; |
|
109 |
|
110 } |
|
111 |
|
112 // Destructor |
|
113 ChostconnTester::~ChostconnTester() |
|
114 { |
|
115 delete iLog; |
|
116 |
|
117 delete iActiveScheduler; |
|
118 |
|
119 } |
|
120 |
|
121 //----------------------------------------------------------------------------- |
|
122 // ChostconnTester::SendTestClassVersion |
|
123 // Method used to send version of test class |
|
124 //----------------------------------------------------------------------------- |
|
125 // |
|
126 void ChostconnTester::SendTestClassVersion() |
|
127 { |
|
128 TVersion moduleVersion; |
|
129 moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; |
|
130 moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; |
|
131 moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; |
|
132 |
|
133 TFileName moduleName; |
|
134 moduleName = _L("hostconnTester.dll"); |
|
135 |
|
136 TBool newVersionOfMethod = ETrue; |
|
137 TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); |
|
138 } |
|
139 // ----------------------------------------------------------------------------- |
|
140 // ChostconnTester::RunTestCaseL |
|
141 // RunTestCaseL is used to run an individual test case specified |
|
142 // by aTestCase. Test cases that can be run may be requested from |
|
143 // Test Module by GetTestCases method before calling RunTestCase. |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 //TInt ChostconnTester::RunTestCaseL( |
|
147 // const TInt aCaseNumber, |
|
148 // const TFileName& /*aConfig*/, |
|
149 // TTestResult& aResult ) |
|
150 // { |
|
151 |
|
152 // Return value |
|
153 // TInt execStatus = KErrNone; |
|
154 |
|
155 // Get the pointer to test case function |
|
156 // TCaseInfo tmp = Case ( aCaseNumber ); |
|
157 |
|
158 // _LIT( KLogStartTC, "Starting testcase [%S]" ); |
|
159 // iLog->Log( KLogStartTC, &tmp.iCaseName); |
|
160 |
|
161 // Check that case number was valid |
|
162 // if ( tmp.iMethod != NULL ) |
|
163 // { |
|
164 // Valid case was found, call it via function pointer |
|
165 // iMethod = tmp.iMethod; |
|
166 // execStatus = ( this->*iMethod )( aResult ); |
|
167 // } |
|
168 // else |
|
169 // { |
|
170 // Valid case was not found, return error. |
|
171 // execStatus = KErrNotFound; |
|
172 // } |
|
173 |
|
174 // Return case execution status (not the result of the case execution) |
|
175 // return execStatus; |
|
176 |
|
177 // } |
|
178 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // LibEntryL is a polymorphic Dll entry point. |
|
182 // Returns: CScriptBase: New CScriptBase derived object |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 EXPORT_C CScriptBase* LibEntryL( |
|
186 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
187 { |
|
188 |
|
189 return ( CScriptBase* ) ChostconnTester::NewL( aTestModuleIf ); |
|
190 |
|
191 } |
|
192 |
|
193 |
|
194 // End of File |