xapian-core
1.4.26
|
Xapian-specific test helper functions and macros. More...
Go to the source code of this file.
Macros | |
#define | TEST_MSET_SIZE(M, S) |
Check MSet M has size S. More... | |
#define | TEST_EXCEPTION_(TYPE, CODE, EXACT) |
Helper macro. More... | |
#define | TEST_EXCEPTION_BASE_CLASS(TYPE, CODE) TEST_EXCEPTION_(TYPE, CODE, false) |
Check that CODE throws Xapian exception derived from TYPE. More... | |
#define | TEST_EXCEPTION(TYPE, CODE) TEST_EXCEPTION_(TYPE, CODE, true) |
Check that CODE throws exactly Xapian exception TYPE. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, const std::vector< Xapian::docid > &ints) |
bool | mset_range_is_same (const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count) |
bool | mset_range_is_same (const Xapian::MSet &mset, unsigned int first, const std::pair< Xapian::docid, double > to_compare[], unsigned int count) |
bool | mset_range_is_same_weights (const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count) |
bool | operator== (const Xapian::MSet &first, const Xapian::MSet &second) |
bool | operator!= (const Xapian::MSet &first, const Xapian::MSet &second) |
void | mset_expect_order (const Xapian::MSet &A, Xapian::docid d1=0, Xapian::docid d2=0, Xapian::docid d3=0, Xapian::docid d4=0, Xapian::docid d5=0, Xapian::docid d6=0, Xapian::docid d7=0, Xapian::docid d8=0, Xapian::docid d9=0, Xapian::docid d10=0, Xapian::docid d11=0, Xapian::docid d12=0) |
void | test_mset_order_equal (const Xapian::MSet &mset1, const Xapian::MSet &mset2) |
Xapian-specific test helper functions and macros.
Definition in file testutils.h.
#define TEST_EXCEPTION | ( | TYPE, | |
CODE | |||
) | TEST_EXCEPTION_(TYPE, CODE, true) |
Check that CODE throws exactly Xapian exception TYPE.
Definition at line 109 of file testutils.h.
Referenced by DEFINE_TESTCASE(), replicate_with_brokenness(), test_emptyterm1_helper(), and test_emptyterm2_helper().
#define TEST_EXCEPTION_ | ( | TYPE, | |
CODE, | |||
EXACT | |||
) |
Helper macro.
Definition at line 84 of file testutils.h.
#define TEST_EXCEPTION_BASE_CLASS | ( | TYPE, | |
CODE | |||
) | TEST_EXCEPTION_(TYPE, CODE, false) |
Check that CODE throws Xapian exception derived from TYPE.
Definition at line 106 of file testutils.h.
Referenced by DEFINE_TESTCASE().
#define TEST_MSET_SIZE | ( | M, | |
S | |||
) |
Check MSet M has size S.
Definition at line 78 of file testutils.h.
Referenced by DEFINE_TESTCASE().
void mset_expect_order | ( | const Xapian::MSet & | A, |
Xapian::docid | d1 = 0 , |
||
Xapian::docid | d2 = 0 , |
||
Xapian::docid | d3 = 0 , |
||
Xapian::docid | d4 = 0 , |
||
Xapian::docid | d5 = 0 , |
||
Xapian::docid | d6 = 0 , |
||
Xapian::docid | d7 = 0 , |
||
Xapian::docid | d8 = 0 , |
||
Xapian::docid | d9 = 0 , |
||
Xapian::docid | d10 = 0 , |
||
Xapian::docid | d11 = 0 , |
||
Xapian::docid | d12 = 0 |
||
) |
Definition at line 225 of file testutils.cc.
References mset_expect_order_().
Referenced by DEFINE_TESTCASE(), and operator!=().
bool mset_range_is_same | ( | const Xapian::MSet & | mset1, |
unsigned int | first1, | ||
const Xapian::MSet & | mset2, | ||
unsigned int | first2, | ||
unsigned int | count | ||
) |
Definition at line 46 of file testutils.cc.
References Xapian::MSetIterator::get_weight(), Xapian::MSet::size(), TEST_AND_EXPLAIN, TEST_EQUAL_DOUBLE_(), and tout.
Referenced by DEFINE_TESTCASE(), and operator==().
bool mset_range_is_same | ( | const Xapian::MSet & | mset, |
unsigned int | first, | ||
const std::pair< Xapian::docid, double > | to_compare[], | ||
unsigned int | count | ||
) |
bool mset_range_is_same_weights | ( | const Xapian::MSet & | mset1, |
unsigned int | first1, | ||
const Xapian::MSet & | mset2, | ||
unsigned int | first2, | ||
unsigned int | count | ||
) |
Definition at line 111 of file testutils.cc.
References Xapian::MSetIterator::get_weight(), Xapian::MSet::size(), TEST_AND_EXPLAIN, TEST_EQUAL_DOUBLE_(), and tout.
Referenced by DEFINE_TESTCASE().
|
inline |
Definition at line 58 of file testutils.h.
References mset_expect_order(), and test_mset_order_equal().
std::ostream& operator<< | ( | std::ostream & | os, |
const std::vector< Xapian::docid > & | ints | ||
) |
Definition at line 35 of file testutils.cc.
bool operator== | ( | const Xapian::MSet & | first, |
const Xapian::MSet & | second | ||
) |
Definition at line 141 of file testutils.cc.
References Xapian::MSet::empty(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_possible(), mset_range_is_same(), and Xapian::MSet::size().
void test_mset_order_equal | ( | const Xapian::MSet & | mset1, |
const Xapian::MSet & | mset2 | ||
) |
Definition at line 234 of file testutils.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSet::size(), and TEST_AND_EXPLAIN.
Referenced by DEFINE_TESTCASE(), and operator!=().