|
xapian-core
2.0.0
|
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 "net/resolver.h"#include "str.h"#include "socket_utils.h"#include "testrunner.h"#include "testsuite.h"#include "testutils.h"#include "unixcmds.h"#include "apitest.h"#include "safefcntl.h"#include "safenetdb.h"#include "safesysstat.h"#include "safeunistd.h"#include <cerrno>#include <fstream>#include <iterator>
Include dependency graph for api_backend.cc:Go to the source code of this file.
Classes | |
| class | CheckMatchDecider |
Functions | |
| DEFINE_TESTCASE (lockfileumask1, 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, glass) | |
| DEFINE_TESTCASE (lockfilealreadyopen1, glass) | |
| Regression test for bug fixed in 1.2.13 and 1.3.1. More... | |
| DEFINE_TESTCASE (testlock1, 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, glass) | |
| Feature tests for Database::lock() and unlock(). 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 commit counter. More... | |
| DEFINE_TESTCASE (replacedoc8, writable) | |
| Check that replacing a document deleted since the last commit 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, glass) | |
| Regression test for bug fixed in 1.2.1 and 1.0.21. More... | |
| DEFINE_TESTCASE (failedreplace2, 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, 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, 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, glass) | |
| Feature test for Database::get_revision(). More... | |
| DEFINE_TESTCASE (getrevision2, !backend) | |
| Check get_revision() on an empty database reports 0. (Since 2.0.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 (termitertf1, backend) | |
| Check that a TermIterator returns the correct termfreqs. 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. 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 (matchall3, backend) | |
| DEFINE_TESTCASE (reconstruct1, backend) | |
| DEFINE_TESTCASE (reconstruct2, writable) | |
| DEFINE_TESTCASE (positfrompostit1, positional) | |
| Regression test for bug fixed in git master before 2.0.0. More... | |
| DEFINE_TESTCASE (nosuchterm, backend) | |
| DEFINE_TESTCASE (allterms7, backend) | |
| DEFINE_TESTCASE (remoteportreuse1, remotetcp) | |
| 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_TESTCASE | ( | alldocspl3 | , |
| backend | |||
| ) |
Check handling of alldocs on an empty database.
Definition at line 240 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 | ( | allterms7 | , |
| backend | |||
| ) |
Definition at line 1898 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(), term, and TEST.
| DEFINE_TESTCASE | ( | blocksize1 | , |
| glass | |||
| ) |
Check handling of invalid block sizes.
Definition at line 1157 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::DB_BACKEND_GLASS, Xapian::DB_CREATE, FAIL_TEST, get_dbtype(), rm_rf(), and Xapian::Document::set_data().
| DEFINE_TESTCASE | ( | checkatleast4 | , |
| backend | |||
| ) |
Regression test for bug with get_mset(0, 0, N) (N > 0).
Fixed in 1.4.6.
Definition at line 1736 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | corruptglass1 | , |
| glass | |||
| ) |
Definition at line 2064 of file api_backend.cc.
References Xapian::Database::check(), test_driver::get_srcdir(), and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | cursorbug1 | , |
| writable && | path | ||
| ) |
Regression test for #675, fixed in 1.3.3 and 1.2.21.
Definition at line 1460 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 | ( | databasemodified1 | , |
| writable &&!inmemory &&! | multi | ||
| ) |
Test coverage for DatabaseModifiedError.
Definition at line 605 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 | ( | dbfilefd012 | , |
| writable &&! | remote | ||
| ) |
Definition at line 1405 of file api_backend.cc.
References close(), get_writable_database(), S_ISREG, TEST, TEST_EQUAL, TEST_NOT_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | dbstats1 | , |
| backend | |||
| ) |
Definition at line 157 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_unique_terms_lower_bound(), Xapian::Database::get_unique_terms_upper_bound(), Xapian::Database::get_wdf_upper_bound(), TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | dbstats2 | , |
| backend | |||
| ) |
Definition at line 200 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_unique_terms_lower_bound(), Xapian::Database::get_unique_terms_upper_bound(), Xapian::Database::get_wdf_upper_bound(), TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | doclenaftercommit1 | , |
| writable | |||
| ) |
Regression test for chert bug fixed in 1.1.3 (ticket#397).
Definition at line 270 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 | ( | embedded1 | , |
| singlefile | |||
| ) |
Definition at line 1525 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::Remote::open(), TEST_EQUAL, and tout.
| DEFINE_TESTCASE | ( | emptydb1 | , |
| backend | |||
| ) |
Definition at line 1007 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 | ( | enquiregetquery1 | , |
| backend | |||
| ) |
Check behaviour of Enquire::get_query().
Definition at line 1519 of file api_backend.cc.
References get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_query(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | exactxor1 | , |
| backend | |||
| ) |
Regression test for bug fixed in 1.3.7.
Definition at line 1555 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 | ( | exceed32bitcombineddb1 | , |
| writable | |||
| ) |
Definition at line 113 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, SKIP_TEST_FOR_BACKEND, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | failedreplace1 | , |
| 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 937 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 | , |
| glass | |||
| ) |
Definition at line 952 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 | ( | freelistleak1 | , |
| check | |||
| ) |
Regression test for glass freelist leak fixed in 1.4.6.
Definition at line 1746 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 | ( | getdocumentlazy1 | , |
| backend | |||
| ) |
Feature test for DOC_ASSUME_VALID.
Definition at line 1612 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 1621 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 | ( | getrevision1 | , |
| glass | |||
| ) |
Feature test for Database::get_revision().
Definition at line 1585 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 2.0.0)
Definition at line 1604 of file api_backend.cc.
References Xapian::Database::get_revision(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | getuniqueterms1 | , |
| backend | |||
| ) |
Definition at line 1651 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 | ( | itorskiptofromend1 | , |
| backend | |||
| ) |
Definition at line 1124 of file api_backend.cc.
References Xapian::ValueIterator::check(), get_database(), p, Xapian::Database::positionlist_begin(), Xapian::Database::positionlist_end(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::TermIterator::skip_to(), Xapian::ValueIterator::skip_to(), Xapian::PositionIterator::skip_to(), Xapian::PositionIterator::Internal::skip_to(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST, Xapian::Database::valuestream_begin(), and Xapian::Database::valuestream_end().
| DEFINE_TESTCASE | ( | lockfilealreadyopen1 | , |
| glass | |||
| ) |
Regression test for bug fixed in 1.2.13 and 1.3.1.
Definition at line 334 of file api_backend.cc.
References close(), Xapian::DB_CREATE_OR_OPEN, get_named_writable_database(), get_named_writable_database_path(), Xapian::Remote::open(), TEST, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | lockfilefd0or1 | , |
| glass | |||
| ) |
Definition at line 293 of file api_backend.cc.
References close(), get_writable_database(), get_writable_database_again(), and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | lockfileumask1 | , |
| glass | |||
| ) |
Regression test - lockfile should honour umask, was only user-readable.
Definition at line 58 of file api_backend.cc.
References get_named_writable_database(), get_named_writable_database_path(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | matchall3 | , |
| backend | |||
| ) |
Definition at line 1808 of file api_backend.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::MatchAll, Xapian::Query::OP_WILDCARD, Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | matchdecider4 | , |
| remote | |||
| ) |
Test Xapian::MatchDecider with remote backend fails.
Definition at line 501 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 | ( | modifiedpostlist1 | , |
| writable | |||
| ) |
Regression test for bug#392 in ModifiedPostList iteration, fixed in 1.0.15.
Definition at line 253 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 | ( | msetfirst2 | , |
| backend | |||
| ) |
Check that get_mset(<large number>, 10) doesn't exhaust memory needlessly.
Definition at line 988 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 | ( | msetweights1 | , |
| backend | |||
| ) |
Test which checks the weights are as expected.
Definition at line 1083 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 | ( | msize1 | , |
| backend | |||
| ) |
Regression test for ticket#464, fixed in 1.1.6 and 1.0.20.
Definition at line 692 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(), 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 740 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(), make_msize2_db(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), and TEST_EQUAL.
| 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 1040 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 | ( | multidb1 | , |
| backend | |||
| ) |
Feature tests for Database::size().
Definition at line 1790 of file api_backend.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Database::size(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | newfreelistblock1 | , |
| writable | |||
| ) |
Regression test for bug starting a new glass freelist block.
Definition at line 1202 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 | ( | 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 1676 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 | ( | nosuchterm | , |
| backend | |||
| ) |
Definition at line 1883 of file api_backend.cc.
References get_database(), term, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | notermlist1 | , |
| glass | |||
| ) |
Feature test for Xapian::DB_NO_TERMLIST.
Definition at line 1182 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), 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 | ( | 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 893 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 | ( | ordecay1 | , |
| backend | |||
| ) |
Regression test for bug in decay of OR to AND, fixed in 1.2.1 and 1.0.21.
Definition at line 817 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 834 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 | ( | phrase3 | , |
| positional | |||
| ) |
Coverage for SelectPostList::skip_to().
Definition at line 973 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 | ( | phrasebug1 | , |
| positional | |||
| ) |
Regression test for ticket#653, fixed in 1.3.2 and 1.2.19.
Definition at line 1264 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 | ( | positfrompostit1 | , |
| positional | |||
| ) |
Regression test for bug fixed in git master before 2.0.0.
A PositionIterator from a PostingIterator in a multidatabase always used the first shard, which could cause a segfault if the term wasn't present in that shard.
Definition at line 1847 of file api_backend.cc.
References get_database(), p, Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
| DEFINE_TESTCASE | ( | qpmemoryleak1 | , |
| writable &&! | inmemory | ||
| ) |
Regression test for bug#462 fixed in 1.0.19 and 1.1.5.
Definition at line 645 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_EXCEPTION3.
| DEFINE_TESTCASE | ( | readonlyparentdir1 | , |
| 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 1226 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 | ( | reconstruct1 | , |
| backend | |||
| ) |
Definition at line 1818 of file api_backend.cc.
References get_database(), Xapian::Database::reconstruct_text(), and TEST_STRINGS_EQUAL.
| DEFINE_TESTCASE | ( | reconstruct2 | , |
| writable | |||
| ) |
Definition at line 1828 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), get_database(), Xapian::Database::reconstruct_text(), and TEST_STRINGS_EQUAL.
| DEFINE_TESTCASE | ( | remoteportreuse1 | , |
| remotetcp | |||
| ) |
Definition at line 1922 of file api_backend.cc.
References CLOSESOCKET, errno_to_string(), FAIL_TEST, get_remote_database(), SOCK_CLOEXEC, socket_errno(), and tout.
| DEFINE_TESTCASE | ( | replacedoc7 | , |
| writable &&!inmemory &&! | remote | ||
| ) |
Check that replacing an unmodified document doesn't increase the automatic commit counter.
Regression test for bug fixed in 1.1.4/1.0.18.
Definition at line 517 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::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 commit 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 558 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), Xapian::WritableDatabase::delete_document(), Xapian::Database::get_collection_freq(), get_writable_database(), p, 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 2.0.0.
Definition at line 584 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 | ( | retrylock1 | , |
| writable && | path | ||
| ) |
Feature test for Xapian::DB_RETRY_LOCK.
Definition at line 1280 of file api_backend.cc.
References Xapian::Database::close(), 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 | ( | sortvalue2 | , |
| backend | |||
| ) |
Definition at line 1500 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 | ( | splitpostings1 | , |
| writable | |||
| ) |
Regression test for split position handling - broken in 1.4.8.
Definition at line 1763 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_posting(), Xapian::WritableDatabase::commit(), get_writable_database(), p, pos, Xapian::Database::positionlist_begin(), Xapian::Database::positionlist_end(), TEST_EQUAL, and TEST_REL.
| DEFINE_TESTCASE | ( | stubdb7 | , |
| ! | backend | ||
| ) |
Test error opening non-existent stub databases.
Definition at line 1072 of file api_backend.cc.
References Xapian::DB_BACKEND_STUB, Xapian::DB_OPEN, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | termitertf1 | , |
| backend | |||
| ) |
Check that a TermIterator returns the correct termfreqs.
Prior to 2.0.0, the termfreq was approximated in the multidatabase case.
Definition at line 1715 of file api_backend.cc.
References get_database(), Xapian::TermIterator::get_termfreq(), Xapian::TermIterator::skip_to(), Xapian::Database::termlist_begin(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | testlock1 | , |
| glass | |||
| ) |
Feature tests for Database::locked().
Definition at line 353 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 397 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 416 of file api_backend.cc.
References Xapian::Database::close(), get_database(), Xapian::Database::locked(), and TEST.
| DEFINE_TESTCASE | ( | testlock4 | , |
| glass | |||
| ) |
Feature tests for Database::lock() and unlock().
Definition at line 424 of file api_backend.cc.
References Xapian::Database::close(), get_named_writable_database(), get_writable_database_as_database(), Xapian::Database::lock(), Xapian::Database::locked(), SKIP_TEST, TEST, TEST_EXCEPTION, and Xapian::Database::unlock().
| DEFINE_TESTCASE | ( | totaldoclen1 | , |
| writable | |||
| ) |
Check that the backend handles total document length > 0xffffffff.
Definition at line 80 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 | ( | unsupportedcheck1 | , |
| path | |||
| ) |
Definition at line 2014 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 2038 of file api_backend.cc.
References Xapian::Database::check(), TEST, and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | unsupportedcheck3 | , |
| ! | backend | ||
| ) |
Definition at line 2051 of file api_backend.cc.
References Xapian::Database::check(), errno_to_string(), Xapian::Error::get_error_string(), and TEST_EQUAL.
| DEFINE_TESTCASE | ( | valuesaftercommit1 | , |
| writable | |||
| ) |
Definition at line 280 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 | ( | xordecay1 | , |
| backend | |||
| ) |
Regression test for bug in decay of XOR, fixed in 1.2.1 and 1.0.21.
Definition at line 785 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.
|
static |
Definition at line 1637 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 674 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 724 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 855 of file api_backend.cc.
References Xapian::Document::add_term(), Xapian::Document::add_value(), Xapian::Database::get_document(), and Xapian::WritableDatabase::replace_document().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 800 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), p, and Xapian::Internal::str().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 1252 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), and Xapian::Document::add_posting().
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 772 of file api_backend.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), and Xapian::Internal::str().
Referenced by DEFINE_TESTCASE().