plugins/contacts/symbian/contactsmodel/tsrc/cntplsql/src/t_cpplpredictivesearchtable.cpp
changeset 5 603d3f8b6302
parent 0 876b1a06bc25
equal deleted inserted replaced
3:e4ebb16b39ea 5:603d3f8b6302
   100     {
   100     {
   101     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
   101     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
   102     // It generates the test case table.
   102     // It generates the test case table.
   103     CEUnitTestSuiteClass::ConstructL();
   103     CEUnitTestSuiteClass::ConstructL();
   104     
   104     
   105 #if defined(USE_ORBIT_KEYMAP)
       
   106     // Create singleton outside actual test cases so that it is not treated as
   105     // Create singleton outside actual test cases so that it is not treated as
   107     // resource leak, since it can't be deleted.
   106     // resource leak, since it can't be deleted.
   108     HbKeymapFactory::instance();
   107     HbKeymapFactory::instance();
   109 #else
       
   110     // If Orbit keymap is not used, EUnit shows there is a resource leak in the
       
   111     // first test case of UT_CPplPredictiveSearchTable that writes something to
       
   112     // the database.
       
   113     // To get rid of the resource leak, the following code is here to create DB,
       
   114     // and one contact, delete it, delete DB. 
       
   115     SetupL();
       
   116     UT_DeleteLL(); // Adds and deletes 1 contact
       
   117     Teardown();
       
   118 #endif
       
   119     }
   108     }
   120     
   109     
   121 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   122 // UT_CPplPredictiveSearchTable::SetupL
   111 // UT_CPplPredictiveSearchTable::SetupL
   123 // Must start with an empty DB file for each test case
   112 // Must start with an empty DB file for each test case
   141     iPredictiveSearchSynchronizer =
   130     iPredictiveSearchSynchronizer =
   142         CPredictiveSearchSynchronizer::NewL(iDB,
   131         CPredictiveSearchSynchronizer::NewL(iDB,
   143                                             *iTable,
   132                                             *iTable,
   144                                             *iPredSearchQwertyTable,
   133                                             *iPredSearchQwertyTable,
   145                                             *iPredSearchSettingsTable);  
   134                                             *iPredSearchSettingsTable);  
   146 #if defined(USE_ORBIT_KEYMAP)
       
   147     HbKeymapFactory::instance();
   135     HbKeymapFactory::instance();
   148 #endif
       
   149 	}
   136 	}
   150     
   137     
   151 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   152 // UT_CPplPredictiveSearchTable::SetupSyncL
   139 // UT_CPplPredictiveSearchTable::SetupSyncL
   153 // For synchronize tables test case
   140 // For synchronize tables test case