xapian-core
1.4.26
|
tests which work with any backend More...
#include <config.h>
#include "api_anydb.h"
#include <algorithm>
#include <string>
#include <xapian.h>
#include "testsuite.h"
#include "testutils.h"
#include "apitest.h"
#include <list>
Go to the source code of this file.
Classes | |
class | EvenParityExpandFunctor |
Macros | |
#define | XAPIAN_DEPRECATED(X) X |
Functions | |
static void | print_mset_weights (const Xapian::MSet &mset) |
static void | print_mset_percentages (const Xapian::MSet &mset) |
static Xapian::Query | query (Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string()) |
static Xapian::Query | query (Xapian::Query::op op, Xapian::termcount parameter, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string()) |
static Xapian::Query | query (const string &t) |
DEFINE_TESTCASE (zerodocid1, backend) | |
DEFINE_TESTCASE (emptyquery1, backend) | |
DEFINE_TESTCASE (simplequery1, backend) | |
DEFINE_TESTCASE (simplequery2, backend) | |
DEFINE_TESTCASE (simplequery3, backend) | |
DEFINE_TESTCASE (multidb2, backend &&!multi) | |
DEFINE_TESTCASE (msetmaxitems1, backend) | |
DEFINE_TESTCASE (expandweights1, backend) | |
DEFINE_TESTCASE (expandweights2, backend) | |
DEFINE_TESTCASE (expandweights3, backend) | |
DEFINE_TESTCASE (expandweights4, backend) | |
DEFINE_TESTCASE (expandweights5, backend) | |
DEFINE_TESTCASE (expandweights6, backend) | |
DEFINE_TESTCASE (expandweights7, backend) | |
DEFINE_TESTCASE (expandweights8, backend) | |
DEFINE_TESTCASE (expandmaxitems1, backend) | |
DEFINE_TESTCASE (boolquery1, backend) | |
DEFINE_TESTCASE (msetfirst1, backend) | |
DEFINE_TESTCASE (topercent1, backend) | |
DEFINE_TESTCASE (topercent2, backend) | |
DEFINE_TESTCASE (expandfunctor1, backend) | |
DEFINE_TESTCASE (expanddeciderfilterprefix2, backend) | |
DEFINE_TESTCASE (pctcutoff1, backend) | |
DEFINE_TESTCASE (pctcutoff2, backend) | |
DEFINE_TESTCASE (pctcutoff3, backend) | |
DEFINE_TESTCASE (cutoff1, backend) | |
DEFINE_TESTCASE (allowqterms1, backend) | |
DEFINE_TESTCASE (maxattain1, backend) | |
DEFINE_TESTCASE (reversebool1, backend) | |
DEFINE_TESTCASE (reversebool2, backend) | |
DEFINE_TESTCASE (getmterms1, backend) | |
DEFINE_TESTCASE (getmterms2, backend) | |
DEFINE_TESTCASE (repeatquery1, backend) | |
DEFINE_TESTCASE (fetchdocs1, backend) | |
DEFINE_TESTCASE (absentterm1, backend) | |
DEFINE_TESTCASE (absentterm2, backend) | |
DEFINE_TESTCASE (rset1, backend) | |
DEFINE_TESTCASE (rset2, backend) | |
Test that an RSet affects MSet result order. More... | |
DEFINE_TESTCASE (rsetmultidb1, backend &&!multi) | |
DEFINE_TESTCASE (rsetmultidb3, backend &&!multi) | |
DEFINE_TESTCASE (eliteset1, backend &&!multi) | |
Simple test of the elite set operator. More... | |
DEFINE_TESTCASE (elitesetmulti1, multi) | |
Multi-backend variant of eliteset1. More... | |
DEFINE_TESTCASE (eliteset2, backend &&!multi) | |
Test that the elite set operator works if the set contains sub-expressions (regression test) More... | |
DEFINE_TESTCASE (elitesetmulti2, multi) | |
Multi-backend variant of eliteset2. More... | |
DEFINE_TESTCASE (eliteset3, backend) | |
Test that elite set doesn't affect query results if we have fewer terms than the threshold. More... | |
DEFINE_TESTCASE (eliteset4, backend &&!multi) | |
Test that elite set doesn't pick terms with 0 frequency. More... | |
DEFINE_TESTCASE (elitesetmulti4, multi) | |
Multi-backend variant of eliteset4. More... | |
DEFINE_TESTCASE (eliteset5, backend) | |
Regression test for problem with excess precision. More... | |
DEFINE_TESTCASE (termlisttermfreq1, backend) | |
Test that the termfreq returned by termlists is correct. More... | |
DEFINE_TESTCASE (qterminfo1, backend) | |
Test the termfreq and termweight info returned for query terms. More... | |
DEFINE_TESTCASE (qterminfo2, backend) | |
Regression test for bug #37. More... | |
DEFINE_TESTCASE (msetzeroitems1, backend) | |
DEFINE_TESTCASE (matches1, backend) | |
DEFINE_TESTCASE (wqf1, backend) | |
DEFINE_TESTCASE (qlen1, backend) | |
DEFINE_TESTCASE (termlist1, backend) | |
DEFINE_TESTCASE (termlist2, backend) | |
static Xapian::TermIterator | test_termlist3_helper () |
DEFINE_TESTCASE (termlist3, backend) | |
DEFINE_TESTCASE (termlist4, backend) | |
DEFINE_TESTCASE (puncterms1, backend) | |
DEFINE_TESTCASE (spaceterms1, backend) | |
DEFINE_TESTCASE (xor1, backend) | |
DEFINE_TESTCASE (xor2, backend) | |
Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21). More... | |
DEFINE_TESTCASE (getdoc1, backend) | |
DEFINE_TESTCASE (emptyop1, backend) | |
DEFINE_TESTCASE (checkatleast1, backend) | |
DEFINE_TESTCASE (checkatleast2, backend) | |
DEFINE_TESTCASE (checkatleast3, backend) | |
DEFINE_TESTCASE (allpostlist1, backend) | |
static void | test_emptyterm1_helper (Xapian::Database &db) |
DEFINE_TESTCASE (emptyterm1, backend) | |
DEFINE_TESTCASE (alldocspl1, backend) | |
DEFINE_TESTCASE (alldocspl2, writable) | |
DEFINE_TESTCASE (scaleweight1, backend) | |
DEFINE_TESTCASE (scaleweight2, backend) | |
DEFINE_TESTCASE (uuid1, backend &&!multi) | |
tests which work with any backend
Definition in file api_anydb.cc.
#define XAPIAN_DEPRECATED | ( | X | ) | X |
Definition at line 33 of file api_anydb.cc.
DEFINE_TESTCASE | ( | zerodocid1 | , |
backend | |||
) |
Definition at line 118 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST_AND_EXPLAIN, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | emptyquery1 | , |
backend | |||
) |
Definition at line 141 of file api_anydb.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::Query::OP_AND, Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | simplequery1 | , |
backend | |||
) |
Definition at line 167 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | simplequery2 | , |
backend | |||
) |
Definition at line 175 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), mset_expect_order(), Xapian::Enquire::set_query(), and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | simplequery3 | , |
backend | |||
) |
Definition at line 198 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | multidb2 | , |
backend &&! | multi | ||
) |
Definition at line 208 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | msetmaxitems1 | , |
backend | |||
) |
Definition at line 226 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | expandweights1 | , |
backend | |||
) |
Definition at line 239 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_REL, and Xapian::Enquire::USE_EXACT_TERMFREQ.
DEFINE_TESTCASE | ( | expandweights2 | , |
backend | |||
) |
Definition at line 267 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights3 | , |
backend | |||
) |
Definition at line 290 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights4 | , |
backend | |||
) |
Definition at line 314 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights5 | , |
backend | |||
) |
Definition at line 334 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_expansion_scheme(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights6 | , |
backend | |||
) |
Definition at line 356 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_expansion_scheme(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_REL, and Xapian::Enquire::USE_EXACT_TERMFREQ.
DEFINE_TESTCASE | ( | expandweights7 | , |
backend | |||
) |
Definition at line 388 of file api_anydb.cc.
References get_database(), Xapian::Enquire::set_expansion_scheme(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | expandweights8 | , |
backend | |||
) |
Definition at line 396 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::ESet::back(), Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandmaxitems1 | , |
backend | |||
) |
Definition at line 421 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_REL, and tout.
DEFINE_TESTCASE | ( | boolquery1 | , |
backend | |||
) |
Definition at line 440 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | msetfirst1 | , |
backend | |||
) |
Definition at line 460 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_range_is_same(), query(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | topercent1 | , |
backend | |||
) |
Definition at line 474 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_percent(), Xapian::MSetIterator::get_weight(), query(), Xapian::Enquire::set_query(), and TEST_AND_EXPLAIN.
DEFINE_TESTCASE | ( | topercent2 | , |
backend | |||
) |
Definition at line 495 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), 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(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandfunctor1 | , |
backend | |||
) |
Definition at line 558 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, TEST_EQUAL, tout, and verbose.
DEFINE_TESTCASE | ( | expanddeciderfilterprefix2 | , |
backend | |||
) |
Definition at line 617 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), Xapian::ESet::size(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | pctcutoff1 | , |
backend | |||
) |
Definition at line 667 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, print_mset_percentages(), query(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_AND_EXPLAIN, tout, and verbose.
DEFINE_TESTCASE | ( | pctcutoff2 | , |
backend | |||
) |
Definition at line 718 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_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::Query::OP_AND_NOT, print_mset_percentages(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_REL, tout, and verbose.
DEFINE_TESTCASE | ( | pctcutoff3 | , |
backend | |||
) |
Definition at line 750 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_percent(), print_mset_percentages(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, tout, and verbose.
DEFINE_TESTCASE | ( | cutoff1 | , |
backend | |||
) |
Definition at line 777 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Query::OP_OR, print_mset_weights(), query(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_AND_EXPLAIN, tout, and verbose.
DEFINE_TESTCASE | ( | allowqterms1 | , |
backend | |||
) |
Definition at line 828 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::INCLUDE_QUERY_TERMS, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | maxattain1 | , |
backend | |||
) |
Definition at line 856 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSet::get_max_attained(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | reversebool1 | , |
backend | |||
) |
Definition at line 870 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | reversebool2 | , |
backend | |||
) |
Definition at line 915 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | getmterms1 | , |
backend | |||
) |
Definition at line 961 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), TEST, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | getmterms2 | , |
backend | |||
) |
Definition at line 990 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), TEST, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | repeatquery1 | , |
backend | |||
) |
Definition at line 1018 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | fetchdocs1 | , |
backend | |||
) |
Definition at line 1030 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSet::fetch(), Xapian::Document::get_data(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | absentterm1 | , |
backend | |||
) |
Definition at line 1060 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | absentterm2 | , |
backend | |||
) |
Definition at line 1070 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | rset1 | , |
backend | |||
) |
Definition at line 1083 of file api_anydb.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | rset2 | , |
backend | |||
) |
Test that an RSet affects MSet result order.
Definition at line 1103 of file api_anydb.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | rsetmultidb1 | , |
backend &&! | multi | ||
) |
Definition at line 1128 of file api_anydb.cc.
References Xapian::Database::add_database(), Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), mset_range_is_same_weights(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), TEST, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | rsetmultidb3 | , |
backend &&! | multi | ||
) |
Definition at line 1164 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | eliteset1 | , |
backend &&! | multi | ||
) |
Simple test of the elite set operator.
Definition at line 1171 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti1 | , |
multi | |||
) |
Multi-backend variant of eliteset1.
Definition at line 1190 of file api_anydb.cc.
References 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::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset2 | , |
backend &&! | multi | ||
) |
Test that the elite set operator works if the set contains sub-expressions (regression test)
Definition at line 1219 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti2 | , |
multi | |||
) |
Multi-backend variant of eliteset2.
Definition at line 1241 of file api_anydb.cc.
References 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::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_AND, Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset3 | , |
backend | |||
) |
Test that elite set doesn't affect query results if we have fewer terms than the threshold.
Definition at line 1277 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termfreq(), Xapian::MSet::get_termweight(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), stemmer, and TEST_EQUAL.
DEFINE_TESTCASE | ( | eliteset4 | , |
backend &&! | multi | ||
) |
Test that elite set doesn't pick terms with 0 frequency.
Definition at line 1323 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti4 | , |
multi | |||
) |
Multi-backend variant of eliteset4.
Definition at line 1345 of file api_anydb.cc.
References 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::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset5 | , |
backend | |||
) |
Regression test for problem with excess precision.
Definition at line 1374 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_SCALE_WEIGHT, and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | termlisttermfreq1 | , |
backend | |||
) |
Test that the termfreq returned by termlists is correct.
Definition at line 1406 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::ESet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::ESetIterator::get_weight(), stemmer, TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | qterminfo1 | , |
backend | |||
) |
Test the termfreq and termweight info returned for query terms.
Definition at line 1448 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termfreq(), Xapian::MSet::get_termweight(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), stemmer, TEST_EQUAL, TEST_EXCEPTION, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | qterminfo2 | , |
backend | |||
) |
Regression test for bug #37.
Definition at line 1508 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termweight(), Xapian::Query::OP_AND, Xapian::Query::OP_AND_NOT, query(), Xapian::Enquire::set_query(), stemmer, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | msetzeroitems1 | , |
backend | |||
) |
Definition at line 1536 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | matches1 | , |
backend | |||
) |
Definition at line 1547 of file api_anydb.cc.
References get_database(), get_dbtype(), 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::Query::OP_AND, Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::Database::size(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | wqf1 | , |
backend | |||
) |
Definition at line 1671 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | qlen1 | , |
backend | |||
) |
Definition at line 1685 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | termlist1 | , |
backend | |||
) |
Definition at line 1699 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | termlist2 | , |
backend | |||
) |
Definition at line 1713 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | termlist3 | , |
backend | |||
) |
Definition at line 1747 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST_EQUAL, and test_termlist3_helper().
DEFINE_TESTCASE | ( | termlist4 | , |
backend | |||
) |
Definition at line 1761 of file api_anydb.cc.
References get_database(), Xapian::TermIterator::skip_to(), and Xapian::Database::termlist_begin().
DEFINE_TESTCASE | ( | puncterms1 | , |
backend | |||
) |
Definition at line 1769 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | spaceterms1 | , |
backend | |||
) |
Definition at line 1787 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::Document::get_data(), 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 | ( | xor1 | , |
backend | |||
) |
Definition at line 1831 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and stemmer.
DEFINE_TESTCASE | ( | xor2 | , |
backend | |||
) |
Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21).
Definition at line 1856 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), and stemmer.
DEFINE_TESTCASE | ( | getdoc1 | , |
backend | |||
) |
Definition at line 1880 of file api_anydb.cc.
References get_database(), Xapian::Database::get_document(), Xapian::Document::set_data(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | emptyop1 | , |
backend | |||
) |
Definition at line 1897 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_XOR, Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | checkatleast1 | , |
backend | |||
) |
Definition at line 1914 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | checkatleast2 | , |
backend | |||
) |
Definition at line 1923 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::Enquire::set_query(), TEST_EQUAL, TEST_MSET_SIZE, and TEST_REL.
DEFINE_TESTCASE | ( | checkatleast3 | , |
backend | |||
) |
Definition at line 1941 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::Enquire::DESCENDING, Xapian::Enquire::DONT_CARE, 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_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_relevance(), Xapian::Enquire::set_sort_by_relevance_then_value(), Xapian::Enquire::set_sort_by_value(), Xapian::Enquire::set_sort_by_value_then_relevance(), TEST_EQUAL, TEST_MSET_SIZE, and TEST_REL.
DEFINE_TESTCASE | ( | allpostlist1 | , |
backend | |||
) |
Definition at line 2002 of file api_anydb.cc.
References get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::PostingIterator::skip_to(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | emptyterm1 | , |
backend | |||
) |
Definition at line 2037 of file api_anydb.cc.
References get_database(), Xapian::Database::get_doccount(), test_emptyterm1_helper(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | alldocspl1 | , |
backend | |||
) |
Definition at line 2052 of file api_anydb.cc.
References Xapian::Document::add_value(), get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | alldocspl2 | , |
writable | |||
) |
Definition at line 2072 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::WritableDatabase::delete_document(), Xapian::PostingIterator::get_doclength(), Xapian::PostingIterator::get_unique_terms(), Xapian::PostingIterator::get_wdf(), 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 | ( | scaleweight1 | , |
backend | |||
) |
Definition at line 2159 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_mset(), Xapian::Query::OP_SCALE_WEIGHT, Xapian::QueryParser::parse_query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_EXCEPTION, TEST_NOT_EQUAL_DOUBLE, and tout.
DEFINE_TESTCASE | ( | scaleweight2 | , |
backend | |||
) |
Definition at line 2228 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | uuid1 | , |
backend &&! | multi | ||
) |
Definition at line 2280 of file api_anydb.cc.
References Xapian::DB_BACKEND_INMEMORY, get_database(), Xapian::Database::get_uuid(), SKIP_TEST_FOR_BACKEND, TEST, and TEST_EQUAL.
|
static |
Definition at line 54 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), and tout.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 45 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSetIterator::get_weight(), and tout.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 63 of file api_anydb.cc.
References stemmer.
Referenced by Xapian::Weight::Internal::accumulate_stats(), Term::as_range_query(), DEFINE_TESTCASE(), LocalSubMatch::get_postlist(), GlassDatabase::get_postlist_cursor(), ChertDatabase::get_postlist_cursor(), Xapian::Database::Internal::Internal(), main(), RemoteServer::msg_query(), Xapian::MSet::Internal::snippet(), and ProbQuery::~ProbQuery().
|
static |
Definition at line 86 of file api_anydb.cc.
References stemmer.
|
static |
Definition at line 109 of file api_anydb.cc.
|
static |
Definition at line 2027 of file api_anydb.cc.
References Xapian::Database::get_collection_freq(), Xapian::Database::get_doccount(), Xapian::Database::get_termfreq(), Xapian::Database::positionlist_begin(), Xapian::Database::term_exists(), TEST_EQUAL, and TEST_EXCEPTION.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 1740 of file api_anydb.cc.
References get_database(), and Xapian::Database::termlist_begin().
Referenced by DEFINE_TESTCASE().