|
xapian-core
2.0.0
|
tests which need a backend More...
#include <config.h>#include "api_db.h"#include <algorithm>#include <fstream>#include <map>#include <string>#include <vector>#include "safenetdb.h"#include "safesysstat.h"#include "safeunistd.h"#include <xapian.h>#include "backendmanager.h"#include "testsuite.h"#include "testutils.h"#include "unixcmds.h"#include "apitest.h"
Include dependency graph for api_db.cc:Go to the source code of this file.
Classes | |
| class | GrepMatchDecider |
| class | MyWeight |
Macros | |
| #define | EXPECTED_EXCEPTION Xapian::DatabaseOpeningError |
Functions | |
| static Xapian::Query | query (const string &t) |
| DEFINE_TESTCASE (termstats, backend) | |
| DEFINE_TESTCASE (stubdb1, check &&path) | |
| DEFINE_TESTCASE (stubdb2, path) | |
| DEFINE_TESTCASE (stubdb3, path) | |
| DEFINE_TESTCASE (stubdb4, !backend) | |
| DEFINE_TESTCASE (stubdb5, path) | |
| DEFINE_TESTCASE (stubdb6, inmemory) | |
| DEFINE_TESTCASE (stubdb8, inmemory) | |
| Test error running Database::check() on a stub database. More... | |
| DEFINE_TESTCASE (matchdecider1, backend &&!remote) | |
| DEFINE_TESTCASE (matchdecider2, backend &&!remote) | |
| DEFINE_TESTCASE (matchdecider3, backend &&!remote) | |
| DEFINE_TESTCASE (msetiterator1, backend) | |
| DEFINE_TESTCASE (msetiterator2, backend) | |
| DEFINE_TESTCASE (msetiterator3, backend) | |
| DEFINE_TESTCASE (esetiterator1, backend) | |
| DEFINE_TESTCASE (esetiterator2, backend) | |
| DEFINE_TESTCASE (collapsekey1, backend) | |
| DEFINE_TESTCASE (collapsekey2, multi &&remote) | |
| DEFINE_TESTCASE (collapsekey3, backend) | |
| DEFINE_TESTCASE (collapsekey4, backend) | |
| DEFINE_TESTCASE (keepalive1, remote) | |
| DEFINE_TESTCASE (allterms1, backend) | |
| DEFINE_TESTCASE (allterms2, backend) | |
| DEFINE_TESTCASE (allterms3, backend) | |
| DEFINE_TESTCASE (allterms4, backend) | |
| DEFINE_TESTCASE (allterms5, backend) | |
| DEFINE_TESTCASE (allterms6, backend) | |
| DEFINE_TESTCASE (specialterms1, backend) | |
| DEFINE_TESTCASE (specialterms2, backend) | |
| DEFINE_TESTCASE (rsetmultidb2, backend &&!multi) | |
| DEFINE_TESTCASE (multiexpand1, backend &&!multi) | |
| DEFINE_TESTCASE (postlist1, backend) | |
| DEFINE_TESTCASE (postlist2, backend) | |
| DEFINE_TESTCASE (postlist3, backend) | |
| DEFINE_TESTCASE (postlist4, backend) | |
| DEFINE_TESTCASE (postlist5, backend) | |
| DEFINE_TESTCASE (postlist6, backend) | |
| DEFINE_TESTCASE (collfreq1, backend) | |
| DEFINE_TESTCASE (sortvalue1, backend) | |
| DEFINE_TESTCASE (consistency1, backend &&!remote) | |
| DEFINE_TESTCASE (databasenotfounderror1, glass||honey) | |
| DEFINE_TESTCASE (databasenotfounderror2, !backend) | |
| DEFINE_TESTCASE (glassdatabaseopen1, glass) | |
| Test opening of a glass database. More... | |
| DEFINE_TESTCASE (sortrel1, backend) | |
| static void | make_netstats1_db (Xapian::WritableDatabase &db, const string &) |
| DEFINE_TESTCASE (netstats1, backend) | |
| DEFINE_TESTCASE (userweight1, backend &&!remote) | |
| DEFINE_TESTCASE (matchall1, backend) | |
| DEFINE_TESTCASE (valuesetmatchdecider2, backend &&!remote) | |
tests which need a backend
Definition in file api_db.cc.
| #define EXPECTED_EXCEPTION Xapian::DatabaseOpeningError |
| DEFINE_TESTCASE | ( | allterms1 | , |
| backend | |||
| ) |
Definition at line 848 of file api_db.cc.
References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::get_termfreq(), TEST, TEST_EQUAL, tout, and verbose.
| DEFINE_TESTCASE | ( | allterms2 | , |
| backend | |||
| ) |
Definition at line 877 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::get_termfreq(), and TEST.
| DEFINE_TESTCASE | ( | allterms3 | , |
| backend | |||
| ) |
Definition at line 917 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::skip_to(), and TEST.
| DEFINE_TESTCASE | ( | allterms4 | , |
| backend | |||
| ) |
Definition at line 928 of file api_db.cc.
References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::get_termfreq(), and TEST.
| DEFINE_TESTCASE | ( | allterms5 | , |
| backend | |||
| ) |
Definition at line 943 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::skip_to(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | allterms6 | , |
| backend | |||
| ) |
Definition at line 953 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::skip_to(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | collapsekey1 | , |
| backend | |||
| ) |
Definition at line 699 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_AND_EXPLAIN.
| DEFINE_TESTCASE | ( | collapsekey2 | , |
| multi && | remote | ||
| ) |
Definition at line 725 of file api_db.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | collapsekey3 | , |
| backend | |||
| ) |
Definition at line 750 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | collapsekey4 | , |
| backend | |||
| ) |
Definition at line 799 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), TEST, and TEST_AND_EXPLAIN.
| DEFINE_TESTCASE | ( | collfreq1 | , |
| backend | |||
| ) |
Definition at line 1262 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::Database::get_collection_freq(), get_database(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | consistency1 | , |
| backend &&! | remote | ||
| ) |
Definition at line 1329 of file api_db.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), SKIP_TEST, TEST, TEST_EQUAL, and TEST_EQUAL_DOUBLE.
| DEFINE_TESTCASE | ( | databasenotfounderror1 | , |
| glass|| | honey | ||
| ) |
Definition at line 1362 of file api_db.cc.
References Xapian::DB_BACKEND_GLASS, Xapian::DB_BACKEND_HONEY, Xapian::DB_CREATE, Xapian::DB_CREATE_OR_OPEN, Xapian::DB_CREATE_OR_OVERWRITE, Xapian::DB_OPEN, FAIL_TEST, get_dbtype(), TEST_EXCEPTION, and touch().
| DEFINE_TESTCASE | ( | databasenotfounderror2 | , |
| ! | backend | ||
| ) |
Definition at line 1412 of file api_db.cc.
References Xapian::DB_OPEN, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | esetiterator1 | , |
| backend | |||
| ) |
Definition at line 626 of file api_db.cc.
References Xapian::RSet::add_document(), Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | esetiterator2 | , |
| backend | |||
| ) |
Definition at line 673 of file api_db.cc.
References Xapian::RSet::add_document(), Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | glassdatabaseopen1 | , |
| glass | |||
| ) |
Test opening of a glass database.
Definition at line 1430 of file api_db.cc.
References Xapian::DB_BACKEND_GLASS, Xapian::DB_CREATE, Xapian::DB_CREATE_OR_OPEN, Xapian::DB_CREATE_OR_OVERWRITE, Xapian::DB_OPEN, rm_rf(), and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | keepalive1 | , |
| remote | |||
| ) |
Definition at line 825 of file api_db.cc.
References Xapian::Enquire::get_mset(), get_remote_database(), Xapian::Database::keep_alive(), Xapian::Enquire::set_query(), RealTime::sleep(), and TEST_EXCEPTION_BASE_CLASS.
| DEFINE_TESTCASE | ( | matchall1 | , |
| backend | |||
| ) |
Definition at line 1756 of file api_db.cc.
References get_database(), Xapian::Database::get_doccount(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::Query::MatchAll, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | matchdecider1 | , |
| backend &&! | remote | ||
| ) |
Definition at line 352 of file api_db.cc.
References Xapian::BAD_VALUENO, Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | matchdecider2 | , |
| backend &&! | remote | ||
| ) |
Definition at line 479 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | matchdecider3 | , |
| backend &&! | remote | ||
| ) |
Definition at line 510 of file api_db.cc.
References get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), Xapian::MSet::size(), TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | msetiterator1 | , |
| backend | |||
| ) |
Definition at line 552 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | msetiterator2 | , |
| backend | |||
| ) |
Definition at line 595 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | msetiterator3 | , |
| backend | |||
| ) |
Definition at line 613 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::empty(), Xapian::Document::get_data(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST.
| DEFINE_TESTCASE | ( | multiexpand1 | , |
| backend &&! | multi | ||
| ) |
Definition at line 1094 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::RSet::add_document(), Xapian::ESet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::ESetIterator::get_weight(), Xapian::ESet::size(), TEST, TEST_EQUAL, and Xapian::Enquire::USE_EXACT_TERMFREQ.
| DEFINE_TESTCASE | ( | netstats1 | , |
| backend | |||
| ) |
Definition at line 1665 of file api_db.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_attained(), Xapian::Enquire::get_mset(), make_netstats1_db(), mset_range_is_same(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, and TEST_EQUAL_DOUBLE.
| DEFINE_TESTCASE | ( | postlist1 | , |
| backend | |||
| ) |
Definition at line 1149 of file api_db.cc.
References get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | postlist2 | , |
| backend | |||
| ) |
Definition at line 1165 of file api_db.cc.
References get_database(), Xapian::PostingIterator::get_description(), p, Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST, TEST_EQUAL, TEST_NOT_EQUAL, and TEST_STRINGS_EQUAL.
| DEFINE_TESTCASE | ( | postlist3 | , |
| backend | |||
| ) |
Definition at line 1202 of file api_db.cc.
References get_database(), p, Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | postlist4 | , |
| backend | |||
| ) |
Definition at line 1221 of file api_db.cc.
References get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::PostingIterator::skip_to(), and TEST.
| DEFINE_TESTCASE | ( | postlist5 | , |
| backend | |||
| ) |
Definition at line 1230 of file api_db.cc.
References Xapian::Database::get_avlength(), get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
| DEFINE_TESTCASE | ( | postlist6 | , |
| backend | |||
| ) |
Definition at line 1244 of file api_db.cc.
References get_database(), Xapian::PostingIterator::get_doclength(), Xapian::Database::get_doclength(), Xapian::PostingIterator::get_unique_terms(), Xapian::Database::get_unique_terms(), Xapian::PostingIterator::get_wdf(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST, TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | rsetmultidb2 | , |
| backend &&! | multi | ||
| ) |
Definition at line 1059 of file api_db.cc.
References Xapian::Database::add_database(), Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), mset_range_is_same_weights(), query(), Xapian::Enquire::set_query(), TEST, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | sortrel1 | , |
| backend | |||
| ) |
Definition at line 1495 of file api_db.cc.
References Xapian::Enquire::ASCENDING, Xapian::Enquire::DESCENDING, get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_relevance_then_value(), Xapian::Enquire::set_sort_by_value(), Xapian::Enquire::set_sort_by_value_then_relevance(), Xapian::MSet::size(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | sortvalue1 | , |
| backend | |||
| ) |
Definition at line 1285 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), FAIL_TEST, get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), Xapian::MSet::size(), TEST, TEST_EQUAL, and tout.
| DEFINE_TESTCASE | ( | specialterms1 | , |
| backend | |||
| ) |
Definition at line 997 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Enquire::set_query(), stemmer, TEST, TEST_EQUAL, TEST_MSET_SIZE, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | specialterms2 | , |
| backend | |||
| ) |
Definition at line 1033 of file api_db.cc.
References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::TermIterator::skip_to(), TEST_EQUAL, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | stubdb1 | , |
| check && | path | ||
| ) |
Definition at line 70 of file api_db.cc.
References Xapian::Database::check(), Xapian::DB_BACKEND_STUB, get_database_path(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | stubdb2 | , |
| path | |||
| ) |
Definition at line 95 of file api_db.cc.
References Xapian::DB_BACKEND_STUB, EXPECTED_EXCEPTION, Xapian::Error::get_context(), get_database_path(), Xapian::Enquire::get_mset(), Xapian::Error::get_msg(), BackendManager::get_xapian_progsrv_command(), Xapian::Enquire::set_query(), TEST, TEST_EQUAL, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | stubdb3 | , |
| path | |||
| ) |
Definition at line 224 of file api_db.cc.
References Xapian::DB_BACKEND_STUB, get_database_path(), TEST, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | stubdb4 | , |
| ! | backend | ||
| ) |
Definition at line 241 of file api_db.cc.
References Xapian::DB_BACKEND_STUB, TEST, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | stubdb5 | , |
| path | |||
| ) |
Definition at line 258 of file api_db.cc.
References Xapian::DB_BACKEND_STUB, get_database_path(), TEST, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | stubdb6 | , |
| inmemory | |||
| ) |
Definition at line 275 of file api_db.cc.
References Xapian::WritableDatabase::add_document(), Xapian::DB_BACKEND_STUB, Xapian::DB_OPEN, Xapian::MSet::empty(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | stubdb8 | , |
| inmemory | |||
| ) |
Test error running Database::check() on a stub database.
Definition at line 321 of file api_db.cc.
References Xapian::Database::check(), FAIL_TEST, Xapian::Error::get_msg(), TEST, and TEST_STRINGS_EQUAL.
| DEFINE_TESTCASE | ( | termstats | , |
| backend | |||
| ) |
Definition at line 58 of file api_db.cc.
References get_database(), Xapian::Database::get_termfreq(), Xapian::Database::term_exists(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | userweight1 | , |
| backend &&! | remote | ||
| ) |
Definition at line 1730 of file api_db.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | valuesetmatchdecider2 | , |
| backend &&! | remote | ||
| ) |
Definition at line 1779 of file api_db.cc.
References Xapian::ValueSetMatchDecider::add_value(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), and Xapian::Enquire::set_query().
|
static |
Definition at line 1619 of file api_db.cc.
References Xapian::WritableDatabase::commit(), Xapian::TermGenerator::index_text(), Xapian::WritableDatabase::replace_document(), Xapian::TermGenerator::set_document(), Xapian::TermGenerator::set_stemmer(), Xapian::TermGenerator::set_stemming_strategy(), and Xapian::TermGenerator::STEM_ALL.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 49 of file api_db.cc.
Referenced by DEFINE_TESTCASE().