landmarks/locationlandmarks/tsrc/LandmarkTestModule/inc/FT_CPosTp124.h
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: 
       
    15 *   ?description_line
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPOSTp124_H
       
    21 #define CPOSTp124_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "FT_CLandmarkTestProcedureBase.h"
       
    25 #include <LbsPosition.h>
       
    26 // CLASS DECLARATION
       
    27 class CPosLandmarkDatabase;
       
    28 class CPosLmCompositeCriteria;
       
    29 class CPosLmMultiDbSearch;
       
    30 class CCompositeSearchResult;
       
    31 //class TCoordinate;
       
    32 
       
    33 /**
       
    34 *  Test procedure 124
       
    35 */
       
    36 class CPosTp124 :public CLandmarkTestProcedureBase
       
    37     {
       
    38     public:  // Constructors and destructor
       
    39         
       
    40         /**
       
    41         * C++ default constructor.
       
    42         */
       
    43        
       
    44         CPosTp124(TInt tpno, CStifLogger* aLog) : CLandmarkTestProcedureBase(tpno, aLog) {iErrorsFound = KErrNone;};
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         ~CPosTp124() {};
       
    49 
       
    50     public: // Functions from base classes
       
    51 
       
    52         
       
    53 
       
    54         /**
       
    55         *  Always called even if test leaves, 
       
    56         * after test completion
       
    57         */
       
    58         void CloseTest();
       
    59 
       
    60 
       
    61         /**
       
    62         * From CLandmarkTestProcedureBase
       
    63         * Runs the test in the module
       
    64         */
       
    65         void StartL();
       
    66         
       
    67        
       
    68         void InitTestL();
       
    69         
       
    70     private:
       
    71     
       
    72        	enum TTp124SortOrder
       
    73             {
       
    74             ESortNone,
       
    75             ESortAscending,
       
    76             ESortDescending,
       
    77             ESortDistance
       
    78             };
       
    79 
       
    80         /*
       
    81         * Use the file lmDbCompositeSearchResult.txt and parse
       
    82         * all test combinations, perform all tests and check for correct result
       
    83         */ 
       
    84         void StartLandmarksCompositeTestL(TExecutionMode aExecutionMode, TTp124SortOrder aSortOrder);
       
    85 
       
    86         /**
       
    87         * Prints debug information about the composite search object
       
    88         */
       
    89         void PrintCompositeInfo(CPosLmCompositeCriteria* aComposite);
       
    90 
       
    91         /**
       
    92         * Test that it is possible to search for categories using the
       
    93         * CPosLmCatNameCriteria class in a StartCategorySearchL search
       
    94         */
       
    95         void TestCategoryCompositeSearchL();
       
    96 
       
    97         /**
       
    98         * Perform a test with a composite object used in a composite landmark search 
       
    99         */
       
   100         void TestCompositeInCompositeL();
       
   101 
       
   102         /**
       
   103         * Perform a test with two different text arguments combined in a composite landmark search
       
   104         */
       
   105         void TestSeveralTextArgumentsL();
       
   106 
       
   107         /**
       
   108         * Test to add and remove search arguments to the CPosLmCompositeCriteria object
       
   109         */
       
   110         void TestAddAndRemoveL();
       
   111 
       
   112         /**
       
   113         * Test that no result is returned if setting the  aSearchOnlyPreviousMatches to ETrue
       
   114         * and there is no previous result
       
   115         */
       
   116         void TestWithNoPreviousResultL();
       
   117 
       
   118         /**
       
   119         * Test cancel of a composite search
       
   120         */
       
   121         void CancelTestL(const TBool& aCancelInCallback);
       
   122         
       
   123         void LandmarksSortL(RArray<TPosLmItemId>& aArray, TTp124SortOrder aSortOrder);
       
   124         
       
   125         void SearchL(
       
   126             CPosLmCompositeCriteria* aCompositeSearchCriteria,
       
   127             TExecutionMode aExecutionMode,
       
   128             TBool aRefinedSearch = EFalse,
       
   129             TTp124SortOrder aSortOrder = ESortNone);
       
   130 
       
   131 		/**
       
   132 		* Test with different sort order scenarios, test sortpref for landmark and category
       
   133 		* also test with nearest
       
   134 		*/
       
   135     	void TestWithSortOrderLandmarksL(TExecutionMode aExecutionMode,
       
   136     										 TTp124SortOrder aSortOrder);
       
   137         
       
   138     	void TestWithSortOrderNearestL(TExecutionMode aExecutionMode, TTp124SortOrder aSortOrder);
       
   139     	
       
   140     	void PrepareDatabasesL();
       
   141     	
       
   142     	void SetupLimits();
       
   143     	
       
   144     	void PrintLm(CPosLandmarkDatabase* db);
       
   145     	
       
   146     	void ValidateIdL(TPosLmItemId aId, TInt aDbIndex);
       
   147     	
       
   148     	void ValidateSearchResultsL(
       
   149             RIdArray& aExpectedIds,
       
   150             TTp124SortOrder aSortOrder,
       
   151             TInt aNrOfExpectedErrors = 0);
       
   152             
       
   153         TInt NrOfSearchErrors(CPosLmMultiDbSearch* aMultiDbSearcher);
       
   154         
       
   155         TBool CheckCompositeForIdListL(CPosLmCompositeCriteria* aComposite);
       
   156         
       
   157         void TestWithIdListAndCompositeL();
       
   158         
       
   159         void TestOnTheFlySearchL();
       
   160         
       
   161         void TestLessDbsToSearchL();
       
   162         
       
   163         void CompositeStressTestL(TInt aStartNr, TInt aTotalNr);
       
   164     	
       
   165     	private:
       
   166             
       
   167 	    	TUint iIdDb1Min;
       
   168 	        TUint iIdDb1Max;
       
   169 	        TUint iIdDb2Min;
       
   170 	        TUint iIdDb2Max;
       
   171 	        TUint iIdDb3Min;
       
   172 	        TUint iIdDb3Max;
       
   173 	        TUint iIdDb4Min;
       
   174 	        TUint iIdDb4Max;
       
   175 	        TUint iIdDb5Min;
       
   176 	        TUint iIdDb5Max;
       
   177 	        
       
   178 	        TInt 		iErrorsFound;
       
   179 	        
       
   180 	        CDesCArray*             iDatabases;
       
   181 	        CPosLmMultiDbSearch*    iMultiDbSearch;
       
   182 	        TInt                    iNrOfDatabases;
       
   183 	        /**
       
   184 	         * contains inital db count afte removal of all db
       
   185 	         */
       
   186 	        TInt iDbCount;
       
   187 	        CPosLmDisplayData* 		iDisplayData;
       
   188 	        TCoordinate 			iCoord;
       
   189 
       
   190     };
       
   191 
       
   192 #endif      // CPOSTp124_H
       
   193             
       
   194 // End of File