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: Entry point for test cases in stif module |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] - do not remove |
|
21 #include <e32svr.h> |
|
22 #include <StifParser.h> |
|
23 #include <Stiftestinterface.h> |
|
24 #include "testmapimage.h" |
|
25 #include "testmnmapimage.h" |
|
26 #include "testmnmapimageparams.h" |
|
27 #include <swinstapi.h> |
|
28 |
|
29 _LIT( KProviderSisxPath, "e:\\testing\\data\\MnTestProvider.sisx" ); |
|
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 // ?function_name ?description. |
|
61 // ?description |
|
62 // Returns: ?value_1: ?description |
|
63 // ?value_n: ?description_line1 |
|
64 // ?description_line2 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 /* |
|
68 ?type ?function_name( |
|
69 ?arg_type arg, // ?description |
|
70 ?arg_type arg) // ?description |
|
71 { |
|
72 |
|
73 ?code // ?comment |
|
74 |
|
75 // ?comment |
|
76 ?code |
|
77 } |
|
78 */ |
|
79 |
|
80 // ============================ MEMBER FUNCTIONS =============================== |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // Ctestmapimage::Delete |
|
84 // Delete here all resources allocated and opened from test methods. |
|
85 // Called from destructor. |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void Ctestmapimage::Delete() |
|
89 { |
|
90 |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // Ctestmapimage::RunMethodL |
|
95 // Run specified method. Contains also table of test mothods and their names. |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 TInt Ctestmapimage::RunMethodL( |
|
99 CStifItemParser& aItem ) |
|
100 { |
|
101 |
|
102 static TStifFunctionInfo const KFunctions[] = |
|
103 { |
|
104 // Copy this line for every implemented function. |
|
105 // First string is the function name used in TestScripter script file. |
|
106 // Second is the actual implementation member function. |
|
107 ENTRY( "CMnMapImageNewL", Ctestmapimage::TestMapImageNewLL ), |
|
108 ENTRY( "TestSetMapImageParams", Ctestmapimage::TestSetMapImageParams ), |
|
109 ENTRY( "TestSetShowOptions", Ctestmapimage::TestSetShowOptions ), |
|
110 ENTRY( "TestSetTargetOrigin", Ctestmapimage::TestSetTargetOrigin ), |
|
111 ENTRY( "TestGetImageCoordinate", Ctestmapimage::TestGetImageCoordinate ), |
|
112 ENTRY( "TestSupportedImageTypes", Ctestmapimage::TestSupportedImageTypes ), |
|
113 ENTRY( "TestGetWorldCoordinate", Ctestmapimage::TestGetWorldCoordinate ), |
|
114 ENTRY( "TestSetExitObserverL", Ctestmapimage::TestSetExitObserverL ), |
|
115 ENTRY( "TestRender1L", Ctestmapimage::TestRender1L ), |
|
116 ENTRY( "TestRender2L", Ctestmapimage::TestRender2L ), |
|
117 ENTRY( "TestCancelRendering", Ctestmapimage::TestCancelRendering ), |
|
118 |
|
119 ENTRY( "TestTMnMapImageParams", Ctestmapimage::TestTMnMapImageParams ), |
|
120 ENTRY( "TestSetGetCenterPoint", Ctestmapimage::TestSetGetCenterPoint ), |
|
121 ENTRY( "TestSetGetVisibleArea", Ctestmapimage::TestSetGetVisibleArea ), |
|
122 ENTRY( "TestSetGetSize", Ctestmapimage::TestSetGetSize ), |
|
123 ENTRY( "TestSetGetDirection", Ctestmapimage::TestSetGetDirection ), |
|
124 ENTRY( "TestSetGetImageType", Ctestmapimage::TestSetGetImageType ), |
|
125 ENTRY( "TestSetGetProjectionId", Ctestmapimage::TestSetGetProjectionId ), |
|
126 //ADD NEW ENTRY HERE |
|
127 // [test cases entries] - Do not remove |
|
128 |
|
129 }; |
|
130 |
|
131 const TInt count = sizeof( KFunctions ) / |
|
132 sizeof( TStifFunctionInfo ); |
|
133 |
|
134 return RunInternalL( KFunctions, count, aItem ); |
|
135 |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // This method will install the provider application |
|
140 // |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 TInt Ctestmapimage::InstallProvider( CStifItemParser& /*aItem*/ ) |
|
144 { |
|
145 // iLog->Log("Installing [%S]...", aPackagePath ); |
|
146 |
|
147 TInt err = KErrNone; |
|
148 SwiUI::RSWInstSilentLauncher installer; |
|
149 |
|
150 err = installer.Connect(); |
|
151 if( KErrNone != err ) |
|
152 { |
|
153 iLog->Log(_L("Connection to installer failed")); |
|
154 return err; |
|
155 } |
|
156 //CHECK_EQUAL( err, KErrNone, "Connection to installer failed" ); |
|
157 |
|
158 SwiUI::TInstallOptionsPckg options; |
|
159 options().iUpgrade = SwiUI::EPolicyAllowed; |
|
160 options().iPackageInfo = SwiUI::EPolicyAllowed; |
|
161 options().iOverwrite = SwiUI::EPolicyAllowed; |
|
162 options().iKillApp = SwiUI::EPolicyAllowed; |
|
163 |
|
164 err = installer.SilentInstall( KProviderSisxPath, options ); |
|
165 if( KErrNone != err ) |
|
166 { |
|
167 iLog->Log(_L("Provider Installation failed")); |
|
168 installer.Close(); |
|
169 return err; |
|
170 } |
|
171 |
|
172 //CHECK_EQUAL( err, KErrNone, "Installation failed" ); |
|
173 iLog->Log(_L("Provider Installation passed")); |
|
174 installer.Close(); |
|
175 return err; |
|
176 } |
|
177 |
|
178 |
|
179 // ----------------------------------------------------------------------------- |
|
180 // Ctestmapimage::TestMapImageNewLL |
|
181 // Test case for CMnMapImage::NewL |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 |
|
185 TInt Ctestmapimage::TestMapImageNewLL( |
|
186 CStifItemParser& /*aItem*/ ) |
|
187 { |
|
188 |
|
189 CTestMapImage image(iLog); |
|
190 return image.TestNewLL(); |
|
191 |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // Ctestmapimage::TestSetMapImageParams |
|
196 // Test case for CMnMapImage::SetMapImageParams & CMnMapImage::MapImageParams |
|
197 // ----------------------------------------------------------------------------- |
|
198 // |
|
199 |
|
200 TInt Ctestmapimage::TestSetMapImageParams( |
|
201 CStifItemParser& /*aItem*/ ) |
|
202 { |
|
203 |
|
204 CTestMapImage image(iLog); |
|
205 return image.CheckSetMapImageParams(); |
|
206 |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // Ctestmapimage::TestSetShowOptions |
|
212 // Test case for CMnMapImage::SetShowOptions & CMnMapImage::ShowOptions |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 |
|
216 TInt Ctestmapimage::TestSetShowOptions( |
|
217 CStifItemParser& aItem ) |
|
218 { |
|
219 |
|
220 CTestMapImage image(iLog); |
|
221 return image.CheckSetShowOptions(aItem); |
|
222 |
|
223 } |
|
224 |
|
225 // ----------------------------------------------------------------------------- |
|
226 // Ctestmapimage::TestSetTargetOrigin |
|
227 // Test case for CMnMapImage::SetTargetOrigin & CMnMapImage::TargetOrigin |
|
228 // ----------------------------------------------------------------------------- |
|
229 // |
|
230 |
|
231 TInt Ctestmapimage::TestSetTargetOrigin( |
|
232 CStifItemParser& /*aItem*/ ) |
|
233 { |
|
234 |
|
235 CTestMapImage image(iLog); |
|
236 return image.CheckSetTargetOrigin(); |
|
237 |
|
238 } |
|
239 |
|
240 // ----------------------------------------------------------------------------- |
|
241 // Ctestmapimage::TestGetImageCoordinate |
|
242 // Test case for CMnMapImage::GetImageCoordinate |
|
243 // ----------------------------------------------------------------------------- |
|
244 // |
|
245 |
|
246 TInt Ctestmapimage::TestGetImageCoordinate( |
|
247 CStifItemParser& /*aItem*/ ) |
|
248 { |
|
249 |
|
250 CTestMapImage image(iLog); |
|
251 return image.CheckGetImageCoordinate(); |
|
252 |
|
253 } |
|
254 |
|
255 // ----------------------------------------------------------------------------- |
|
256 // Ctestmapimage::TestSupportedImageTypes |
|
257 // Test case for CMnMapImage::SupportedImageTypes |
|
258 // ----------------------------------------------------------------------------- |
|
259 // |
|
260 |
|
261 TInt Ctestmapimage::TestSupportedImageTypes( |
|
262 CStifItemParser& /*aItem*/ ) |
|
263 { |
|
264 |
|
265 CTestMapImage image(iLog); |
|
266 return image.CheckSupportedImageTypes(); |
|
267 |
|
268 } |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 // Ctestmapimage::TestGetWorldCoordinate |
|
272 // Test case for CMnMapImage::GetWorldCoordinate |
|
273 // ----------------------------------------------------------------------------- |
|
274 // |
|
275 |
|
276 TInt Ctestmapimage::TestGetWorldCoordinate( |
|
277 CStifItemParser& /*aItem*/ ) |
|
278 { |
|
279 |
|
280 CTestMapImage image(iLog); |
|
281 return image.CheckGetWorldCoordinate(); |
|
282 |
|
283 } |
|
284 |
|
285 // ----------------------------------------------------------------------------- |
|
286 // Ctestmapimage::TestSetExitObserverL |
|
287 // Test case for CMnMapImage::SetExitObserverL & CMnMapImage::RemoveExitObserver |
|
288 // ----------------------------------------------------------------------------- |
|
289 // |
|
290 |
|
291 TInt Ctestmapimage::TestSetExitObserverL( |
|
292 CStifItemParser& /*aItem*/ ) |
|
293 { |
|
294 |
|
295 CTestMapImage image(iLog); |
|
296 return image.CheckSetExitObserverL(); |
|
297 |
|
298 } |
|
299 |
|
300 // ----------------------------------------------------------------------------- |
|
301 // Ctestmapimage::TestRender1L |
|
302 // Test case for CMnMapImage::RenderL whose completion is informed via aStatus parameter. |
|
303 // ----------------------------------------------------------------------------- |
|
304 // |
|
305 |
|
306 TInt Ctestmapimage::TestRender1L( |
|
307 CStifItemParser& /*aItem*/ ) |
|
308 { |
|
309 |
|
310 CTestMapImage image(iLog); |
|
311 return image.CheckRender1L(); |
|
312 |
|
313 } |
|
314 |
|
315 // ----------------------------------------------------------------------------- |
|
316 // Ctestmapimage::TestRender2L |
|
317 // Test case for CMnMapImage::RenderL whose completion is informed via aCallback |
|
318 // ----------------------------------------------------------------------------- |
|
319 // |
|
320 |
|
321 TInt Ctestmapimage::TestRender2L( |
|
322 CStifItemParser& /*aItem*/ ) |
|
323 { |
|
324 |
|
325 CTestMapImage image(iLog); |
|
326 return image.CheckRender2L(); |
|
327 |
|
328 } |
|
329 |
|
330 // ----------------------------------------------------------------------------- |
|
331 // Ctestmapimage::TestCancelRendering |
|
332 // Test case for CMnMapImage::CancelRendering |
|
333 // ----------------------------------------------------------------------------- |
|
334 // |
|
335 |
|
336 TInt Ctestmapimage::TestCancelRendering( |
|
337 CStifItemParser& /*aItem*/ ) |
|
338 { |
|
339 |
|
340 CTestMapImage image(iLog); |
|
341 return image.CheckCancelRendering(); |
|
342 |
|
343 } |
|
344 |
|
345 // ----------------------------------------------------------------------------- |
|
346 // Ctestmapimage::TestTMnMapImageParams |
|
347 // Test case for constructor of TMnMapImageParams |
|
348 // ----------------------------------------------------------------------------- |
|
349 // |
|
350 |
|
351 TInt Ctestmapimage::TestTMnMapImageParams( |
|
352 CStifItemParser& /*aItem*/ ) |
|
353 { |
|
354 |
|
355 CTestMapImageParams imageParams(iLog); |
|
356 return imageParams.CheckTMnMapImageParams(); |
|
357 |
|
358 } |
|
359 |
|
360 // ----------------------------------------------------------------------------- |
|
361 // Ctestmapimage::TestSetGetCenterPoint |
|
362 // Test case for TMnMapImageParams::SetCenterPoint & TMnMapImageParams::GetCenterPoint |
|
363 // ----------------------------------------------------------------------------- |
|
364 // |
|
365 |
|
366 TInt Ctestmapimage::TestSetGetCenterPoint( |
|
367 CStifItemParser& /*aItem*/ ) |
|
368 { |
|
369 |
|
370 CTestMapImageParams imageParams(iLog); |
|
371 return imageParams.CheckSetGetCenterPoint(); |
|
372 |
|
373 } |
|
374 |
|
375 // ----------------------------------------------------------------------------- |
|
376 // Ctestmapimage::TestSetGetVisibleArea |
|
377 // Test case for TMnMapImageParams::SetVisibleArea & TMnMapImageParams::GetVisibleArea |
|
378 // ----------------------------------------------------------------------------- |
|
379 // |
|
380 |
|
381 TInt Ctestmapimage::TestSetGetVisibleArea( |
|
382 CStifItemParser& /*aItem*/ ) |
|
383 { |
|
384 |
|
385 CTestMapImageParams imageParams(iLog); |
|
386 return imageParams.CheckSetGetVisibleArea(); |
|
387 |
|
388 } |
|
389 |
|
390 // ----------------------------------------------------------------------------- |
|
391 // Ctestmapimage::TestSetGetSize |
|
392 // Test case for TMnMapImageParams::SetSize & TMnMapImageParams::Size |
|
393 // ----------------------------------------------------------------------------- |
|
394 // |
|
395 |
|
396 TInt Ctestmapimage::TestSetGetSize( |
|
397 CStifItemParser& /*aItem*/ ) |
|
398 { |
|
399 |
|
400 CTestMapImageParams imageParams(iLog); |
|
401 return imageParams.CheckSetGetSize(); |
|
402 |
|
403 } |
|
404 |
|
405 // ----------------------------------------------------------------------------- |
|
406 // Ctestmapimage::TestSetGetDirection |
|
407 // Test case for TMnMapImageParams::SetDirection & TMnMapImageParams::Direction |
|
408 // ----------------------------------------------------------------------------- |
|
409 // |
|
410 |
|
411 TInt Ctestmapimage::TestSetGetDirection( |
|
412 CStifItemParser& /*aItem*/ ) |
|
413 { |
|
414 |
|
415 CTestMapImageParams imageParams(iLog); |
|
416 return imageParams.CheckSetGetDirection(); |
|
417 |
|
418 } |
|
419 |
|
420 // ----------------------------------------------------------------------------- |
|
421 // Ctestmapimage::TestSetGetImageType |
|
422 // Test case for TMnMapImageParams::SetImageType & TMnMapImageParams::ImageType |
|
423 // ----------------------------------------------------------------------------- |
|
424 // |
|
425 |
|
426 TInt Ctestmapimage::TestSetGetImageType( |
|
427 CStifItemParser& /*aItem*/ ) |
|
428 { |
|
429 |
|
430 CTestMapImageParams imageParams(iLog); |
|
431 return imageParams.CheckSetGetImageType(); |
|
432 |
|
433 } |
|
434 |
|
435 // ----------------------------------------------------------------------------- |
|
436 // Ctestmapimage::TestSetGetProjectionId |
|
437 // Test case for TMnMapImageParams::SetProjectionId & TMnMapImageParams::ProjectionId |
|
438 // ----------------------------------------------------------------------------- |
|
439 // |
|
440 |
|
441 TInt Ctestmapimage::TestSetGetProjectionId( |
|
442 CStifItemParser& /*aItem*/ ) |
|
443 { |
|
444 |
|
445 CTestMapImageParams imageParams(iLog); |
|
446 return imageParams.CheckSetGetProjectionId(); |
|
447 |
|
448 } |
|
449 |
|
450 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
451 // None |
|
452 |
|
453 // [End of File] - Do not remove |
|