23 #ifndef OM_HGUARD_TESTUTILS_H 24 #define OM_HGUARD_TESTUTILS_H 33 const std::vector<Xapian::docid> &ints);
47 const std::pair<Xapian::docid, double> to_compare[],
60 return !(first == second);
78 #define TEST_MSET_SIZE(M, S) TEST_AND_EXPLAIN(((M).size() == (S)), \ 79 "MSet '" STRINGIZE(M) "' is not of expected size: was '" << \ 80 (M).size() << "' expected '" << (S) << "':\n" << \ 81 "Full mset was:\n" << (M)) 84 #define TEST_EXCEPTION_(TYPE, CODE, EXACT) \ 86 expected_exception = STRINGIZE(TYPE); \ 87 if (strncmp(expected_exception, "Xapian::", \ 88 CONST_STRLEN("Xapian::")) == 0) { \ 89 expected_exception += CONST_STRLEN("Xapian::"); \ 93 FAIL_TEST("Expected " << expected_exception << " not thrown"); \ 94 } catch (const TYPE& xap_ex_obj_) { \ 96 if (strcmp(expected_exception, xap_ex_obj_.get_type()) != 0) { \ 97 FAIL_TEST("Caught subclass " << xap_ex_obj_.get_type() << \ 98 " of expected " << expected_exception); \ 102 expected_exception = NULL;\ 106 #define TEST_EXCEPTION_BASE_CLASS(TYPE, CODE) TEST_EXCEPTION_(TYPE, CODE, false) 109 #define TEST_EXCEPTION(TYPE, CODE) TEST_EXCEPTION_(TYPE, CODE, true) 111 #endif // OM_HGUARD_TESTUTILS_H a generic test suite engine
Class representing a list of search results.
std::ostream & operator<<(std::ostream &os, const std::vector< Xapian::docid > &ints)
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)
bool operator!=(const Xapian::MSet &first, const Xapian::MSet &second)
bool operator==(const Xapian::MSet &first, const Xapian::MSet &second)
Public interfaces for the Xapian library.
bool mset_range_is_same(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
void test_mset_order_equal(const Xapian::MSet &mset1, const Xapian::MSet &mset2)
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
bool mset_range_is_same_weights(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)