xapian-core
1.4.27
|
Backend-related tests. More...
#include <config.h>
#include "api_backend.h"
#include <xapian.h>
#include "backendmanager.h"
#include "errno_to_string.h"
#include "filetests.h"
#include "str.h"
#include "testrunner.h"
#include "testsuite.h"
#include "testutils.h"
#include "unixcmds.h"
#include "apitest.h"
#include "safefcntl.h"
#include "safesysstat.h"
#include "safeunistd.h"
#include <cerrno>
#include <fstream>
#include <iterator>
Go to the source code of this file.
Classes | |
class | CheckMatchDecider |
Macros | |
#define | XAPIAN_DEPRECATED(X) X |
Functions | |
DEFINE_TESTCASE (lockfileumask1, chert||glass) | |
Regression test - lockfile should honour umask, was only user-readable. More... | |
DEFINE_TESTCASE (totaldoclen1, writable) | |
Check that the backend handles total document length > 0xffffffff. More... | |
DEFINE_TESTCASE (exceed32bitcombineddb1, writable) | |
DEFINE_TESTCASE (dbstats1, backend) | |
DEFINE_TESTCASE (dbstats2, backend) | |
DEFINE_TESTCASE (alldocspl3, backend) | |
Check handling of alldocs on an empty database. More... | |
DEFINE_TESTCASE (modifiedpostlist1, writable) | |
Regression test for bug#392 in ModifiedPostList iteration, fixed in 1.0.15. More... | |
DEFINE_TESTCASE (doclenaftercommit1, writable) | |
Regression test for chert bug fixed in 1.1.3 (ticket#397). More... | |
DEFINE_TESTCASE (valuesaftercommit1, writable) | |
DEFINE_TESTCASE (lockfilefd0or1, chert||glass) | |
DEFINE_TESTCASE (lockfilealreadyopen1, chert||glass) | |
Regression test for bug fixed in 1.2.13 and 1.3.1. More... | |
DEFINE_TESTCASE (testlock1, chert||glass) | |
Feature tests for Database::locked(). More... | |
DEFINE_TESTCASE (testlock2, backend &&!writable) | |
Test that locked() returns false for backends which don't support update. More... | |
DEFINE_TESTCASE (testlock3, inmemory) | |
Test locked() on inmemory Database objects. More... | |
DEFINE_TESTCASE (testlock4, chert||glass) | |
Test locked() on closed WritableDatabase. More... | |
DEFINE_TESTCASE (matchdecider4, remote) | |
Test Xapian::MatchDecider with remote backend fails. More... | |
DEFINE_TESTCASE (replacedoc7, writable &&!inmemory &&!remote) | |
Check that replacing an unmodified document doesn't increase the automatic flush counter. More... | |
DEFINE_TESTCASE (replacedoc8, writable) | |
Check that replacing a document deleted since the last flush works. More... | |
DEFINE_TESTCASE (replacedoc9, writable) | |
Check that replacing a document after clear_terms() still deletes old positional data. More... | |
DEFINE_TESTCASE (databasemodified1, writable &&!inmemory &&!multi) | |
Test coverage for DatabaseModifiedError. More... | |
DEFINE_TESTCASE (qpmemoryleak1, writable &&!inmemory) | |
Regression test for bug#462 fixed in 1.0.19 and 1.1.5. More... | |
static void | make_msize1_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (msize1, backend) | |
Regression test for ticket#464, fixed in 1.1.6 and 1.0.20. More... | |
static void | make_msize2_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (msize2, backend) | |
Regression test for bug related to ticket#464, fixed in 1.1.6 and 1.0.20. More... | |
static void | make_xordecay1_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (xordecay1, backend) | |
Regression test for bug in decay of XOR, fixed in 1.2.1 and 1.0.21. More... | |
static void | make_ordecay_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (ordecay1, backend) | |
Regression test for bug in decay of OR to AND, fixed in 1.2.1 and 1.0.21. More... | |
DEFINE_TESTCASE (ordecay2, backend) | |
Regression test for bug in decay of OR to AND_MAYBE, fixed in 1.2.1 and 1.0.21. More... | |
static void | make_orcheck_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (orcheck1, backend) | |
Regression test for bugs in the check() method of OrPostList. More... | |
DEFINE_TESTCASE (failedreplace1, chert||glass) | |
Regression test for bug fixed in 1.2.1 and 1.0.21. More... | |
DEFINE_TESTCASE (failedreplace2, chert||glass) | |
DEFINE_TESTCASE (phrase3, positional) | |
Coverage for SelectPostList::skip_to(). More... | |
DEFINE_TESTCASE (msetfirst2, backend) | |
Check that get_mset(<large number>, 10) doesn't exhaust memory needlessly. More... | |
DEFINE_TESTCASE (emptydb1, backend) | |
DEFINE_TESTCASE (multiargop1, backend) | |
Test operators which should allow more than two arguments. More... | |
DEFINE_TESTCASE (stubdb7, !backend) | |
Test error opening non-existent stub databases. More... | |
DEFINE_TESTCASE (msetweights1, backend) | |
Test which checks the weights are as expected. More... | |
DEFINE_TESTCASE (itorskiptofromend1, backend) | |
DEFINE_TESTCASE (blocksize1, chert||glass) | |
Check handling of invalid block sizes. More... | |
DEFINE_TESTCASE (notermlist1, glass) | |
Feature test for Xapian::DB_NO_TERMLIST. More... | |
DEFINE_TESTCASE (newfreelistblock1, writable) | |
Regression test for bug starting a new glass freelist block. More... | |
DEFINE_TESTCASE (readonlyparentdir1, chert||glass) | |
Check that the parent directory for the database doesn't need to be writable. More... | |
static void | make_phrasebug1_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (phrasebug1, positional) | |
Regression test for ticket#653, fixed in 1.3.2 and 1.2.19. More... | |
DEFINE_TESTCASE (retrylock1, writable &&path) | |
Feature test for Xapian::DB_RETRY_LOCK. More... | |
DEFINE_TESTCASE (dbfilefd012, writable &&!remote) | |
DEFINE_TESTCASE (cursorbug1, writable &&path) | |
Regression test for #675, fixed in 1.3.3 and 1.2.21. More... | |
DEFINE_TESTCASE (sortvalue2, backend) | |
DEFINE_TESTCASE (enquiregetquery1, backend) | |
Check behaviour of Enquire::get_query(). More... | |
DEFINE_TESTCASE (embedded1, singlefile) | |
DEFINE_TESTCASE (exactxor1, backend) | |
Regression test for bug fixed in 1.3.7. More... | |
DEFINE_TESTCASE (getrevision1, chert||glass) | |
Feature test for Database::get_revision(). More... | |
DEFINE_TESTCASE (getrevision2, !backend) | |
Check get_revision() on an empty database reports 0. (Since 1.5.0) More... | |
DEFINE_TESTCASE (getdocumentlazy1, backend) | |
Feature test for DOC_ASSUME_VALID. More... | |
DEFINE_TESTCASE (getdocumentlazy2, backend) | |
Feature test for DOC_ASSUME_VALID for a docid that doesn't actually exist. More... | |
static void | gen_uniqterms_gt_doclen_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (getuniqueterms1, backend) | |
DEFINE_TESTCASE (nopositionbug1, backend) | |
Regression test for bug fixed in 1.4.6. More... | |
DEFINE_TESTCASE (checkatleast4, backend) | |
Regression test for bug with get_mset(0, 0, N) (N > 0). More... | |
DEFINE_TESTCASE (freelistleak1, check) | |
Regression test for glass freelist leak fixed in 1.4.6 and 1.5.0. More... | |
DEFINE_TESTCASE (splitpostings1, writable) | |
Regression test for split position handling - broken in 1.4.8. More... | |
DEFINE_TESTCASE (multidb1, backend) | |
Feature tests for Database::size(). More... | |
DEFINE_TESTCASE (allterms7, backend) | |
DEFINE_TESTCASE (nosuchterm, backend) | |
DEFINE_TESTCASE (unsupportedcheck1, path) | |
DEFINE_TESTCASE (unsupportedcheck2, inmemory) | |
DEFINE_TESTCASE (unsupportedcheck3, !backend) | |
DEFINE_TESTCASE (corruptglass1, glass) | |
Backend-related tests.
Definition in file api_backend.cc.
#define XAPIAN_DEPRECATED | ( | X | ) | X |
Definition at line 27 of file api_backend.cc.
DEFINE_TESTCASE | ( | lockfileumask1 | , |
chert|| | glass | ||
) |
Regression test - lockfile should honour umask, was only user-readable.
Definition at line 57 of file api_backend.cc.
References get_named_writable_database(), get_named_writable_database_path(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | totaldoclen1 | , |
writable | |||
) |
Check that the backend handles total document length > 0xffffffff.
Definition at line 79 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::WritableDatabase::commit(), Xapian::Database::get_avlength(), get_dbtype(), Xapian::Database::get_total_length(), get_writable_database(), get_writable_database_as_database(), Xapian::Internal::str(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | exceed32bitcombineddb1 | , |
writable | |||
) |
Definition at line 112 of file api_backend.cc.
References Xapian::Database::add_database(), Xapian::Document::add_term(), Xapian::MSet::begin(), Xapian::WritableDatabase::commit(), Xapian::MSet::end(), Xapian::Document::get_data(), Xapian::Document::get_docid(), Xapian::Enquire::get_mset(), get_writable_database(), get_writable_database_as_database(), Xapian::Query::MatchAll, Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), Xapian::Enquire::set_query(), Xapian::Database::size(), Xapian::MSet::size(), SKIP_TEST_FOR_BACKEND, and TEST_EQUAL.
DEFINE_TESTCASE | ( | dbstats1 | , |
backend | |||
) |
Definition at line 154 of file api_backend.cc.
References get_database(), get_dbtype(), Xapian::Database::get_doclength_lower_bound(), Xapian::Database::get_doclength_upper_bound(), Xapian::Database::get_wdf_upper_bound(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | dbstats2 | , |
backend | |||
) |
Definition at line 190 of file api_backend.cc.
References get_database(), get_dbtype(), Xapian::Database::get_doclength_lower_bound(), Xapian::Database::get_doclength_upper_bound(), Xapian::Database::get_wdf_upper_bound(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | alldocspl3 | , |
backend | |||
) |
Check handling of alldocs on an empty database.
Definition at line 223 of file api_backend.cc.
References Xapian::Database::get_collection_freq(), get_database(), Xapian::Database::get_termfreq(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | modifiedpostlist1 | , |
writable | |||
) |
Regression test for bug#392 in ModifiedPostList iteration, fixed in 1.0.15.
Definition at line 232 of file api_backend.cc.
References Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::Enquire::get_mset(), get_writable_database(), mset_expect_order(), Xapian::WritableDatabase::replace_document(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | doclenaftercommit1 | , |
writable | |||
) |
Regression test for chert bug fixed in 1.1.3 (ticket#397).
Definition at line 249 of file api_backend.cc.
References Xapian::WritableDatabase::commit(), Xapian::Database::get_doclength(), Xapian::Database::get_unique_terms(), get_writable_database(), Xapian::WritableDatabase::replace_document(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | valuesaftercommit1 | , |
writable | |||
) |
Definition at line 259 of file api_backend.cc.
References Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::Database::get_document(), Xapian::Document::get_value(), get_writable_database(), Xapian::WritableDatabase::replace_document(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | lockfilefd0or1 | , |
chert|| | glass | ||
) |
Definition at line 272 of file api_backend.cc.
References close(), get_writable_database(), get_writable_database_again(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | lockfilealreadyopen1 | , |
chert|| | glass | ||
) |
Regression test for bug fixed in 1.2.13 and 1.3.1.
Definition at line 313 of file api_backend.cc.
References close(), Xapian::DB_CREATE_OR_OPEN, get_named_writable_database(), get_named_writable_database_path(), Xapian::InMemory::open(), TEST, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | testlock1 | , |
chert|| | glass | ||
) |
Feature tests for Database::locked().
Definition at line 332 of file api_backend.cc.
References Xapian::Database::close(), get_named_writable_database(), get_writable_database_as_database(), Xapian::Database::locked(), SKIP_TEST, and TEST.
DEFINE_TESTCASE | ( | testlock2 | , |
backend &&! | writable | ||
) |
Test that locked() returns false for backends which don't support update.
Regression test for bug fixed in 1.4.6.
Definition at line 376 of file api_backend.cc.
References Xapian::Database::close(), get_database(), Xapian::Database::locked(), and TEST.
DEFINE_TESTCASE | ( | testlock3 | , |
inmemory | |||
) |
Test locked() on inmemory Database objects.
An inmemory Database is always actually a WritableDatabase viewed as a Database, so it should always report being locked for writing, unless close() has been called.
Regression test for bug fixed in 1.4.14 - earlier versions always returned false for an inmemory Database here.
Regression test for bug fixed in 1.4.15 - false should be returned after close() has been called.
Definition at line 395 of file api_backend.cc.
References Xapian::Database::close(), get_database(), Xapian::Database::locked(), and TEST.
DEFINE_TESTCASE | ( | testlock4 | , |
chert|| | glass | ||
) |
Test locked() on closed WritableDatabase.
Definition at line 403 of file api_backend.cc.
References Xapian::Database::close(), get_writable_database(), Xapian::Database::locked(), SKIP_TEST, and TEST.
DEFINE_TESTCASE | ( | matchdecider4 | , |
remote | |||
) |
Test Xapian::MatchDecider with remote backend fails.
Definition at line 432 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST, TEST_EXCEPTION, and CheckMatchDecider::was_called().
DEFINE_TESTCASE | ( | replacedoc7 | , |
writable &&!inmemory &&! | remote | ||
) |
Check that replacing an unmodified document doesn't increase the automatic flush counter.
Regression test for bug fixed in 1.1.4/1.0.18.
Definition at line 448 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::WritableDatabase::flush(), Xapian::Database::get_doccount(), Xapian::Database::get_document(), get_writable_database(), get_writable_database_as_database(), Xapian::Database::reopen(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | replacedoc8 | , |
writable | |||
) |
Check that replacing a document deleted since the last flush works.
Prior to 1.1.4/1.0.18, this failed to update the collection frequency and wdf, and caused an assertion failure when assertions were enabled.
Definition at line 489 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::delete_document(), Xapian::WritableDatabase::flush(), Xapian::Database::get_collection_freq(), get_writable_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | replacedoc9 | , |
writable | |||
) |
Check that replacing a document after clear_terms() still deletes old positional data.
Regression test for bug introduced and fixed in development prior to 1.5.0.
Definition at line 515 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::Document::add_term(), Xapian::Document::clear_terms(), Xapian::WritableDatabase::commit(), Xapian::Database::get_document(), get_named_writable_database(), Xapian::Database::positionlist_begin(), Xapian::Database::positionlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | databasemodified1 | , |
writable &&!inmemory &&! | multi | ||
) |
Test coverage for DatabaseModifiedError.
Definition at line 536 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), FAIL_TEST, Xapian::Enquire::get_mset(), get_writable_database(), get_writable_database_as_database(), Xapian::Document::set_data(), Xapian::Enquire::set_query(), Xapian::Database::termlist_begin(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | qpmemoryleak1 | , |
writable &&! | inmemory | ||
) |
Regression test for bug#462 fixed in 1.0.19 and 1.1.5.
Definition at line 576 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::QueryParser::FLAG_PARTIAL, get_writable_database(), get_writable_database_as_database(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), SKIP_TEST, Xapian::Internal::str(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | msize1 | , |
backend | |||
) |
Regression test for ticket#464, fixed in 1.1.6 and 1.0.20.
Definition at line 623 of file api_backend.cc.
References est(), get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), make_msize1_db(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | msize2 | , |
backend | |||
) |
Regression test for bug related to ticket#464, fixed in 1.1.6 and 1.0.20.
Definition at line 671 of file api_backend.cc.
References est(), get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), make_msize2_db(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | xordecay1 | , |
backend | |||
) |
Regression test for bug in decay of XOR, fixed in 1.2.1 and 1.0.21.
Definition at line 716 of file api_backend.cc.
References get_database(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), make_xordecay1_db(), mset_range_is_same(), Xapian::Query::OP_OR, Xapian::Query::OP_XOR, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST.
DEFINE_TESTCASE | ( | ordecay1 | , |
backend | |||
) |
Regression test for bug in decay of OR to AND, fixed in 1.2.1 and 1.0.21.
Definition at line 748 of file api_backend.cc.
References get_database(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), make_ordecay_db(), mset_range_is_same(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST.
DEFINE_TESTCASE | ( | ordecay2 | , |
backend | |||
) |
Regression test for bug in decay of OR to AND_MAYBE, fixed in 1.2.1 and 1.0.21.
Definition at line 765 of file api_backend.cc.
References get_database(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), make_ordecay_db(), mset_range_is_same(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST.
DEFINE_TESTCASE | ( | orcheck1 | , |
backend | |||
) |
Regression test for bugs in the check() method of OrPostList.
(ticket #485) Bugs introduced and fixed between 1.2.0 and 1.2.1 (never in a release).
Definition at line 824 of file api_backend.cc.
References get_database(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), make_orcheck_db(), mset_expect_order(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Query::OP_VALUE_RANGE, Xapian::Enquire::set_query(), and tout.
DEFINE_TESTCASE | ( | failedreplace1 | , |
chert|| | glass | ||
) |
Regression test for bug fixed in 1.2.1 and 1.0.21.
We failed to mark the Btree as unmodified after cancel().
Definition at line 868 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::Database::get_doccount(), Xapian::Database::get_termfreq(), get_writable_database(), Xapian::WritableDatabase::replace_document(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | failedreplace2 | , |
chert|| | glass | ||
) |
Definition at line 883 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::Database::get_doccount(), Xapian::Database::get_termfreq(), get_writable_database(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | phrase3 | , |
positional | |||
) |
Coverage for SelectPostList::skip_to().
Definition at line 904 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND_MAYBE, Xapian::Query::OP_NEAR, and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | msetfirst2 | , |
backend | |||
) |
Check that get_mset(<large number>, 10) doesn't exhaust memory needlessly.
Definition at line 919 of file api_backend.cc.
References get_database(), Xapian::MSet::get_firstitem(), Xapian::Enquire::get_mset(), Xapian::Query::MatchNothing, Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | emptydb1 | , |
backend | |||
) |
Definition at line 938 of file api_backend.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::Query::OP_AND, Xapian::Query::OP_AND_MAYBE, Xapian::Query::OP_AND_NOT, Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_FILTER, Xapian::Query::OP_MAX, Xapian::Query::OP_NEAR, Xapian::Query::OP_OR, Xapian::Query::OP_PHRASE, Xapian::Query::OP_SYNONYM, Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | multiargop1 | , |
backend | |||
) |
Test operators which should allow more than two arguments.
Regression test for bug with OP_FILTER fixed in 1.4.15, and also for bugs with deleting the PostList which is currently set as the QueryOptimiser's hint fixed in 1.4.15.
Definition at line 971 of file api_backend.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::Query::OP_AND, Xapian::Query::OP_AND_MAYBE, Xapian::Query::OP_AND_NOT, Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_FILTER, Xapian::Query::OP_MAX, Xapian::Query::OP_NEAR, Xapian::Query::OP_OR, Xapian::Query::OP_PHRASE, Xapian::Query::OP_SYNONYM, Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), TEST_EQUAL, tests, and tout.
DEFINE_TESTCASE | ( | stubdb7 | , |
! | backend | ||
) |
Test error opening non-existent stub databases.
Definition at line 1003 of file api_backend.cc.
References Xapian::DB_BACKEND_STUB, Xapian::DB_OPEN, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | msetweights1 | , |
backend | |||
) |
Test which checks the weights are as expected.
Definition at line 1014 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | itorskiptofromend1 | , |
backend | |||
) |
Definition at line 1055 of file api_backend.cc.
References Xapian::ValueIterator::check(), get_database(), Xapian::Database::positionlist_begin(), Xapian::Database::positionlist_end(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::PositionIterator::skip_to(), Xapian::PostingIterator::skip_to(), Xapian::TermIterator::skip_to(), Xapian::ValueIterator::skip_to(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST, Xapian::Database::valuestream_begin(), and Xapian::Database::valuestream_end().
DEFINE_TESTCASE | ( | blocksize1 | , |
chert|| | glass | ||
) |
Check handling of invalid block sizes.
Definition at line 1088 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::DB_BACKEND_CHERT, Xapian::DB_BACKEND_GLASS, Xapian::DB_CREATE, get_dbtype(), rm_rf(), and Xapian::Document::set_data().
DEFINE_TESTCASE | ( | notermlist1 | , |
glass | |||
) |
Feature test for Xapian::DB_NO_TERMLIST.
Definition at line 1114 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::DB_BACKEND_CHERT, Xapian::DB_BACKEND_GLASS, Xapian::DB_CREATE, Xapian::DB_NO_TERMLIST, file_exists(), get_dbtype(), rm_rf(), Xapian::Database::termlist_begin(), TEST, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | newfreelistblock1 | , |
writable | |||
) |
Regression test for bug starting a new glass freelist block.
Definition at line 1136 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), get_writable_database(), and Xapian::Internal::str().
DEFINE_TESTCASE | ( | readonlyparentdir1 | , |
chert|| | glass | ||
) |
Check that the parent directory for the database doesn't need to be writable.
Regression test for early versions on the glass new btree branch which failed to append a "/" when generating a temporary filename from the database directory.
Definition at line 1160 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), get_named_writable_database(), get_named_writable_database_path(), Xapian::Document::set_data(), and TEST.
DEFINE_TESTCASE | ( | phrasebug1 | , |
positional | |||
) |
Regression test for ticket#653, fixed in 1.3.2 and 1.2.19.
Definition at line 1198 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), make_phrasebug1_db(), Xapian::Query::OP_PHRASE, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | retrylock1 | , |
writable && | path | ||
) |
Feature test for Xapian::DB_RETRY_LOCK.
Definition at line 1214 of file api_backend.cc.
References close(), Xapian::Database::close(), Xapian::DB_OPEN, Xapian::DB_RETRY_LOCK, errno_to_string(), FAIL_TEST, Xapian::Error::get_description(), get_named_writable_database(), get_named_writable_database_path(), SKIP_TEST, SOCK_CLOEXEC, TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | dbfilefd012 | , |
writable &&! | remote | ||
) |
Definition at line 1339 of file api_backend.cc.
References close(), get_writable_database(), S_ISREG, TEST, TEST_EQUAL, TEST_NOT_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | cursorbug1 | , |
writable && | path | ||
) |
Regression test for #675, fixed in 1.3.3 and 1.2.21.
Definition at line 1394 of file api_backend.cc.
References Xapian::Document::add_boolean_term(), Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), get_writable_database(), get_writable_database_as_database(), Xapian::Query::MatchAll, Xapian::Database::reopen(), Xapian::WritableDatabase::replace_document(), Xapian::Enquire::set_query(), Xapian::Internal::str(), and tout.
DEFINE_TESTCASE | ( | sortvalue2 | , |
backend | |||
) |
Definition at line 1434 of file api_backend.cc.
References Xapian::Database::add_database(), Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Database::get_document(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Query::MatchAll, Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), and TEST.
DEFINE_TESTCASE | ( | enquiregetquery1 | , |
backend | |||
) |
Check behaviour of Enquire::get_query().
Definition at line 1453 of file api_backend.cc.
References get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | embedded1 | , |
singlefile | |||
) |
Definition at line 1459 of file api_backend.cc.
References Xapian::Database::check(), Xapian::DBCHECK_SHOW_STATS, get_database(), get_database_path(), Xapian::Database::get_doccount(), O_BINARY, Xapian::InMemory::open(), TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | exactxor1 | , |
backend | |||
) |
Regression test for bug fixed in 1.3.7.
Definition at line 1489 of file api_backend.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::Query::OP_XOR, Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | getrevision1 | , |
chert|| | glass | ||
) |
Feature test for Database::get_revision().
Definition at line 1519 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::Database::get_revision(), get_writable_database(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | getrevision2 | , |
! | backend | ||
) |
Check get_revision() on an empty database reports 0. (Since 1.5.0)
Definition at line 1538 of file api_backend.cc.
References Xapian::Database::get_revision(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | getdocumentlazy1 | , |
backend | |||
) |
Feature test for DOC_ASSUME_VALID.
Definition at line 1546 of file api_backend.cc.
References Xapian::DOC_ASSUME_VALID, Xapian::Document::get_data(), get_database(), Xapian::Database::get_document(), Xapian::Document::get_value(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | getdocumentlazy2 | , |
backend | |||
) |
Feature test for DOC_ASSUME_VALID for a docid that doesn't actually exist.
Definition at line 1555 of file api_backend.cc.
References Xapian::DOC_ASSUME_VALID, Xapian::Document::get_data(), get_database(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), TEST, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | getuniqueterms1 | , |
backend | |||
) |
Definition at line 1585 of file api_backend.cc.
References gen_uniqterms_gt_doclen_db(), get_database(), Xapian::Database::get_doclength(), Xapian::Database::get_document(), Xapian::Database::get_unique_terms(), Xapian::Document::termlist_count(), and TEST_REL.
DEFINE_TESTCASE | ( | nopositionbug1 | , |
backend | |||
) |
Regression test for bug fixed in 1.4.6.
OP_NEAR would think a term without positional information occurred at position 1 if it had the lowest term frequency amongst the OP_NEAR's subqueries.
Definition at line 1610 of file api_backend.cc.
References gen_uniqterms_gt_doclen_db(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_NEAR, Xapian::Query::OP_PHRASE, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | checkatleast4 | , |
backend | |||
) |
Regression test for bug with get_mset(0, 0, N) (N > 0).
Fixed in 1.5.0 and 1.4.6.
Definition at line 1649 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | freelistleak1 | , |
check | |||
) |
Regression test for glass freelist leak fixed in 1.4.6 and 1.5.0.
Definition at line 1659 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Database::check(), Xapian::WritableDatabase::commit(), Xapian::DBCHECK_SHOW_STATS, get_database_path(), Xapian::WritableDatabase::set_metadata(), TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | splitpostings1 | , |
writable | |||
) |
Regression test for split position handling - broken in 1.4.8.
Definition at line 1676 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::WritableDatabase::commit(), get_writable_database(), Xapian::Database::positionlist_begin(), Xapian::Database::positionlist_end(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | multidb1 | , |
backend | |||
) |
Feature tests for Database::size().
Definition at line 1703 of file api_backend.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Database::size(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | allterms7 | , |
backend | |||
) |
Definition at line 1721 of file api_backend.cc.
References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), get_database(), Xapian::Database::get_termfreq(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), and TEST.
DEFINE_TESTCASE | ( | nosuchterm | , |
backend | |||
) |
Definition at line 1735 of file api_backend.cc.
References get_database(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | unsupportedcheck1 | , |
path | |||
) |
Definition at line 1750 of file api_backend.cc.
References Xapian::Database::check(), FAIL_TEST, get_database_path(), Xapian::Error::get_msg(), BackendManager::get_xapian_progsrv_command(), TEST, and TEST_STRINGS_EQUAL.
DEFINE_TESTCASE | ( | unsupportedcheck2 | , |
inmemory | |||
) |
Definition at line 1774 of file api_backend.cc.
References Xapian::Database::check(), TEST, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | unsupportedcheck3 | , |
! | backend | ||
) |
Definition at line 1787 of file api_backend.cc.
References Xapian::Database::check(), errno_to_string(), Xapian::Error::get_error_string(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | corruptglass1 | , |
glass | |||
) |
Definition at line 1800 of file api_backend.cc.
References Xapian::Database::check(), test_driver::get_srcdir(), and TEST_EXCEPTION.
|
static |
Definition at line 1571 of file api_backend.cc.
References Xapian::Document::add_boolean_term(), Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), and Xapian::Document::add_term().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 605 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::Document::add_value().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 655 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::Document::add_value().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 786 of file api_backend.cc.
References Xapian::Document::add_term(), Xapian::Database::get_document(), and Xapian::WritableDatabase::replace_document().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 731 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::Internal::str().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 1186 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), and Xapian::Document::add_posting().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 703 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::Internal::str().
Referenced by DEFINE_TESTCASE().