|
1 /* |
|
2 * Copyright (c) 2007 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: Test Module DLL to Geocoding API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <e32svr.h> |
|
22 #include <StifParser.h> |
|
23 #include <Stiftestinterface.h> |
|
24 #include <mnerrors.h> |
|
25 |
|
26 #include "testmnclientlib.h" |
|
27 #include "testmngeocoder.h" |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CTestMNClientLib::Delete |
|
33 // Delete here all resources allocated and opened from test methods. |
|
34 // Called from destructor. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 void CTestMNClientLib::Delete() |
|
38 { |
|
39 if(iTestMnGeocoder) |
|
40 { |
|
41 delete iTestMnGeocoder; |
|
42 iTestMnGeocoder = NULL; |
|
43 } |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CTestMNClientLib::RunMethodL |
|
48 // Run specified method. Contains also table of test mothods and their names. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TInt CTestMNClientLib::RunMethodL( |
|
52 CStifItemParser& aItem ) |
|
53 { |
|
54 |
|
55 static TStifFunctionInfo const KFunctions[] = |
|
56 { |
|
57 // Copy this line for every implemented function. |
|
58 // First string is the function name used in TestScripter script file. |
|
59 // Second is the actual implementation member function. |
|
60 ENTRY( "TestNewL", CTestMNClientLib::TestNewL ), |
|
61 ENTRY( "TestNewChainedL", CTestMNClientLib::TestNewChainedL ), |
|
62 ENTRY( "TestGetSetOptionsL", CTestMNClientLib::TestGetSetOptionsL ), |
|
63 ENTRY( "TestFindAddressByCoordinateL", CTestMNClientLib::TestFindAddressByCoordinateL ), |
|
64 ENTRY( "TestFindCoordinateByAddressL", CTestMNClientLib::TestFindCoordinateByAddressL ), |
|
65 ENTRY( "TestFindCoordinateByAddressDescL", CTestMNClientLib::TestFindCoordinateByAddressDescL ), |
|
66 ENTRY( "TestSetExitObserverL", CTestMNClientLib::TestSetExitObserverL ), |
|
67 ENTRY( "TestRemoveExitObserverL", CTestMNClientLib::TestRemoveExitObserverL ), |
|
68 ENTRY( "TestCancelRequestL", CTestMNClientLib::TestCancelRequestL ), |
|
69 ENTRY( "TestRequestPanicL", CTestMNClientLib::TestRequestPanicL ), |
|
70 |
|
71 |
|
72 //ADD NEW ENTRY HERE |
|
73 |
|
74 }; |
|
75 |
|
76 const TInt count = sizeof( KFunctions ) / |
|
77 sizeof( TStifFunctionInfo ); |
|
78 |
|
79 return RunInternalL( KFunctions, count, aItem ); |
|
80 |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------- |
|
84 // CTestMNClientLib::TestNewL |
|
85 // |
|
86 // (other items are commented in a header). |
|
87 // --------------------------------------------------------- |
|
88 // |
|
89 TInt CTestMNClientLib::TestNewL( CStifItemParser& /*aItem*/ ) |
|
90 { |
|
91 return iTestMnGeocoder->TestNewL(); |
|
92 |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------- |
|
96 // CTestMNClientLib::TestNewChainedL |
|
97 // |
|
98 // (other items are commented in a header). |
|
99 // --------------------------------------------------------- |
|
100 // |
|
101 TInt CTestMNClientLib::TestNewChainedL( CStifItemParser& /*aItem*/ ) |
|
102 { |
|
103 return iTestMnGeocoder->TestNewChainedL(); |
|
104 |
|
105 } |
|
106 |
|
107 // --------------------------------------------------------- |
|
108 // CTestMNClientLib::TestGetSetOptionsL |
|
109 // |
|
110 // (other items are commented in a header). |
|
111 // --------------------------------------------------------- |
|
112 // |
|
113 TInt CTestMNClientLib::TestGetSetOptionsL( CStifItemParser& aItem ) |
|
114 { |
|
115 return iTestMnGeocoder->TestGetSetOptionsL( aItem ); |
|
116 |
|
117 } |
|
118 |
|
119 // --------------------------------------------------------- |
|
120 // CTestMNClientLib::TestFindAddressByCoordinateL |
|
121 // |
|
122 // (other items are commented in a header). |
|
123 // --------------------------------------------------------- |
|
124 // |
|
125 TInt CTestMNClientLib::TestFindAddressByCoordinateL( CStifItemParser& aItem ) |
|
126 { |
|
127 return iTestMnGeocoder->TestFindAddressByCoordinateL( aItem ); |
|
128 |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------- |
|
132 // CTestMNClientLib::TestGetSetOptionsL |
|
133 // |
|
134 // (other items are commented in a header). |
|
135 // --------------------------------------------------------- |
|
136 // |
|
137 TInt CTestMNClientLib::TestFindCoordinateByAddressL( CStifItemParser& aItem ) |
|
138 { |
|
139 return iTestMnGeocoder->TestFindCoordinateByAddressL( aItem ); |
|
140 |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------- |
|
144 // CTestMNClientLib::TestGetSetOptionsL |
|
145 // |
|
146 // (other items are commented in a header). |
|
147 // --------------------------------------------------------- |
|
148 // |
|
149 TInt CTestMNClientLib::TestFindCoordinateByAddressDescL( CStifItemParser& aItem ) |
|
150 { |
|
151 return iTestMnGeocoder->TestFindCoordinateByAddressDescL( aItem ); |
|
152 |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------- |
|
156 // CTestMNClientLib::TestSetExitObserverL |
|
157 // |
|
158 // (other items are commented in a header). |
|
159 // --------------------------------------------------------- |
|
160 // |
|
161 TInt CTestMNClientLib::TestSetExitObserverL( CStifItemParser& /*aItem*/ ) |
|
162 { |
|
163 return iTestMnGeocoder->TestSetExitObserverL( ); |
|
164 |
|
165 } |
|
166 |
|
167 // --------------------------------------------------------- |
|
168 // CTestMNClientLib::TestRemoveExitObserverL |
|
169 // |
|
170 // (other items are commented in a header). |
|
171 // --------------------------------------------------------- |
|
172 // |
|
173 TInt CTestMNClientLib::TestRemoveExitObserverL( CStifItemParser& /*aItem*/ ) |
|
174 { |
|
175 return iTestMnGeocoder->TestRemoveExitObserverL( ); |
|
176 |
|
177 } |
|
178 |
|
179 // --------------------------------------------------------- |
|
180 // CTestMNClientLib::TestCancelRequestL |
|
181 // |
|
182 // (other items are commented in a header). |
|
183 // --------------------------------------------------------- |
|
184 // |
|
185 TInt CTestMNClientLib::TestCancelRequestL( CStifItemParser& aItem ) |
|
186 { |
|
187 return iTestMnGeocoder->TestCancelRequestL( aItem ); |
|
188 |
|
189 } |
|
190 |
|
191 // --------------------------------------------------------- |
|
192 // CTestMNClientLib::TestRequestPanicL |
|
193 // |
|
194 // (other items are commented in a header). |
|
195 // --------------------------------------------------------- |
|
196 // |
|
197 TInt CTestMNClientLib::TestRequestPanicL( CStifItemParser& aItem ) |
|
198 { |
|
199 TestModuleIf().SetExitReason(CTestModuleIf::EPanic , KMnPanicDuplicateRequest ); |
|
200 return iTestMnGeocoder->TestRequestPanicL( aItem ); |
|
201 |
|
202 } |
|
203 |
|
204 // End of File |