searchengine/cpix/tsrc/cpixunittest/src/testutils.cpp
changeset 24 65456528cac2
parent 14 8bd192d47aaa
equal deleted inserted replaced
23:d4d56f5e7c55 24:65456528cac2
   224 
   224 
   225             ITK_PANIC("Could not create/open idx db '%s' for '%s - %S'",
   225             ITK_PANIC("Could not create/open idx db '%s' for '%s - %S'",
   226                       idxDbPath(),
   226                       idxDbPath(),
   227                       qualBaseAppClass(),
   227                       qualBaseAppClass(),
   228                       report);
   228                       report);
   229             assert_failed = 1;
   229 }
   230         }
   230              schemaId_ = addSchema();
   231 
       
   232     schemaId_ = addSchema();
       
   233 }
   231 }
   234 
   232 
   235 void IdxUtil::reload() throw (Itk::PanicExc)
   233 void IdxUtil::reload() throw (Itk::PanicExc)
   236 {
   234 {
   237     cpix_Result
   235     cpix_Result
   288 {
   286 {
   289 	cpix_IdxDb_flush( idxDb_ );
   287 	cpix_IdxDb_flush( idxDb_ );
   290 	
   288 	
   291     if ( cpix_Failed( idxDb_ ) )
   289     if ( cpix_Failed( idxDb_ ) )
   292     {
   290     {
   293         assert_failed = 1;
   291 
   294 		ITK_PANIC("Could not flush idx db '%s' for '%s'",
   292 		ITK_PANIC("Could not flush idx db '%s' for '%s'",
   295 				  idxDbPath(),
   293 				  idxDbPath(),
   296 				  qualBaseAppClass());
   294 				  qualBaseAppClass());
   297     }
   295     }
   298 }
   296 }
   497             ITK_MSG(testMgr,
   495             ITK_MSG(testMgr,
   498                     "Deleted %d items by %S",
   496                     "Deleted %d items by %S",
   499                     result,
   497                     result,
   500                     docUid.c_str());
   498                     docUid.c_str());
   501         }
   499         }
   502     else
   500 
   503         {
       
   504             assert_failed = 1;
       
   505         }
       
   506 }
   501 }
   507 
   502 
   508 
   503 
   509 void SmsIdxUtil::indexSms(size_t          id,
   504 void SmsIdxUtil::indexSms(size_t          id,
   510                           const wchar_t * body,
   505                           const wchar_t * body,
   590                        false,
   585                        false,
   591                        "%s %d: %S",
   586                        "%s %d: %S",
   592                        failureStr,
   587                        failureStr,
   593                        id,
   588                        id,
   594                        report);
   589                        report);
   595             assert_failed = 1;
   590             
   596             cpix_ClearError(idxDb());
   591             cpix_ClearError(idxDb());
   597         }
   592         }
   598 }
   593 }
   599 
       
   600 
   594 
   601 std::wstring SmsIdxUtil::getIdStr(cpix_Document * doc,
   595 std::wstring SmsIdxUtil::getIdStr(cpix_Document * doc,
   602                                   Itk::TestMgr  * testMgr)
   596                                   Itk::TestMgr  * testMgr)
   603 {
   597 {
   604     const wchar_t
   598     const wchar_t