#include <config.h>#include <xapian.h>#include <iostream>#include <string>#include "str.h"#include "testsuite.h"#include "testutils.h"#include "utils.h"#include <stdlib.h>

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 const test | test_simple [] |
| static const test_desc | tests [] |
| Test cases for the TermGenerator. | |
| #define END_OF_TESTCASES {0, 0} |
Definition at line 39 of file termgentest.cc.
| #define TESTCASE | ( | S | ) | {#S, test_##S} |
Definition at line 38 of file termgentest.cc.
| static string format_doc_termlist | ( | const Xapian::Document & | doc | ) | [static] |
Definition at line 629 of file termgentest.cc.
References Xapian::TermIterator::get_wdf(), Xapian::TermIterator::positionlist_begin(), Xapian::TermIterator::positionlist_count(), Xapian::TermIterator::positionlist_end(), Xapian::Internal::str(), Xapian::Document::termlist_begin(), and Xapian::Document::termlist_end().
Referenced by test_termgen1().
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 787 of file termgentest.cc.
References test_driver::parse_command_line(), and test_driver::run().
| static bool test_termgen1 | ( | ) | [static] |
Definition at line 660 of file termgentest.cc.
References 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_STRINGS_EQUAL, test::text, and tout.
| static bool test_tg_spell1 | ( | ) | [static] |
Test spelling data generation.
Definition at line 738 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 766 of file termgentest.cc.
References Xapian::TermGenerator::FLAG_SPELLING, Xapian::TermGenerator::index_text(), Xapian::TermGenerator::set_document(), Xapian::TermGenerator::set_flags(), and TEST_EXCEPTION.
const test test_simple[] [static] |
Definition at line 65 of file termgentest.cc.
Initial value:
{
TESTCASE(termgen1),
TESTCASE(tg_spell1),
TESTCASE(tg_spell2),
END_OF_TESTCASES
}
Definition at line 780 of file termgentest.cc.