landmarks/locationlandmarks/tsrc/LandmarkTestModule/inc/FT_CPosTp42.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 CPOSTP42_H
       
    21 #define CPOSTP42_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "FT_CLandmarkTestProcedureBase.h"
       
    25 #include <apgcli.h>
       
    26 
       
    27 
       
    28 //CONSTANTA
       
    29 const TInt NOLANDMARKNUMBER = 123;
       
    30 // CLASS DECLARATION
       
    31 
       
    32 class CRecognizerData;
       
    33 
       
    34 /**
       
    35 *  Test procedure 42
       
    36 */
       
    37 class CPosTp42 :public CLandmarkTestProcedureBase
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40         
       
    41         /**
       
    42         * C++ default constructor.
       
    43         */
       
    44         
       
    45         CPosTp42(TInt tpno, CStifLogger* aLog) : CLandmarkTestProcedureBase(tpno, aLog) {};
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         ~CPosTp42() {};
       
    50 
       
    51     public: // Functions from base classes
       
    52 
       
    53         
       
    54         /**
       
    55         * From CLandmarkTestProcedureBase
       
    56         * Runs the test in the module
       
    57         */
       
    58         void StartL();
       
    59 
       
    60         /**
       
    61         * From CLandmarkTestProcedureBase
       
    62         * Cleans up after a test.
       
    63         * Always called, even if the test leaves. 
       
    64         */
       
    65         void CloseTest();
       
    66     private:
       
    67     
       
    68         void TestWithBufferL();
       
    69         
       
    70         void TestWithFileL();
       
    71         
       
    72         void TestWithEmptyFileL();
       
    73         
       
    74         void TestWithLargeFilesL(const TDesC& msg, TInt aExpCode);
       
    75     
       
    76         void CreateFileL( const TDesC& msg, TFileName& aFileName );
       
    77         
       
    78         void CheckResultL(TDataRecognitionResult aExpectedResult, TDataRecognitionResult aResult);
       
    79 
       
    80     private:
       
    81         RPointerArray<CRecognizerData>   iDataToRecognize;
       
    82         TInt iErrorsFound;
       
    83 
       
    84     };
       
    85 
       
    86 #endif      // CPOSTP42_H
       
    87 
       
    88 /**
       
    89 * Data class only used with TP42 to hold information
       
    90 * read from the file i,e the data to be recongnized and
       
    91 * the expected result.
       
    92 */
       
    93 class CRecognizerData: public CBase
       
    94     {
       
    95     public:  // Constructors and destructor
       
    96         
       
    97          /**
       
    98         * Two-phased constructor.
       
    99         */
       
   100         static CRecognizerData* NewL(const TDesC& aDes); 
       
   101 
       
   102         /**
       
   103         * Destructor.
       
   104         */
       
   105         ~CRecognizerData();      
       
   106 
       
   107     public:
       
   108 
       
   109          TPtrC RecognizerData() const;
       
   110         
       
   111          const TDataRecognitionResult& ExpectedResult() const;
       
   112 
       
   113     private: 
       
   114         
       
   115         CRecognizerData();
       
   116 
       
   117         void ConstructL(const TDesC& aDes);
       
   118 
       
   119     private:
       
   120          // By default, prohibit copy constructor
       
   121         CRecognizerData(const CRecognizerData&);
       
   122         // Prohibit assigment operator
       
   123         CRecognizerData& operator=(const CRecognizerData&);
       
   124 
       
   125         void ParseResult(const TDesC& aDes);
       
   126         void ParseType(const TDesC& aDes);
       
   127         
       
   128         
       
   129     private: // Data
       
   130         
       
   131         enum TValueIndex
       
   132 			{
       
   133             ETextBuffer          = 0,	
       
   134             EResult              = 1,
       
   135             EType                = 2
       
   136 			};
       
   137         HBufC*                     iRecognizerData;
       
   138         TDataRecognitionResult      iExpectedResult;
       
   139 
       
   140     };
       
   141 
       
   142             
       
   143 // End of File