uiacceltk/hitchcock/CommonInc/alfmoduletest.h
branchRCL_3
changeset 7 88b23e2e82e1
parent 6 10534483575f
child 8 46927d61fef3
equal deleted inserted replaced
6:10534483575f 7:88b23e2e82e1
     1 #include "e32base.h"
       
     2 #include "e32debug.h"
       
     3 
       
     4 #ifndef ALFMODULETEST_H
     1 #ifndef ALFMODULETEST_H
     5 #define ALFMODULETEST_H
     2 #define ALFMODULETEST_H
     6 
     3 
     7 // Define this to build module testing enchanced version of ALF
     4 
     8 //#define USE_MODULE_TEST_HOOKS_FOR_ALF 
     5 #include <e32base.h>
     9 
     6 #include <e32debug.h>
    10 #if !defined(USE_MODULE_TEST_HOOKS_FOR_ALF) || !defined(AMT_CONTROL)
     7 
    11 
     8 // Informs if module test hooks have been set on.
    12 #define AMT_DATA()
     9 #include "alfmoduletestconf.h"
    13 #define AMT_FUNC(func)                                
    10 
    14 #define AMT_FUNC_EXC(func)
    11 // Provides module test hooks defines.
    15 #define AMT_FUNC_EXC_RET(ret, func)
    12 #include "alfmoduletestdefines.h"
    16 #define AMT_FUNC_EXC_IF(cond, func)
    13 
    17 #define AMT_FUNC_EXC_IF_RET(cond, ret, func)
    14 
    18 #define AMT_INC_COUNTER(member)
    15 #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF
    19 #define AMT_DEC_COUNTER(member)
    16 
    20 #define AMT_SET_VALUE(member, val)
    17 // *** Test map classes
    21 #define AMT_GET_VALUE(x, member)
    18 #include "alfmoduletesttype.h"
    22 #define AMT_INC_COUNTER_IF(cond, member)
    19 #include "alfmoduletestitem.h"
    23 #define AMT_DEC_COUNTER_IF(cond, member)
    20 #include "alfmoduletestmap.h"
    24 #define AMT_SET_VALUE_IF(cond, member, val)
    21 
    25 #define AMT_GET_VALUE_IF(cond, x, member)
       
    26 
       
    27 #define AMT_MAP_APPEND(memberMap, key, type, defaultValue)          
       
    28 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type)     
       
    29 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type)            
       
    30 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type)            
       
    31 #define AMT_MAP_SET_VALUE(memberMap, key, value, type)              
       
    32 #define AMT_MAP_INC_VALUE(memberMap, key, type)                              
       
    33 #define AMT_MAP_DEC_VALUE(memberMap, key, type)                     
       
    34 #define AMT_MAP_RESET(memberMap)                                    
       
    35 
       
    36 #define AMT_PRINT_STATE()
       
    37 
       
    38 #ifndef AMT_CONTROL
       
    39 #error "Error: you need to define AMT_CONTROL macro in your code to be able to use ALF module test system!"
       
    40 // The user have to define AMT_CONTROL, e.g. like this:
       
    41 // #define AMT_CONTROL() static_cast<CAlfModuleTestDataControl*>(Dll::Tls())
       
    42 // or
       
    43 // #define AMT_CONTROL() iMyModuleTestDataControl
       
    44 // etc.
       
    45 #endif
       
    46 
       
    47 #else
       
    48 
       
    49 
       
    50 //  *** Use these macros to access global memory chunk
       
    51 
       
    52 
       
    53 // Note: If you read/write a large block of data members, it is advisable not use the AMT_FUNC_EXC() based macros below. 
       
    54 //       Use Lock() and Unlock() around the block explicitely, and use AMT_FUNC() macro.
       
    55 //       That is to avoid unnecessary nested lock-unlock sequences (even if nested locks are working ok).
       
    56 
       
    57 // Note: Be careful not to lock the the mutex for a long time as it will halt other processes if they are using the lock during that time!
       
    58 
       
    59 // Generic macros
       
    60 #define AMT_DATA()                  AMT_CONTROL()->iModuleTestData
       
    61 #define AMT_FUNC(func)              if (AMT_DATA()->iIsEnabled) {func;}                                         
       
    62 #define AMT_FUNC_EXC(func)          {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();}
       
    63 #define AMT_FUNC_EXC_RET(ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {ret = func;} AMT_CONTROL()->Unlock();}
       
    64 #define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();}        
       
    65 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {ret = func;} AMT_CONTROL()->Unlock();}
       
    66 
       
    67 // Single operation macros, that will do lock/unlock.
       
    68 #define AMT_INC_COUNTER(member)     AMT_FUNC_EXC(AMT_DATA()->member++)
       
    69 #define AMT_DEC_COUNTER(member)     AMT_FUNC_EXC(AMT_DATA()->member--)
       
    70 #define AMT_SET_VALUE(member, val)  AMT_FUNC_EXC(AMT_DATA()->member=(val))
       
    71 #define AMT_GET_VALUE(x, member)    AMT_FUNC_EXC((x) = AMT_DATA()->member)
       
    72 #define AMT_PRINT_STATE()           AMT_FUNC_EXC(AMT_DATA()->PrintState())
       
    73 
       
    74 // Conditional single operation macros, that will do lock/unlock.
       
    75 #define AMT_INC_COUNTER_IF(cond, member)    AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++)
       
    76 #define AMT_DEC_COUNTER_IF(cond, member)    AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--)
       
    77 #define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val))
       
    78 #define AMT_GET_VALUE_IF(cond, x, member)   AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member)
       
    79 
       
    80 // Map operation macros, that will do lock/unlock
       
    81 #define AMT_MAP_APPEND(memberMap, key, type, defaultValue)          AMT_FUNC_EXC(AMT_DATA()->memberMap.Append(key, type, defaultValue))
       
    82 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type)     AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.SetValue(key, value, type))
       
    83 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type)            AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.Find(key, type)), AMT_DATA()->memberMap.SetValue(key, AMT_DATA()->memberMap.Find(key, type)->Value() + 1, type))
       
    84 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type)            AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.Find(key, type)), AMT_DATA()->memberMap.SetValue(key, AMT_DATA()->memberMap.Find(key, type)->Value() - 1, type))
       
    85 #define AMT_MAP_SET_VALUE(memberMap, key, value, type)              AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetValue(key, value, type))
       
    86 #define AMT_MAP_INC_VALUE(memberMap, key, type)                     AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type)              
       
    87 #define AMT_MAP_DEC_VALUE(memberMap, key, type)                     AMT_MAP_DEC_VALUE_IF(ETrue, memberMap, key, type)
       
    88 #define AMT_MAP_RESET(memberMap)                                    AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset())
       
    89 
    22 
    90 // *** Global object names
    23 // *** Global object names
    91 _LIT(KAlfModuleTestChunkName, "ALF_MODULE_TEST_CHUNK");
    24 _LIT(KAlfModuleTestChunkName, "ALF_MODULE_TEST_CHUNK");
    92 _LIT(KAlfModuleTestMutexName, "ALF_MODULE_TEST_MUTEX");
    25 _LIT(KAlfModuleTestMutexName, "ALF_MODULE_TEST_MUTEX");
    93 
    26 
    94 
    27 
    95 /**
       
    96  * TAlfModuleTestType specifies recognized test types.
       
    97  */
       
    98 enum TAlfModuleTestType
       
    99     {
       
   100     // Do not use this value when creating item.
       
   101     EAlfModuleTestTypeNone,
       
   102     
       
   103     // Render stage component specific tests
       
   104     EAlfModuleTestTypeRenderStageChangeSize,
       
   105     EAlfModuleTestTypeRenderStageChangePosition,
       
   106     EAlfModuleTestTypeRenderStageChangeFlag,
       
   107     
       
   108     // Streamer hierarchy model component specific tests
       
   109     EAlfModuleTestTypeHierarchyModelChangeSize,
       
   110     EAlfModuleTestTypeHierarchyModelChangePosition,
       
   111     EAlfModuleTestTypeHierarchyModelChangeFlag,    
       
   112     
       
   113     // Server bridge component specific tests
       
   114     EAlfModuleTestTypeBridgeChangeSize,
       
   115     EAlfModuleTestTypeBridgeChangePosition,
       
   116     EAlfModuleTestTypeBridgeChangeFlag,
       
   117     
       
   118     // Do not use this value when creating item.
       
   119     // This is just meant for Find operations when all tests are accepted.
       
   120     EAlfModuleTestTypeAll
       
   121     };
       
   122 
       
   123 
       
   124 /**
       
   125  * CAlfModuleTestItem
       
   126  * 
       
   127  * Provides key-value pair that is used in TAlfModuleTestMap.
       
   128  */
       
   129 template< class T >
       
   130 NONSHARABLE_CLASS( TAlfModuleTestItem )
       
   131     {
       
   132     
       
   133 public:
       
   134 
       
   135     /**
       
   136      * Constructor to initialize variables.
       
   137      * 
       
   138      * @param aKey Key that identifies the item.
       
   139      *             In test cases this could be for example handle.
       
   140      * @param aTestType Defines for what this test item is meant for.
       
   141      */
       
   142     TAlfModuleTestItem( TInt aKey, const TAlfModuleTestType& aTestType, const T& aDefaultValue ):
       
   143         iKey( aKey ),
       
   144         iTestType( aTestType ),
       
   145         iValue( aDefaultValue ),
       
   146         iValueSetCount( 0 )
       
   147         {
       
   148         }
       
   149 
       
   150     
       
   151     /**
       
   152      * @param aObject Value to be compared.
       
   153      * @return ETrue if given object equals the value of this item.
       
   154      *         Else EFalse.
       
   155      */
       
   156     TBool Equals( const T& aValue, const TAlfModuleTestType& aTestType ) const
       
   157         {
       
   158         // Also, check that value has been set. If it has not been set,
       
   159         // then think objects as unequals.
       
   160         return ( iValueSetCount > 0 
       
   161                  && iValue == aValue 
       
   162                  && TestTypeMatch( aTestType ) );
       
   163         }
       
   164 
       
   165     
       
   166     /**
       
   167      * @return TInt Key that should be set during creation of this object.
       
   168      */
       
   169     TInt Key() const
       
   170         {
       
   171         return iKey;
       
   172         }
       
   173 
       
   174     /**
       
   175      * @see ValueSet to check if the value has already been set.
       
   176      * 
       
   177      * @return const T& Value that corresonds the key.
       
   178      */
       
   179     const T& Value() const
       
   180         {
       
   181         return iValue;
       
   182         }
       
   183     
       
   184     
       
   185     /**
       
   186      * @param aValue Value to be set for the key
       
   187      */
       
   188     void SetValue( const T& aValue )
       
   189         {
       
   190         iValue = aValue;
       
   191         ++iValueSetCount;
       
   192         }
       
   193 
       
   194     
       
   195     /**
       
   196      * @return TInt Informs how many times the value has been set. 
       
   197      */
       
   198     TInt ValueSetCount() const
       
   199         {
       
   200         return iValueSetCount;
       
   201         }
       
   202     
       
   203     /**
       
   204      * @return const TAlfModuleTestType& Defines what the test is for
       
   205      */
       
   206     const TAlfModuleTestType& TestType() const
       
   207         {
       
   208         return iTestType;
       
   209         }
       
   210 
       
   211     
       
   212     /**
       
   213      * @param aTestType
       
   214      * @return TBool ETrue if flag matches this item. Else EFalse.
       
   215      */
       
   216     TBool TestTypeMatch( const TAlfModuleTestType& aTestType ) const
       
   217         {
       
   218         return ( EAlfModuleTestTypeAll == aTestType
       
   219                  || iTestType == aTestType );
       
   220         }
       
   221 
       
   222     
       
   223     /**
       
   224      * Resets the item info
       
   225      */
       
   226     void Reset()
       
   227         {
       
   228         iValueSetCount = 0;
       
   229         }
       
   230 
       
   231     
       
   232 private: // data    
       
   233     
       
   234     TInt iKey;
       
   235     TAlfModuleTestType iTestType;    
       
   236     T iValue;
       
   237     TInt iValueSetCount;
       
   238     
       
   239     };
       
   240 
       
   241 
       
   242 /**
       
   243  * Class CAlfModuleTestMap
       
   244  * 
       
   245  * Provides map functionality for the key-value-pairs.
       
   246  * In test cases, this should most likely be used so, that 
       
   247  * first test case classes create items with certain keys, for example with handle values.
       
   248  * Then, define hooks are used in the code to update values that corresond the correct handles.
       
   249  * In the end, test case classes can check that items have correct values set and if the test
       
   250  * is passed.
       
   251  */
       
   252 template< class T >
       
   253 NONSHARABLE_CLASS( TAlfModuleTestMap )
       
   254     {
       
   255 public:
       
   256 
       
   257     // Maximum item count in the map
       
   258     static const TInt KMaxArrayCount = 50;
       
   259 
       
   260     
       
   261     /**
       
   262      * Constructor to initialize variables.
       
   263      */
       
   264     TAlfModuleTestMap():
       
   265         iCount( 0 ),
       
   266         iSetValueCallCount( 0 )
       
   267         {            
       
   268         }
       
   269 
       
   270     
       
   271     /**
       
   272      * @param aKey
       
   273      * @param aTestType Informs what type of test is accepted. Others are skipped.
       
   274      * @return T* Ownership is not transferred.
       
   275      *            NULL if item is not found.
       
   276      */
       
   277     TAlfModuleTestItem< T >* Find( TInt aKey, const TAlfModuleTestType& aTestType )
       
   278         {
       
   279         // Try to find the item corresponding the given key.
       
   280         for ( TInt i = 0; i < iCount; ++i )
       
   281             {
       
   282             TAlfModuleTestItem< T >& testItem( iArray[ i ] );
       
   283             if ( testItem.Key() == aKey
       
   284                  && testItem.TestTypeMatch( aTestType ) )
       
   285                 {
       
   286                 return &( testItem );
       
   287                 }
       
   288             }
       
   289         // Item corresponding the given key was not found.
       
   290         return NULL;
       
   291         }    
       
   292     
       
   293     
       
   294     /**
       
   295      * Function to append new item into the map.
       
   296      * 
       
   297      * @param aKey
       
   298      * @param aTestType Describes for what case the appended test item is created for.
       
   299      * @return TInt System wide error code.
       
   300      */    
       
   301     TInt Append( TInt aKey, const TAlfModuleTestType& aTestType, const T& aDefaultValue )
       
   302         {
       
   303         if ( iCount == KMaxArrayCount )
       
   304             {
       
   305             // Array already full.
       
   306             return KErrOverflow;
       
   307             }
       
   308         else if ( Find( aKey, aTestType ) )
       
   309             {
       
   310             // Key has already been inserted.
       
   311             return KErrAlreadyExists;
       
   312             }
       
   313         
       
   314         // Append new key value set into the array.
       
   315         iArray[ iCount ] = TAlfModuleTestItem< T >( aKey, aTestType, aDefaultValue );
       
   316         ++iCount;
       
   317         return KErrNone;        
       
   318         }
       
   319 
       
   320     
       
   321     /**
       
   322      * Sets the value for the item.
       
   323      * Item itself should already exist in the array before
       
   324      * setting its value here. See, Append function.
       
   325      * 
       
   326      * @param aKey
       
   327      * @param aValue
       
   328      * @return TInt System wide error code.
       
   329      */
       
   330     TInt SetValue( TInt aKey, const T& aValue, const TAlfModuleTestType& aTestType )
       
   331         {
       
   332         // Increase counter, because this function is called.
       
   333         ++iSetValueCallCount;
       
   334         TAlfModuleTestItem< T >* item( Find( aKey, aTestType ) );        
       
   335         if ( !item )
       
   336             {
       
   337             // Item was not found from the array.        
       
   338             return KErrNotFound;
       
   339             }        
       
   340         // Item exists. So, set its values.
       
   341         item->SetValue( aValue );
       
   342         return KErrNone;
       
   343         }
       
   344 
       
   345     
       
   346     /**
       
   347      * Resets the map
       
   348      */
       
   349     void Reset()
       
   350         {
       
   351         // Just reset the counter.
       
   352         // We do not bother to reset map items, because when counter is reseted
       
   353         // already set items and their info is left out of the scope.
       
   354         iCount = 0;
       
   355         iSetValueCallCount = 0;
       
   356         }
       
   357     
       
   358     
       
   359     /**
       
   360      * Checks if all the values of items in the array match the given value.
       
   361      * 
       
   362      * @param aValue Reference to the value that items are compared to.
       
   363      * @param aTestType Informs the test type whose items should be compared.
       
   364      */
       
   365     TInt CountEquals( const T& aValue, const TAlfModuleTestType& aTestType ) const
       
   366         {
       
   367         TInt count( 0 );
       
   368         for ( TInt i = 0; i < iCount; ++i )
       
   369             {
       
   370             if ( iArray[ i ].Equals( aValue, aTestType ) )
       
   371                 {
       
   372                 // Item matches
       
   373                 ++count;            
       
   374                 }
       
   375             }
       
   376         return count;
       
   377         }
       
   378 
       
   379 
       
   380     /**
       
   381      * @return TInt Number of map items
       
   382      */
       
   383     TInt ItemCount() const
       
   384         {
       
   385         return iCount;
       
   386         }
       
   387 
       
   388 
       
   389     /**
       
   390      * @return const TAlfModuleTestItem< T >& Reference to the map item
       
   391      */
       
   392     const TAlfModuleTestItem< T >& Item( TInt aIndex ) const
       
   393         {
       
   394         return iArray[ aIndex ];
       
   395         }
       
   396 
       
   397     
       
   398     /**
       
   399      * @return TInt Number of times SetValue function has been called
       
   400      *              since last reset. This information can be used
       
   401      *              to check if hooks have been used correct times during
       
   402      *              a test case. Notice, that this informs the number of
       
   403      *              function calls, not the number of times a value has actually
       
   404      *              set for some item.
       
   405      */
       
   406     TInt SetValueCallCount() const
       
   407         {
       
   408         return iSetValueCallCount;
       
   409         }
       
   410     
       
   411     
       
   412 private: // data
       
   413     
       
   414     TAlfModuleTestItem< T > iArray[ KMaxArrayCount ];
       
   415     // Informs number of array items
       
   416     TInt iCount;
       
   417     // Informs how many times SetItem has been called since last reset.
       
   418     // Notice, that this informs the number of function calls, not the number
       
   419     // of times a value has actually set for some item.
       
   420     TInt iSetValueCallCount;
       
   421     
       
   422     };
       
   423 
       
   424     
       
   425 /*
    28 /*
   426  *  Class CAlfModuleTestData
    29  *  Class CAlfModuleTestData
   427  */
    30  */
   428 
    31 
   429 NONSHARABLE_CLASS(CAlfModuleTestData) : public CBase
    32 NONSHARABLE_CLASS(CAlfModuleTestData) : public CBase
   469         RDebug::Print(_L("iLatestVisualExtentRect= x:%d, y:%d, width=%d, height=%d"), 
    72         RDebug::Print(_L("iLatestVisualExtentRect= x:%d, y:%d, width=%d, height=%d"), 
   470                          iLatestVisualExtentRect.iTl.iX, iLatestVisualExtentRect.iTl.iY, 
    73                          iLatestVisualExtentRect.iTl.iX, iLatestVisualExtentRect.iTl.iY, 
   471                          iLatestVisualExtentRect.Width(), iLatestVisualExtentRect.Height());
    74                          iLatestVisualExtentRect.Width(), iLatestVisualExtentRect.Height());
   472         RDebug::Print(_L("iTotalVisualFlagChangedCount=%d"), iTotalVisualFlagChangedCount);
    75         RDebug::Print(_L("iTotalVisualFlagChangedCount=%d"), iTotalVisualFlagChangedCount);
   473         RDebug::Print(_L("iTotalVisualAttributeChangedCount=%d"), iTotalVisualAttributeChangedCount);
    76         RDebug::Print(_L("iTotalVisualAttributeChangedCount=%d"), iTotalVisualAttributeChangedCount);
       
    77         RDebug::Print(_L("iBoolMap =>"));
       
    78         PrintBoolMapState( iBoolMap );        
       
    79         RDebug::Print(_L("iIntMap =>"));
       
    80         PrintIntMapState( iIntMap );
   474         RDebug::Print(_L("iSizeMap =>"));
    81         RDebug::Print(_L("iSizeMap =>"));
   475         PrintSizeMapState( iSizeMap );
    82         PrintSizeMapState( iSizeMap );
   476         RDebug::Print(_L("iPositionMap =>"));
    83         RDebug::Print(_L("iPositionMap =>"));
   477         PrintPositionMapState( iPositionMap );        
    84         PrintPositionMapState( iPositionMap );
   478         RDebug::Print(_L("*** ALF INTERNAL STATE ***"));
    85         RDebug::Print(_L("*** ALF INTERNAL STATE ***"));
   479         }
    86         }
   480 
    87 
       
    88 
       
    89     void PrintBoolMapState( TAlfModuleTestMap< TBool > aMap )
       
    90         {
       
    91         RDebug::Print(_L("*** ALF INTERNAL BOOL MAP STATE -->"));
       
    92         RDebug::Print(_L("Map item count=%d"), aMap.ItemCount());
       
    93         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
       
    94             {
       
    95             const TAlfModuleTestItem< TBool >& item( aMap.Item( i ) );
       
    96             RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValue=%d, iValueSetCount=%d, iLinkTargetKey=%d"),
       
    97                              i, item.TestType(), item.Key(), item.Value(), item.ValueSetCount(), item.LinkTargetKey());
       
    98             }
       
    99         RDebug::Print(_L("<-- ALF INTERNAL BOOL MAP STATE ***"));
       
   100         }
       
   101     
       
   102     
       
   103     void PrintIntMapState( TAlfModuleTestMap< TInt > aMap )
       
   104         {
       
   105         RDebug::Print(_L("*** ALF INTERNAL INT MAP STATE -->"));
       
   106         RDebug::Print(_L("Map item count=%d"), aMap.ItemCount());
       
   107         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
       
   108             {
       
   109             const TAlfModuleTestItem< TInt >& item( aMap.Item( i ) );
       
   110             RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValue=%d, iValueSetCount=%d, iLinkTargetKey=%d"),
       
   111                              i, item.TestType(), item.Key(), item.Value(), item.ValueSetCount(), item.LinkTargetKey());
       
   112             }
       
   113         RDebug::Print(_L("<-- ALF INTERNAL INT MAP STATE ***"));
       
   114         }
       
   115     
   481     
   116     
   482     void PrintSizeMapState( TAlfModuleTestMap< TSize > aMap )
   117     void PrintSizeMapState( TAlfModuleTestMap< TSize > aMap )
   483         {
   118         {
   484         RDebug::Print(_L("*** ALF INTERNAL SIZE MAP STATE -->"));
   119         RDebug::Print(_L("*** ALF INTERNAL SIZE MAP STATE -->"));
   485         RDebug::Print(_L("Map item count=%d, SetValue call count=%d"), 
   120         RDebug::Print(_L("Map item count=%d"), aMap.ItemCount());
   486                          aMap.ItemCount(), aMap.SetValueCallCount());
       
   487         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
   121         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
   488             {
   122             {
   489             const TAlfModuleTestItem< TSize >& item( aMap.Item( i ) );
   123             const TAlfModuleTestItem< TSize >& item( aMap.Item( i ) );
   490             RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d"),
   124             RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValueSetCount=%d, iLinkTargetKey=%d"),
   491                              i, item.Key(), item.TestType(), item.ValueSetCount());
   125                              i, item.TestType(), item.Key(), item.ValueSetCount(), item.LinkTargetKey());
   492             RDebug::Print(_L("Map item index=%d, width=%d, height=%d"),
   126             RDebug::Print(_L("Map item index=%d, width=%d, height=%d"),
   493                              i, item.Value().iWidth, item.Value().iHeight);
   127                              i, item.Value().iWidth, item.Value().iHeight);
   494             }
   128             }
   495         RDebug::Print(_L("<-- ALF INTERNAL SIZE MAP STATE ***"));
   129         RDebug::Print(_L("<-- ALF INTERNAL SIZE MAP STATE ***"));
   496         }
   130         }
   497 
   131 
   498     
   132     
   499     void PrintPositionMapState( TAlfModuleTestMap< TPoint > aMap )
   133     void PrintPositionMapState( TAlfModuleTestMap< TPoint > aMap )
   500         {
   134         {
   501         RDebug::Print(_L("*** ALF INTERNAL POSITION MAP STATE -->"));
   135         RDebug::Print(_L("*** ALF INTERNAL POSITION MAP STATE -->"));
   502         RDebug::Print(_L("Map item count=%d, SetValue call count=%d"), 
   136         RDebug::Print(_L("Map item count=%d"), aMap.ItemCount() );
   503                          aMap.ItemCount(), aMap.SetValueCallCount());
       
   504         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
   137         for ( TInt i = 0; i < aMap.ItemCount(); ++i )
   505             {
   138             {
   506             const TAlfModuleTestItem< TPoint >& item( aMap.Item( i ) );
   139             const TAlfModuleTestItem< TPoint >& item( aMap.Item( i ) );
   507             RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d"),
   140             RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d, iLinkTargetKey=%d"),
   508                              i, item.Key(), item.TestType(), item.ValueSetCount());
   141                              i, item.Key(), item.TestType(), item.ValueSetCount(), item.LinkTargetKey());
   509             RDebug::Print(_L("Map item index=%d, x=%d, y=%d"),
   142             RDebug::Print(_L("Map item index=%d, x=%d, y=%d"),
   510                              i, item.Value().iX, item.Value().iY);
   143                              i, item.Value().iX, item.Value().iY);
   511             }
   144             }
   512         RDebug::Print(_L("<-- ALF INTERNAL POSITION MAP STATE ***"));
   145         RDebug::Print(_L("<-- ALF INTERNAL POSITION MAP STATE ***"));
   513         }    
   146         }    
   569     TInt iASE_Temp1;
   202     TInt iASE_Temp1;
   570     TInt iASE_Temp2;
   203     TInt iASE_Temp2;
   571     TInt iASE_Temp3;
   204     TInt iASE_Temp3;
   572     TInt iASE_Temp4;
   205     TInt iASE_Temp4;
   573 
   206 
       
   207     // Map that contains boolean items that can be specified for certain test cases.
       
   208     TAlfModuleTestMap< TBool > iBoolMap;        
   574     // Map that contains integer items that can be specified for certain test cases.
   209     // Map that contains integer items that can be specified for certain test cases.
   575     TAlfModuleTestMap< TInt > iIntMap;    
   210     TAlfModuleTestMap< TInt > iIntMap;    
   576     // Map that contains size items that can be specified for certain test cases.
   211     // Map that contains size items that can be specified for certain test cases.
   577     TAlfModuleTestMap< TSize > iSizeMap;
   212     TAlfModuleTestMap< TSize > iSizeMap;
   578     // Map that contains position items that can be specified for certain test cases.
   213     // Map that contains position items that can be specified for certain test cases.
   632     RChunk iModuleTestChunk;
   267     RChunk iModuleTestChunk;
   633     RMutex iModuleTestMutex;
   268     RMutex iModuleTestMutex;
   634     CAlfModuleTestData* iModuleTestData; // Not owned
   269     CAlfModuleTestData* iModuleTestData; // Not owned
   635     };
   270     };
   636 
   271 
   637 #endif
   272 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF
       
   273 
   638 
   274 
   639 #endif // ALFMODULETEST_H
   275 #endif // ALFMODULETEST_H
   640 
   276 
   641 // End of File
   277 // End of File