xapian-core
1.4.27
|
tests of posting sources More...
#include <config.h>
#include "api_postingsource.h"
#include <xapian.h>
#include <string>
#include "safeunistd.h"
#include "str.h"
#include "testutils.h"
#include "apitest.h"
Go to the source code of this file.
Classes | |
class | MyOddPostingSource |
class | MyOddWeightingPostingSource |
class | MyDontAskWeightPostingSource |
class | ChangeMaxweightPostingSource |
class | SlowDecreasingValueWeightPostingSource |
class | CheckBoundsPostingSource |
class | CloneTestPostingSource |
class | OnlyTheFirstPostingSource |
class | EstimatePS |
PostingSource subclass for injecting tf bounds and estimate. More... | |
Functions | |
DEFINE_TESTCASE (externalsource1, backend &&!remote &&!multi) | |
DEFINE_TESTCASE (externalsource2, remote) | |
DEFINE_TESTCASE (externalsource3, backend &&!remote &&!multi) | |
DEFINE_TESTCASE (externalsource4, backend &&!remote) | |
DEFINE_TESTCASE (valueweightsource1, backend) | |
DEFINE_TESTCASE (valueweightsource2, valuestats) | |
DEFINE_TESTCASE (valueweightsource3, valuestats) | |
DEFINE_TESTCASE (fixedweightsource1, backend) | |
DEFINE_TESTCASE (changemaxweightsource1, backend &&!remote &&!multi) | |
DEFINE_TESTCASE (emptyvalwtsource1, backend &&!remote &&!multi) | |
static void | make_matchtimelimit1_db (Xapian::WritableDatabase &db, const string &) |
DEFINE_TESTCASE (matchtimelimit1, backend &&!remote) | |
DEFINE_TESTCASE (postingsourcebounds1, backend &&!remote) | |
DEFINE_TESTCASE (postingsourceclone1, !backend) | |
Test cloning of initial object, which regressed in 1.3.5. More... | |
DEFINE_TESTCASE (postingsourceshardindex1, multi &&!remote) | |
DEFINE_TESTCASE (estimaterounding1, backend &&!multi &&!remote) | |
Check estimate is rounded to suitable number of S.F. - new in 1.4.3. More... | |
tests of posting sources
Definition in file api_postingsource.cc.
DEFINE_TESTCASE | ( | externalsource1 | , |
backend &&!remote &&! | multi | ||
) |
Definition at line 91 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_FILTER, Xapian::Enquire::set_query(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | externalsource2 | , |
remote | |||
) |
Definition at line 120 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_FILTER, Xapian::Enquire::set_query(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | externalsource3 | , |
backend &&!remote &&! | multi | ||
) |
Definition at line 198 of file api_postingsource.cc.
References Xapian::MSet::empty(), get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), TEST, TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | externalsource4 | , |
backend &&! | remote | ||
) |
Definition at line 301 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_FILTER, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and tout.
DEFINE_TESTCASE | ( | valueweightsource1 | , |
backend | |||
) |
Definition at line 330 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_FILTER, Xapian::Enquire::set_query(), and tout.
DEFINE_TESTCASE | ( | valueweightsource2 | , |
valuestats | |||
) |
Definition at line 362 of file api_postingsource.cc.
References get_database(), Xapian::PostingSource::get_maxweight(), Xapian::ValuePostingSource::get_termfreq_est(), Xapian::ValuePostingSource::get_termfreq_max(), Xapian::ValuePostingSource::get_termfreq_min(), Xapian::ValueWeightPostingSource::init(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | valueweightsource3 | , |
valuestats | |||
) |
Definition at line 373 of file api_postingsource.cc.
References Xapian::ValuePostingSource::at_end(), get_database(), Xapian::ValuePostingSource::get_docid(), Xapian::ValueWeightPostingSource::init(), Xapian::ValuePostingSource::skip_to(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | fixedweightsource1 | , |
backend | |||
) |
Definition at line 387 of file api_postingsource.cc.
References Xapian::FixedWeightPostingSource::at_end(), Xapian::MSet::begin(), Xapian::FixedWeightPostingSource::check(), Xapian::MSet::end(), get_database(), Xapian::FixedWeightPostingSource::get_docid(), Xapian::Enquire::get_mset(), Xapian::FixedWeightPostingSource::init(), mset_expect_order(), Xapian::FixedWeightPostingSource::next(), Xapian::Enquire::set_query(), Xapian::FixedWeightPostingSource::skip_to(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | changemaxweightsource1 | , |
backend &&!remote &&! | multi | ||
) |
Definition at line 495 of file api_postingsource.cc.
References ChangeMaxweightPostingSource::at_end(), Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), get_database(), ChangeMaxweightPostingSource::get_docid(), Xapian::PostingSource::get_maxweight(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_AND, Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), TEST, TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | emptyvalwtsource1 | , |
backend &&!remote &&! | multi | ||
) |
Definition at line 539 of file api_postingsource.cc.
References get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND_MAYBE, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | matchtimelimit1 | , |
backend &&! | remote | ||
) |
Definition at line 625 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::DecreasingValueWeightPostingSource::init(), make_matchtimelimit1_db(), Xapian::Enquire::set_query(), Xapian::Enquire::set_time_limit(), Xapian::MSet::size(), SKIP_TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | postingsourcebounds1 | , |
backend &&! | remote | ||
) |
Definition at line 672 of file api_postingsource.cc.
References get_database(), Xapian::Database::get_doclength_lower_bound(), Xapian::Database::get_doclength_upper_bound(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | postingsourceclone1 | , |
! | backend | ||
) |
Test cloning of initial object, which regressed in 1.3.5.
Definition at line 725 of file api_postingsource.cc.
References Xapian::PostingSource::release(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | postingsourceshardindex1 | , |
multi &&! | remote | ||
) |
Definition at line 807 of file api_postingsource.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Enquire::set_query(), OnlyTheFirstPostingSource::shard_index, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | estimaterounding1 | , |
backend &&!multi &&! | remote | ||
) |
Check estimate is rounded to suitable number of S.F. - new in 1.4.3.
Definition at line 877 of file api_postingsource.cc.
References est(), get_database(), Xapian::MSet::get_description(), Xapian::MSet::get_matches_estimated(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST_EQUAL, testcases, and tout.
|
static |
Definition at line 614 of file api_postingsource.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_value(), and Xapian::sortable_serialise().
Referenced by DEFINE_TESTCASE().