40 tout <<
"testing valuestream iteration for slot " << slot <<
'\n';
60 unsigned interval = 1;
61 while (interval < 1999) {
63 tout <<
"testing valuestream skip_to for slot " << slot
64 <<
" with interval " << interval <<
'\n';
75 while (did < actual_did) {
85 interval = interval * 3 - 1;
96 CHECK, CHECK_AND_NEXT, CHECK2, SKIP_TO, CHECK_AND_LOOP
98 test_op operation = CHECK;
101 unsigned interval = 1;
102 while (interval < 1999) {
103 tout <<
"testing valuestream check for slot " << slot
104 <<
" with interval " << interval <<
'\n';
109 bool positioned =
true;
114 case CHECK:
case CHECK2:
115 positioned = it.
check(did);
117 case CHECK_AND_NEXT: {
118 bool was_skip_to = it.
check(did);
119 if (!was_skip_to) ++it;
126 operation = test_op(operation + 1);
134 while (did < actual_did) {
145 interval = interval * 3 - 1;
170 SKIP_TEST(
"Testcase is too slow with remote shards");
171 XFAIL_FOR_BACKEND(
"honey",
"compaction needs to split sparse document length chunks");
Xapian::doccount size() const
Return number of items in this MSet object.
Xapian::Document get_document(Xapian::docid did) const
Get a document from the database, given its document id.
Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
#define TEST(a)
Test a condition, without an additional explanation for failure.
This class is used to access a database, or a group of databases.
bool mset_range_is_same(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
Xapian::docid get_docid() const
Return the current docid.
A posting source which looks up weights in a map using values as the key.
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
Xapian::WritableDatabase get_writable_database(const string &dbname)
bool at_end() const
Return true if the current position is past the last entry in this list.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
a generic test suite engine
Class for iterating over document values.
Class representing a list of search results.
MSet get_mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast=0, const RSet *omrset=0, const MatchDecider *mdecider=0) const
Get (a portion of) the match set for the current query.
std::string sortable_serialise(double value)
Convert a floating point number to a string, preserving sort order.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
void clear_mappings()
Clear all mappings.
Read weights from a value which is known to decrease as docid increases.
bool contains(const std::string &s, char substring)
test functionality of the Xapian API
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
ValueIterator valuestream_end(Xapian::valueno) const
Return end iterator corresponding to valuestream_begin().
This class provides read/write access to a database.
std::ostringstream tout
The debug printing stream.
Public interfaces for the Xapian library.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
A posting source which returns a fixed weight for all documents.
DEFINE_TESTCASE(valuestream1, backend)
Feature test simple valuestream iteration.
bool at_end() const
Return true if the current position is past the last entry in this list.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void commit()
Commit any pending modifications made to the database.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
#define SKIP_TEST_FOR_BACKEND(B)
ValueIterator valuestream_begin(Xapian::valueno slot) const
Return an iterator over the value in slot slot for each document.
static void gen_valueweightsource5_db(Xapian::WritableDatabase &db, const string &)
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
bool check(Xapian::docid docid)
Check if the specified docid occurs.
A posting source which reads weights from a value slot.
Xapian::Database get_database(const string &dbname)
void set_default_weight(double wt)
Set a default weight for document values not in the map.
#define SKIP_TEST(MSG)
Skip the current testcase with message MSG.
void XFAIL_FOR_BACKEND(const std::string &backend_prefix, const char *msg)
This class provides an interface to the information retrieval system for the purpose of searching...
void init(const Xapian::Database &db_)
Set this PostingSource to the start of the list of postings.
void add_mapping(const std::string &key, double wt)
Add a mapping.
unsigned valueno
The number for a value slot in a document.
Xapian-specific test helper functions and macros.
static void gen_decvalwtsource3_db(Xapian::WritableDatabase &db, const string &)
Xapian::docid get_docid() const
Return the docid at the current position.
void mset_expect_order(const Xapian::MSet &A, Xapian::docid d1, Xapian::docid d2, Xapian::docid d3, Xapian::docid d4, Xapian::docid d5, Xapian::docid d6, Xapian::docid d7, Xapian::docid d8, Xapian::docid d9, Xapian::docid d10, Xapian::docid d11, Xapian::docid d12)
void next(double min_wt)
Advance the current position to the next matching document.
void next(double min_wt)
Advance the current position to the next matching document.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Class representing a query.
#define TEST_EQUAL(a, b)
Test for equality of two things.
static void gen_decvalwtsource5_db(Xapian::WritableDatabase &db, const string &)
std::string get_value(Xapian::valueno slot) const
Get value by number.
A handle representing a document in a Xapian database.
Xapian::valueno get_valueno() const
Return the value slot number for the current position.
void skip_to(Xapian::docid docid_or_slot)
Advance the iterator to document id or value slot docid_or_slot.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.
void next(double min_wt)
Advance the current position to the next matching document.