landmarks/locationlandmarks/tsrc/LandmarkTestModule/src/LandMarksTestModuleBlocks.cpp
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     1 /*
       
     2 * Copyright (c) 2005 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 // INCLUDE FILES
       
    21 #include <e32svr.h>
       
    22 #include <StifParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 #include "LandMarksTestModule.h"
       
    25 
       
    26 #include "FT_CPosTp1.h"
       
    27 #include "FT_CPosTp2.h"
       
    28 #include "FT_CPosTp3.h"
       
    29 #include "FT_CPosTp4.h"
       
    30 #include "FT_CPosTp5.h"
       
    31 #include "FT_CPosTp6.h"
       
    32 #include "FT_CPosTp7.h"
       
    33 #include "FT_CPosTp8.h"
       
    34 #include "FT_CPosTp9.h"
       
    35 
       
    36 #include "FT_CPosTp10.h"
       
    37 #include "FT_CPosTp11.h"
       
    38 #include "FT_CPosTp12.h"
       
    39 #include "FT_CPosTp13.h"
       
    40 #include "FT_CPosTp18.h"
       
    41 #include "FT_CPosTp19.h"
       
    42 
       
    43 #include "FT_CPosTp20.h"
       
    44 #include "FT_CPosTp21.h"
       
    45 #include "FT_CPosTp23.h"
       
    46 #include "FT_CPosTp24.h"
       
    47 #include "FT_CPosTp25.h"
       
    48 #include "FT_CPosTp26.h"
       
    49 #include "FT_CPosTp28.h"
       
    50 
       
    51 #include "FT_CPosTp35.h"
       
    52 #include "FT_CPosTp36.h"
       
    53 #include "FT_CPosTp37.h"
       
    54 #include "FT_CPosTp38.h"
       
    55 
       
    56 #include "FT_CPosTp42.h"
       
    57 #include "FT_CPosTp43.h"
       
    58 #include "FT_CPosTp44.h"
       
    59 #include "FT_CPosTp45.h"
       
    60 #include "FT_CPosTp47.h"
       
    61 #include "FT_CPosTp48.h"
       
    62 
       
    63 #include "FT_CPosTp51.h"
       
    64 #include "FT_CPosTp52.h"
       
    65 
       
    66 #include "FT_CPosTp100.h"
       
    67 #include "FT_CPosTp101.h"
       
    68 #include "FT_CPosTp102.h"
       
    69 #include "FT_CPosTp103.h"
       
    70 #include "FT_CPosTp104.h"
       
    71 #include "FT_CPosTp106.h"
       
    72 
       
    73 #include "FT_CPosTp116.h"
       
    74 #include "FT_CPosTp117.h"
       
    75 #include "FT_CPosTp118.h"
       
    76 #include "FT_CPosTp119.h"
       
    77 
       
    78 #include "FT_CPosTp120.h"
       
    79 #include "FT_CPosTp121.h"
       
    80 #include "FT_CPosTp122.h"
       
    81 #include "FT_CPosTp123.h"
       
    82 #include "FT_CPosTp124.h"
       
    83 #include "FT_CPosTp125.h"
       
    84 #include "FT_CPosTp126.h"
       
    85 
       
    86 #include "FT_CPosTp130.h"
       
    87 #include "FT_CPosTp131.h"
       
    88 #include "FT_CPosTp132.h"
       
    89 #include "FT_CPosTp134.h"
       
    90 #include "FT_CPosTp133.h"
       
    91 #include "FT_CPosTp135.h"
       
    92 #include "FT_CPosTp136.h"
       
    93 #include "FT_CPosTp137.h"
       
    94 #include "FT_CPosTp139.h"
       
    95 
       
    96 #include "FT_CPosTp141.h"
       
    97 #include "FT_CPosTp143.h"
       
    98 
       
    99 #include "FT_CPosTp144.h"
       
   100 #include "FT_CPosTp145.h"
       
   101 #include "FT_CPosTp146.h"
       
   102 #include "FT_CPosTp147.h"
       
   103 
       
   104 #include "FT_CPosTp148.h"
       
   105 #include "FT_CPosTp149.h"
       
   106 #include "FT_CPosTp150.h"
       
   107 #include "FT_CPosTp151.h"
       
   108 #include "FT_CPosTp152.h"
       
   109 #include "FT_CPosTp153.h"
       
   110 #include "FT_CPosTp154.h"
       
   111 #include "FT_CPosTp155.h"
       
   112 #include "FT_CPosTp156.h"
       
   113 #include "FT_CPosTp157.h"
       
   114 #include "FT_CPosTp158.h"
       
   115 #include "FT_CPosTp159.h"
       
   116 #include "FT_CPosTp160.h"
       
   117 
       
   118 #include "FT_CPosTp161.h"
       
   119 #include "FT_CPosTp162.h"
       
   120 #include "FT_CPosTp163.h"
       
   121 #include "FT_CPosTp164.h"
       
   122 
       
   123 
       
   124 
       
   125 // ============================ MEMBER FUNCTIONS ===============================
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // CLandMarksTestModule::Delete
       
   129 // Delete here all resources allocated and opened from test methods.
       
   130 // Called from destructor.
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void CLandMarksTestModule::Delete()
       
   134     {
       
   135     }
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CLandMarksTestModule::RunMethodL
       
   139 // Run specified method. Contains also table of test mothods and their names.
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 TInt CLandMarksTestModule::RunMethodL(CStifItemParser& aItem )
       
   143     {
       
   144     	static TStifFunctionInfo const KFunctions[] =
       
   145         {
       
   146         // Copy this line for every implemented function.
       
   147         // First string is the function name used in TestScripter script file.
       
   148         // Second is the actual implementation member function.
       
   149 
       
   150         ENTRY( "FT_CPosTp1", CLandMarksTestModule::FT_CPosTp1 ),
       
   151         ENTRY( "FT_CPosTp2", CLandMarksTestModule::FT_CPosTp2 ),
       
   152         ENTRY( "FT_CPosTp3", CLandMarksTestModule::FT_CPosTp3 ),
       
   153         ENTRY( "FT_CPosTp4", CLandMarksTestModule::FT_CPosTp4 ),
       
   154         ENTRY( "FT_CPosTp5", CLandMarksTestModule::FT_CPosTp5 ),
       
   155         ENTRY( "FT_CPosTp6", CLandMarksTestModule::FT_CPosTp6 ),
       
   156         ENTRY( "FT_CPosTp7", CLandMarksTestModule::FT_CPosTp7 ),
       
   157         ENTRY( "FT_CPosTp8", CLandMarksTestModule::FT_CPosTp8 ),
       
   158         ENTRY( "FT_CPosTp9", CLandMarksTestModule::FT_CPosTp9 ),
       
   159         
       
   160         ENTRY( "FT_CPosTp10", CLandMarksTestModule::FT_CPosTp10 ),
       
   161         ENTRY( "FT_CPosTp11", CLandMarksTestModule::FT_CPosTp11 ),
       
   162         ENTRY( "FT_CPosTp12", CLandMarksTestModule::FT_CPosTp12 ),
       
   163         ENTRY( "FT_CPosTp13", CLandMarksTestModule::FT_CPosTp13 ),
       
   164         ENTRY( "FT_CPosTp18", CLandMarksTestModule::FT_CPosTp18 ),
       
   165         ENTRY( "FT_CPosTp19", CLandMarksTestModule::FT_CPosTp19 ),
       
   166         
       
   167         ENTRY( "FT_CPosTp20", CLandMarksTestModule::FT_CPosTp20 ),
       
   168         ENTRY( "FT_CPosTp21", CLandMarksTestModule::FT_CPosTp21 ),
       
   169         ENTRY( "FT_CPosTp23", CLandMarksTestModule::FT_CPosTp23 ),
       
   170         ENTRY( "FT_CPosTp24", CLandMarksTestModule::FT_CPosTp24 ),
       
   171         ENTRY( "FT_CPosTp25", CLandMarksTestModule::FT_CPosTp25 ),
       
   172         ENTRY( "FT_CPosTp26", CLandMarksTestModule::FT_CPosTp26 ),
       
   173         ENTRY( "FT_CPosTp28", CLandMarksTestModule::FT_CPosTp28 ),
       
   174         
       
   175         ENTRY( "FT_CPosTp35", CLandMarksTestModule::FT_CPosTp35 ),
       
   176         ENTRY( "FT_CPosTp36", CLandMarksTestModule::FT_CPosTp36 ),
       
   177         ENTRY( "FT_CPosTp37", CLandMarksTestModule::FT_CPosTp37 ),
       
   178         ENTRY( "FT_CPosTp38", CLandMarksTestModule::FT_CPosTp38 ),
       
   179         
       
   180         ENTRY( "FT_CPosTp42", CLandMarksTestModule::FT_CPosTp42 ),
       
   181         ENTRY( "FT_CPosTp43", CLandMarksTestModule::FT_CPosTp43 ),
       
   182         ENTRY( "FT_CPosTp44", CLandMarksTestModule::FT_CPosTp44 ),
       
   183         ENTRY( "FT_CPosTp45", CLandMarksTestModule::FT_CPosTp45 ),
       
   184         ENTRY( "FT_CPosTp47", CLandMarksTestModule::FT_CPosTp47 ),
       
   185         ENTRY( "FT_CPosTp48", CLandMarksTestModule::FT_CPosTp48 ),
       
   186         
       
   187         ENTRY( "FT_CPosTp51", CLandMarksTestModule::FT_CPosTp51 ),
       
   188         ENTRY( "FT_CPosTp52", CLandMarksTestModule::FT_CPosTp52 ),
       
   189         
       
   190         ENTRY( "FT_CPosTp100", CLandMarksTestModule::FT_CPosTp100 ),
       
   191         ENTRY( "FT_CPosTp101", CLandMarksTestModule::FT_CPosTp101 ),
       
   192         ENTRY( "FT_CPosTp102", CLandMarksTestModule::FT_CPosTp102 ),
       
   193         ENTRY( "FT_CPosTp103", CLandMarksTestModule::FT_CPosTp103 ),
       
   194         ENTRY( "FT_CPosTp104", CLandMarksTestModule::FT_CPosTp104 ),
       
   195         ENTRY( "FT_CPosTp106", CLandMarksTestModule::FT_CPosTp106 ),
       
   196         
       
   197         ENTRY( "FT_CPosTp116", CLandMarksTestModule::FT_CPosTp116 ),
       
   198         ENTRY( "FT_CPosTp117", CLandMarksTestModule::FT_CPosTp117 ),
       
   199         ENTRY( "FT_CPosTp118", CLandMarksTestModule::FT_CPosTp118 ),
       
   200         ENTRY( "FT_CPosTp119", CLandMarksTestModule::FT_CPosTp119 ),
       
   201         
       
   202         ENTRY( "FT_CPosTp120", CLandMarksTestModule::FT_CPosTp120 ),
       
   203         ENTRY( "FT_CPosTp121", CLandMarksTestModule::FT_CPosTp121 ),
       
   204         ENTRY( "FT_CPosTp122", CLandMarksTestModule::FT_CPosTp122 ),
       
   205         ENTRY( "FT_CPosTp123", CLandMarksTestModule::FT_CPosTp123 ),
       
   206         ENTRY( "FT_CPosTp124", CLandMarksTestModule::FT_CPosTp124 ),
       
   207         ENTRY( "FT_CPosTp125", CLandMarksTestModule::FT_CPosTp125 ),
       
   208         ENTRY( "FT_CPosTp126", CLandMarksTestModule::FT_CPosTp126 ),
       
   209         
       
   210         ENTRY( "FT_CPosTp130", CLandMarksTestModule::FT_CPosTp130 ),
       
   211         ENTRY( "FT_CPosTp131", CLandMarksTestModule::FT_CPosTp131 ),
       
   212         ENTRY( "FT_CPosTp132", CLandMarksTestModule::FT_CPosTp132 ),
       
   213         ENTRY( "FT_CPosTp133", CLandMarksTestModule::FT_CPosTp133 ),
       
   214         ENTRY( "FT_CPosTp134", CLandMarksTestModule::FT_CPosTp134 ),
       
   215         ENTRY( "FT_CPosTp135", CLandMarksTestModule::FT_CPosTp135 ),
       
   216         ENTRY( "FT_CPosTp136", CLandMarksTestModule::FT_CPosTp136 ),
       
   217         ENTRY( "FT_CPosTp137", CLandMarksTestModule::FT_CPosTp137 ),
       
   218         ENTRY( "FT_CPosTp139", CLandMarksTestModule::FT_CPosTp139 ),
       
   219         
       
   220         ENTRY( "FT_CPosTp141", CLandMarksTestModule::FT_CPosTp141 ),
       
   221         ENTRY( "FT_CPosTp143", CLandMarksTestModule::FT_CPosTp143 ),
       
   222         ENTRY( "FT_CPosTp144", CLandMarksTestModule::FT_CPosTp144 ),
       
   223         ENTRY( "FT_CPosTp145", CLandMarksTestModule::FT_CPosTp145 ),
       
   224         ENTRY( "FT_CPosTp146", CLandMarksTestModule::FT_CPosTp146 ),
       
   225         ENTRY( "FT_CPosTp147", CLandMarksTestModule::FT_CPosTp147 ),
       
   226         
       
   227         ENTRY( "FT_CPosTp148", CLandMarksTestModule::FT_CPosTp148 ),
       
   228 		ENTRY( "FT_CPosTp149", CLandMarksTestModule::FT_CPosTp149 ),
       
   229 		ENTRY( "FT_CPosTp150", CLandMarksTestModule::FT_CPosTp150 ),
       
   230 		ENTRY( "FT_CPosTp151", CLandMarksTestModule::FT_CPosTp151 ),
       
   231 		ENTRY( "FT_CPosTp152", CLandMarksTestModule::FT_CPosTp152 ),
       
   232 		ENTRY( "FT_CPosTp153", CLandMarksTestModule::FT_CPosTp153 ),
       
   233 		ENTRY( "FT_CPosTp154", CLandMarksTestModule::FT_CPosTp154 ),
       
   234 		ENTRY( "FT_CPosTp155", CLandMarksTestModule::FT_CPosTp155 ),
       
   235 		ENTRY( "FT_CPosTp156", CLandMarksTestModule::FT_CPosTp156 ),
       
   236 		ENTRY( "FT_CPosTp157", CLandMarksTestModule::FT_CPosTp157 ),
       
   237 		ENTRY( "FT_CPosTp158", CLandMarksTestModule::FT_CPosTp158 ),
       
   238 		ENTRY( "FT_CPosTp159", CLandMarksTestModule::FT_CPosTp159 ),
       
   239 		ENTRY( "FT_CPosTp160", CLandMarksTestModule::FT_CPosTp160 ),
       
   240       
       
   241       	ENTRY( "FT_CPosTp161", CLandMarksTestModule::FT_CPosTp161 ),
       
   242       	ENTRY( "FT_CPosTp162", CLandMarksTestModule::FT_CPosTp162 ),
       
   243       	ENTRY( "FT_CPosTp163", CLandMarksTestModule::FT_CPosTp163 ),
       
   244       	ENTRY( "FT_CPosTp164", CLandMarksTestModule::FT_CPosTp164 ),
       
   245 
       
   246         };
       
   247 
       
   248     const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
       
   249 
       
   250     return RunInternalL( KFunctions, count, aItem );
       
   251     }
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 // -----------------------------------------------------------------------------
       
   255 //
       
   256 void CLandMarksTestModule::RunTestProcedureL( 
       
   257     CLandmarkTestProcedureBase* tp,
       
   258     CStifItemParser* aItem )
       
   259     {
       
   260     TBuf<128> buf;
       
   261     TInt tpId = tp->iModuleId;
       
   262     
       
   263     CleanupStack::PushL( tp );
       
   264 
       
   265     _LIT(KTestInit, "---- Initializing TP %d ------");
       
   266     buf.Format( KTestInit, tpId );
       
   267     iLog->Log( buf );
       
   268     tp->InitTestL();
       
   269 
       
   270     _LIT(KTestStart, "---- Starting TP %d ------");
       
   271     buf.Format( KTestStart, tpId );
       
   272     iLog->Log( buf );
       
   273     if ( aItem )
       
   274         tp->StartL( *aItem );
       
   275     else
       
   276         tp->StartL();
       
   277 
       
   278     _LIT(KTestClose, "---- Closing TP %d ------");
       
   279     buf.Format( KTestClose, tpId );
       
   280     iLog->Log( buf );
       
   281     tp->CloseTest();
       
   282 
       
   283     CleanupStack::PopAndDestroy( tp );
       
   284     _LIT(KTestDestroy, "---- Destroyed TP %d ------");
       
   285     buf.Format( KTestDestroy, tpId );
       
   286     iLog->Log( buf );
       
   287     }
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // -----------------------------------------------------------------------------
       
   291 //
       
   292 template <class T>
       
   293 TInt CLandMarksTestModule::TestProcedure( TInt aId, CStifItemParser& )
       
   294     {
       
   295     iLog->Log(_L("---- Creating TP %d ------"), aId);
       
   296     T* tp = new (ELeave) T( aId, iLog );
       
   297     TRAPD( err, RunTestProcedureL( tp ) );
       
   298     return err;
       
   299     }
       
   300 
       
   301 #define DEF_TP(_id) \
       
   302 TInt CLandMarksTestModule::FT_CPosTp##_id( CStifItemParser& aItem ) \
       
   303     { return TestProcedure<CPosTp##_id>( _id, aItem ); }
       
   304 
       
   305 DEF_TP(1)
       
   306 DEF_TP(2)
       
   307 DEF_TP(3)
       
   308 DEF_TP(4)
       
   309 DEF_TP(5)
       
   310 DEF_TP(6)
       
   311 DEF_TP(7)
       
   312 DEF_TP(8)
       
   313 DEF_TP(9)
       
   314 
       
   315 DEF_TP(10)
       
   316 DEF_TP(11)
       
   317 DEF_TP(12)
       
   318 DEF_TP(13)
       
   319 DEF_TP(18)
       
   320 DEF_TP(19)
       
   321 
       
   322 DEF_TP(20)
       
   323 DEF_TP(21)
       
   324 DEF_TP(23)
       
   325 DEF_TP(24)
       
   326 DEF_TP(25)
       
   327 DEF_TP(26)
       
   328 DEF_TP(28)
       
   329 
       
   330 DEF_TP(35)
       
   331 DEF_TP(36)
       
   332 DEF_TP(37)
       
   333 DEF_TP(38)
       
   334 
       
   335 DEF_TP(42)
       
   336 DEF_TP(43)
       
   337 DEF_TP(44)
       
   338 DEF_TP(45)
       
   339 DEF_TP(47)
       
   340 DEF_TP(48)
       
   341 
       
   342 DEF_TP(51)
       
   343 DEF_TP(52)
       
   344 
       
   345 DEF_TP(100)
       
   346 DEF_TP(101)
       
   347 DEF_TP(102)
       
   348 DEF_TP(103)
       
   349 DEF_TP(104)
       
   350 DEF_TP(106)
       
   351 
       
   352 DEF_TP(116)
       
   353 DEF_TP(117)
       
   354 DEF_TP(118)
       
   355 DEF_TP(119)
       
   356 
       
   357 DEF_TP(120)
       
   358 DEF_TP(121)
       
   359 DEF_TP(122)
       
   360 DEF_TP(123)
       
   361 DEF_TP(124)
       
   362 DEF_TP(125)
       
   363 DEF_TP(126)
       
   364 
       
   365 DEF_TP(130)
       
   366 DEF_TP(131)
       
   367 DEF_TP(132)
       
   368 DEF_TP(133)
       
   369 DEF_TP(134)
       
   370 DEF_TP(135)
       
   371 DEF_TP(136)
       
   372 DEF_TP(137)
       
   373 DEF_TP(139)
       
   374 
       
   375 DEF_TP(141)
       
   376 DEF_TP(143)
       
   377 DEF_TP(144)
       
   378 DEF_TP(145)
       
   379 DEF_TP(146)
       
   380 DEF_TP(147)
       
   381 
       
   382 DEF_TP(148)
       
   383 DEF_TP(149)
       
   384 DEF_TP(150)
       
   385 DEF_TP(151)
       
   386 DEF_TP(152)
       
   387 DEF_TP(153)
       
   388 DEF_TP(154)
       
   389 DEF_TP(155)
       
   390 DEF_TP(156)
       
   391 DEF_TP(157)
       
   392 DEF_TP(158)
       
   393 DEF_TP(159)
       
   394 DEF_TP(160)
       
   395 
       
   396 DEF_TP(161)
       
   397 DEF_TP(162)
       
   398 DEF_TP(163)
       
   399 DEF_TP(164)