#include <config.h>#include <xapian.h>#include <iostream>#include <string>#include "testsuite.h"#include "testutils.h"#include "utils.h"Include dependency graph for termgentest.cc:

Go to the source code of this file.
Classes | |
| struct | test |
Defines | |
| #define | TESTCASE(S) {#S, test_##S} |
| #define | END_OF_TESTCASES {0, 0} |
Functions | |
| static string | format_doc_termlist (const Xapian::Document &doc) |
| static bool | test_termgen1 () |
| static bool | test_tg_spell1 () |
| Test spelling data generation. | |
| static bool | test_tg_spell2 () |
| Regression test for bug fixed in 1.0.5 - previously this segfaulted. | |
| int | main (int argc, char **argv) |
Variables | |
| static test | test_simple [] |
| static test_desc | tests [] |
| Test cases for the TermGenerator. | |
| #define TESTCASE | ( | S | ) | {#S, test_##S} |
Definition at line 34 of file termgentest.cc.
| #define END_OF_TESTCASES {0, 0} |
Definition at line 35 of file termgentest.cc.
| static string format_doc_termlist | ( | const Xapian::Document & | doc | ) | [static] |
Definition at line 606 of file termgentest.cc.
References Xapian::TermIterator::get_wdf(), om_tostring(), Xapian::TermIterator::positionlist_begin(), Xapian::TermIterator::positionlist_count(), Xapian::TermIterator::positionlist_end(), Xapian::Document::termlist_begin(), and Xapian::Document::termlist_end().
Referenced by test_termgen1().
| static bool test_termgen1 | ( | ) | [static] |
Definition at line 637 of file termgentest.cc.
References atoi(), FAIL_TEST, format_doc_termlist(), Xapian::Error::get_description(), Xapian::TermGenerator::increase_termpos(), Xapian::TermGenerator::index_text(), Xapian::TermGenerator::index_text_without_positions(), Xapian::TermGenerator::set_document(), Xapian::TermGenerator::set_stemmer(), stemmer, test_simple, TEST_STRINGS_EQUAL, test::text, and tout.
| static bool test_tg_spell1 | ( | ) | [static] |
Test spelling data generation.
Definition at line 715 of file termgentest.cc.
References Xapian::DB_CREATE_OR_OVERWRITE, Xapian::TermGenerator::FLAG_SPELLING, Xapian::Database::get_spelling_suggestion(), Xapian::TermGenerator::index_text(), mkdir(), Xapian::TermGenerator::set_database(), Xapian::TermGenerator::set_document(), Xapian::TermGenerator::set_flags(), and TEST_STRINGS_EQUAL.
| static bool test_tg_spell2 | ( | ) | [static] |
Regression test for bug fixed in 1.0.5 - previously this segfaulted.
Definition at line 743 of file termgentest.cc.
References Xapian::TermGenerator::FLAG_SPELLING, Xapian::TermGenerator::index_text(), Xapian::TermGenerator::set_document(), Xapian::TermGenerator::set_flags(), and TEST_EXCEPTION.
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 764 of file termgentest.cc.
References test_driver::parse_command_line(), test_driver::run(), and tests.
test test_simple[] [static] |
Initial value:
{
TESTCASE(termgen1),
TESTCASE(tg_spell1),
TESTCASE(tg_spell2),
END_OF_TESTCASES
}
Definition at line 757 of file termgentest.cc.