#include <config.h>
#include "api_percentages.h"
#include <xapian.h>
#include "apitest.h"
#include "backendmanager_local.h"
#include "testutils.h"
#include <cfloat>

Go to the source code of this file.
Classes | |
| class | MyPostingSource |
Functions | |
| DEFINE_TESTCASE (consistency3, backend) | |
| DEFINE_TESTCASE (pctcutoff4, backend &&!remote &&!multi) | |
| Test for rounding errors in percentage weight calculations and cutoffs. | |
| DEFINE_TESTCASE (pctcutoff5, backend) | |
| Check we throw for a percentage cutoff while sorting primarily by value. | |
| DEFINE_TESTCASE (topercent3, remote) | |
| DEFINE_TESTCASE (topercent4, backend) | |
| DEFINE_TESTCASE (topercent5, backend) | |
| Test that a search with a non-existent term doesn't get 100%. | |
Definition in file api_percentages.cc.
| DEFINE_TESTCASE | ( | topercent5 | , | |
| backend | ||||
| ) |
Test that a search with a non-existent term doesn't get 100%.
Definition at line 246 of file api_percentages.cc.
References Xapian::MSet::empty(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), and TEST.
| DEFINE_TESTCASE | ( | topercent4 | , | |
| backend | ||||
| ) |
Definition at line 226 of file api_percentages.cc.
References Xapian::MSet::empty(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_FILTER, Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
| DEFINE_TESTCASE | ( | topercent3 | , | |
| remote | ||||
| ) |
Definition at line 200 of file api_percentages.cc.
References Xapian::Database::add_database(), BackendManagerLocal, Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_percent(), test_driver::get_srcdir(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), and TEST_REL.
| DEFINE_TESTCASE | ( | pctcutoff5 | , | |
| backend | ||||
| ) |
Check we throw for a percentage cutoff while sorting primarily by value.
Definition at line 177 of file api_percentages.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), Xapian::Enquire::set_sort_by_value_then_relevance(), and TEST_EXCEPTION.
| DEFINE_TESTCASE | ( | pctcutoff4 | , | |
| backend &&!remote &&! | multi | |||
| ) |
Test for rounding errors in percentage weight calculations and cutoffs.
Definition at line 125 of file api_percentages.cc.
References MyPostingSource::append_docweight(), Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and tout.
| DEFINE_TESTCASE | ( | consistency3 | , | |
| backend | ||||
| ) |
Definition at line 39 of file api_percentages.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_value(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_EQUAL_DOUBLE, and tout.