77 L"rabid happening", |
78 L"rabid happening", |
78 L"look, important and happy robot", |
79 L"look, important and happy robot", |
79 L"christmas for ever", |
80 L"christmas for ever", |
80 L"christmas is an important and happy happening" |
81 L"christmas is an important and happy happening" |
81 }; |
82 }; |
|
83 |
82 |
84 |
83 |
85 |
84 class MultiFieldIdxUtil : public FileIdxUtil |
86 class MultiFieldIdxUtil : public FileIdxUtil |
85 { |
87 { |
86 public: |
88 public: |
344 // Test operations |
346 // Test operations |
345 // |
347 // |
346 void testAddFiles(Itk::TestMgr * testMgr) |
348 void testAddFiles(Itk::TestMgr * testMgr) |
347 { |
349 { |
348 testMgr_ = testMgr; |
350 testMgr_ = testMgr; |
349 |
351 char *xml_file = (char*)__FUNCTION__; |
|
352 assert_failed = 0; |
350 Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en", |
353 Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en", |
351 this); |
354 this); |
352 |
355 |
353 util_->flush(); |
356 util_->flush(); |
|
357 testResultXml(xml_file); |
354 } |
358 } |
355 |
359 |
356 |
360 |
357 void testSearchForHappy(Itk::TestMgr * testMgr) |
361 void testSearchForHappy(Itk::TestMgr * testMgr) |
358 { |
362 { |
359 const wchar_t |
363 const wchar_t |
360 * word = L"happy"; |
364 * word = L"happy"; |
361 |
365 char *xml_file = (char*)__FUNCTION__; |
|
366 assert_failed = 0; |
362 testSearchFor(testMgr, |
367 testSearchFor(testMgr, |
363 word); |
368 word); |
|
369 testResultXml(xml_file); |
|
370 |
364 } |
371 } |
365 |
372 |
366 void testSearchForImportant(Itk::TestMgr * testMgr) |
373 void testSearchForImportant(Itk::TestMgr * testMgr) |
367 { |
374 { |
368 const wchar_t |
375 const wchar_t |
369 * word = L"important"; |
376 * word = L"important"; |
370 |
377 char *xml_file = (char*)__FUNCTION__; |
|
378 assert_failed = 0; |
371 testSearchFor(testMgr, |
379 testSearchFor(testMgr, |
372 word); |
380 word); |
|
381 testResultXml(xml_file); |
373 } |
382 } |
374 |
383 |
375 void testSearchForHappening(Itk::TestMgr * testMgr) |
384 void testSearchForHappening(Itk::TestMgr * testMgr) |
376 { |
385 { |
377 const wchar_t |
386 const wchar_t |
378 * word = L"happening"; |
387 * word = L"happening"; |
379 |
388 char *xml_file = (char*)__FUNCTION__; |
|
389 assert_failed = 0; |
380 testSearchFor(testMgr, |
390 testSearchFor(testMgr, |
381 word); |
391 word); |
|
392 testResultXml(xml_file); |
382 } |
393 } |
383 |
394 |
384 void testSearchForLook(Itk::TestMgr * testMgr) |
395 void testSearchForLook(Itk::TestMgr * testMgr) |
385 { |
396 { |
386 const wchar_t |
397 const wchar_t |
387 * word = L"look"; |
398 * word = L"look"; |
388 |
399 char *xml_file = (char*)__FUNCTION__; |
|
400 assert_failed = 0; |
389 testSearchFor(testMgr, |
401 testSearchFor(testMgr, |
390 word); |
402 word); |
|
403 testResultXml(xml_file); |
391 } |
404 } |
392 |
405 |
393 void testSearchForChristmas(Itk::TestMgr * testMgr) |
406 void testSearchForChristmas(Itk::TestMgr * testMgr) |
394 { |
407 { |
395 const wchar_t |
408 const wchar_t |
396 * word = L"christmas"; |
409 * word = L"christmas"; |
397 |
410 char *xml_file = (char*)__FUNCTION__; |
|
411 assert_failed = 0; |
398 testSearchFor(testMgr, |
412 testSearchFor(testMgr, |
399 word); |
413 word); |
|
414 testResultXml(xml_file); |
400 } |
415 } |
401 |
416 |
402 |
417 |
403 private: |
418 private: |
404 // |
419 // |
405 // private methods |
420 // private methods |
406 // |
421 // |
407 void testSearchFor(Itk::TestMgr * testMgr, |
422 void testSearchFor(Itk::TestMgr * testMgr, |
408 const wchar_t * word) |
423 const wchar_t * word, int expected = 1) |
409 { |
424 { |
410 wchar_t |
425 wchar_t |
411 report[512]; |
426 report[512]; |
412 |
427 |
413 cpix_Query |
428 cpix_Query |