275 // public operations |
274 // public operations |
276 // |
275 // |
277 |
276 |
278 void testAddFiles(Itk::TestMgr * testMgr) |
277 void testAddFiles(Itk::TestMgr * testMgr) |
279 { |
278 { |
280 char *xml_file = (char *)__FUNCTION__; |
|
281 assert_failed = 0; |
|
282 testMgr_ = testMgr; |
279 testMgr_ = testMgr; |
283 Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en", |
280 Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en", |
284 this); |
281 this); |
285 util_->flush(); |
282 util_->flush(); |
286 testResultXml(xml_file); |
|
287 } |
|
288 |
|
289 |
|
290 |
|
291 void testSearchFiles(Itk::TestMgr * testMgr) |
283 void testSearchFiles(Itk::TestMgr * testMgr) |
292 { |
284 { |
293 using namespace Itk; |
285 using namespace Itk; |
294 char *xml_file = (char *)__FUNCTION__; |
|
295 assert_failed = 0; |
|
296 cpix_Hits |
286 cpix_Hits |
297 * hits = cpix_IdxDb_search(util_->idxDb(), |
287 * hits = cpix_IdxDb_search(util_->idxDb(), |
298 query_); |
288 query_); |
299 |
289 |
300 if (cpix_Failed(util_->idxDb())) |
290 if (cpix_Failed(util_->idxDb())) |
301 { |
291 { |
302 ITK_EXPECT(testMgr, |
292 ITK_EXPECT(testMgr, |
303 false, |
293 false, |
304 "Failed to search index"); |
294 "Failed to search index"); |
305 cpix_ClearError(util_->idxDb()); |
295 cpix_ClearError(util_->idxDb()); |
306 assert_failed = 1; |
296 |
307 } |
297 } |
308 else |
298 else |
309 { |
299 { |
310 util_->printHits(hits, |
300 util_->printHits(hits, |
311 testMgr); |
301 testMgr); |
312 |
302 |
313 cpix_Hits_destroy(hits); |
303 cpix_Hits_destroy(hits); |
314 } |
304 } |
315 testResultXml(xml_file); |
305 |
316 |
306 |
317 } |
307 } |
318 |
308 |
319 |
309 |
320 void testDeleteFiles(Itk::TestMgr * testMgr) |
310 void testDeleteFiles(Itk::TestMgr * testMgr) |
321 { |
311 { |
322 char *xml_file = (char *)__FUNCTION__; |
|
323 assert_failed = 0; |
|
324 deleteFiles(testMgr, |
312 deleteFiles(testMgr, |
325 EnglishDocsToDelete, |
313 EnglishDocsToDelete, |
326 sizeof(EnglishDocsToDelete)/sizeof(wchar_t*), |
314 sizeof(EnglishDocsToDelete)/sizeof(wchar_t*), |
327 2); |
315 2); |
328 util_->flush(); |
316 util_->flush(); |
329 testResultXml(xml_file); |
317 |
330 } |
318 } |
331 |
319 |
332 |
320 |
333 }; |
321 }; |
334 |
322 |