equal
deleted
inserted
replaced
281 // test methods |
281 // test methods |
282 // |
282 // |
283 |
283 |
284 void testHarvestJpg(Itk::TestMgr * testMgr) |
284 void testHarvestJpg(Itk::TestMgr * testMgr) |
285 { |
285 { |
286 char *xml_file = (char *)__FUNCTION__; |
|
287 assert_failed = 0; |
|
288 testMgr_ = testMgr; |
286 testMgr_ = testMgr; |
289 Cpt::traverse(JPG_TEST_CORPUS_PATH, |
287 Cpt::traverse(JPG_TEST_CORPUS_PATH, |
290 this); |
288 this); |
291 util_->flush(); |
289 util_->flush(); |
292 testResultXml(xml_file); |
290 tSearchJpg(Itk::TestMgr * testMgr) |
293 } |
291 { |
294 |
|
295 |
|
296 void testSearchJpg(Itk::TestMgr * testMgr) |
|
297 { |
|
298 char *xml_file = (char *)__FUNCTION__; |
|
299 assert_failed = 0; |
|
300 testMgr_ = testMgr; |
292 testMgr_ = testMgr; |
301 |
293 |
302 cpix_Hits |
294 cpix_Hits |
303 * hits = search(GPSLOC_DATA, |
295 * hits = search(GPSLOC_DATA, |
304 sizeof(GPSLOC_DATA) / sizeof(GpsLocation), |
296 sizeof(GPSLOC_DATA) / sizeof(GpsLocation), |
305 NULL, |
297 NULL, |
306 4.0, |
298 4.0, |
307 10); |
299 10); |
308 |
300 |
309 cpix_Hits_destroy(hits); |
301 cpix_Hits_destroy(hits); |
310 testResultXml(xml_file); |
302 |
311 } |
303 } |
312 |
304 |
313 private: |
305 private: |
314 void cleanup() |
306 delete util_; |
315 { |
|
316 delete util_; |
|
317 util_ = NULL; |
307 util_ = NULL; |
318 |
308 |
319 cpix_Analyzer_destroy(analyzer_); |
309 cpix_Analyzer_destroy(analyzer_); |
320 analyzer_ = NULL; |
310 analyzer_ = NULL; |
321 |
311 |
437 cpix_Succeeded(queryParser_), |
427 cpix_Succeeded(queryParser_), |
438 "Failed to parse: %S\n", |
428 "Failed to parse: %S\n", |
439 qryStr); |
429 qryStr); |
440 if(!cpix_Succeeded(queryParser_)) |
430 if(!cpix_Succeeded(queryParser_)) |
441 { |
431 { |
442 assert_failed = 1; |
432 |
443 } |
|
444 |
|
445 cpix_Hits |
433 cpix_Hits |
446 * hits = cpix_IdxDb_search(util_->idxDb(), |
434 * hits = cpix_IdxDb_search(util_->idxDb(), |
447 query_); |
435 query_); |
448 ITK_ASSERT(testMgr_, |
436 ITK_ASSERT(testMgr_, |
449 cpix_Succeeded(util_->idxDb()), |
437 cpix_Succeeded(util_->idxDb()), |
450 "Failed to search (geo)"); |
438 "Failed to search (geo)"); |
451 if(!cpix_Succeeded(util_->idxDb())) |
439 if(!cpix_Succeeded(util_->idxDb())) |
452 { |
440 { |
453 assert_failed = 1; |
441 |
454 } |
442 } |
455 |
443 |
456 int32_t |
444 int32_t |
457 hitCount = cpix_Hits_length(hits); |
445 hitCount = cpix_Hits_length(hits); |
458 |
446 |