landmarks/locationlandmarks/tsrc/LandmarkTestModule/inc/FT_CPosTp39.h
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     1 /*
       
     2 * Copyright (c) 2004 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 CPOSTP39_H
       
    21 #define CPOSTP39_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <e32std.h> 
       
    27 
       
    28 
       
    29 #include "FT_CLandmarkTestProcedureBase.h"
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 
       
    35 /**
       
    36 *  Test procedure 39
       
    37 */
       
    38 class CPosTp39 : public CLandmarkTestProcedureBase
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41         
       
    42         /**
       
    43         * C++ default constructor.
       
    44         */
       
    45         CPosTp39() : CLandmarkTestProcedureBase(39) {};
       
    46         
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         ~CPosTp39() {};
       
    51 
       
    52     public: // Functions from base classes
       
    53 
       
    54         /**
       
    55         * From CUtfwTestBase
       
    56         * Retrieves the test module name
       
    57         * @param aName The name of the test module.
       
    58         */
       
    59         void GetName(
       
    60             TDes&   aName
       
    61             ) const;
       
    62 
       
    63         /**
       
    64         * From CLandmarkTestProcedureBase
       
    65         * Runs the test in the module
       
    66         */
       
    67         void StartL();
       
    68 
       
    69         /**
       
    70         * From CLandmarkTestProcedureBase
       
    71         * Always called, even if the test leaves
       
    72         */
       
    73         void CloseTest();
       
    74 
       
    75         
       
    76     public:
       
    77 
       
    78         static void RunEventsListenerL(TAny* aData);
       
    79         
       
    80         static void RunEventsGeneratorL(TAny* aData);
       
    81 
       
    82         void LogError(const TDesC& aError);
       
    83 
       
    84         void CheckEvent(const TInt aThreadIndex,
       
    85                         const TPosLmEventType  aExpectedEventType,
       
    86 	                    const TPosLmEventType  aEventType,
       
    87 	                    const TPosLmItemId aExpectedItemId,
       
    88 	                    const TPosLmItemId aItemId);
       
    89         
       
    90 
       
    91     private: // Functions
       
    92     
       
    93         void SetupGlobalCategoriesL();
       
    94 
       
    95         void CreateThreadsL();
       
    96         
       
    97         TInt GetHeapSizeL(const TDesC& aThreadName, TInt& aHeapSize, TInt& aStackSize);
       
    98         
       
    99     private: // data   
       
   100         
       
   101         RArray<RThread>	          iThreads;
       
   102         TInt                      iErrors;
       
   103         TBuf<4095>                iErrorLog;
       
   104         TInt                      iThreadIndex;
       
   105     };
       
   106 
       
   107 class CEventObserverTp39 : public CActive
       
   108     {
       
   109      public: // Constructors and destructor
       
   110         
       
   111         static CEventObserverTp39* NewL(CPosTp39* aTp39, TInt aThreadIndex);
       
   112        
       
   113         /**
       
   114         * Destructor.
       
   115         */
       
   116         ~CEventObserverTp39();
       
   117 
       
   118     public: // Functions from base classes
       
   119 
       
   120         void Start();    
       
   121 
       
   122         /**
       
   123         * From CActive
       
   124         * Handles request completion event.
       
   125         */
       
   126         void DoCancel();
       
   127     
       
   128         /**
       
   129         * From CActive.
       
   130         *
       
   131         * Handles request completion event.
       
   132         */
       
   133         void RunL();   
       
   134 
       
   135          void StartTimer();
       
   136 
       
   137     private:
       
   138         
       
   139          /**
       
   140         * C++ constructor.
       
   141         */
       
   142         CEventObserverTp39(CPosTp39* aTp39, TInt aThreadIndex); 
       
   143 
       
   144         void ConstructL();
       
   145 
       
   146         static TInt StopEventNotification(TAny* aSelf);
       
   147         
       
   148     private: // Data
       
   149         
       
   150         CPosTp39*               iTp39;
       
   151         TInt                    iEventNumber;
       
   152         TInt                    iThreadIndex;
       
   153         TPosLmEvent             iEvent;
       
   154         CPosLandmarkDatabase*   iDatabase;
       
   155         CPeriodic*              iPeriodicTimer;
       
   156         TCallBack               iCallback;
       
   157        
       
   158 
       
   159         
       
   160     };
       
   161 
       
   162 #endif      // CPOSTP39_H
       
   163             
       
   164 // End of File