142 size_t check_errors =
DEFINE_TESTCASE(badtransaction1, transactions)
Test incorrect uses of the transaction API lead to errors.
Xapian::WritableDatabase get_writable_database(const string &dbname)
std::string get_named_writable_database_path(const std::string &name)
Xapian::WritableDatabase get_named_writable_database(const std::string &name, const std::string &source)
test functionality of the Xapian API
Xapian::doccount get_termfreq(std::string_view term) const
Get the number of documents indexed by a specified term.
static size_t check(std::string_view path, int opts=0, std::ostream *out=NULL)
Check the integrity of a database or database table.
std::string get_value_upper_bound(Xapian::valueno slot) const
Get an upper bound on the values stored in the given value slot.
bool term_exists(std::string_view term) const
Test is a particular term is present in any document.
std::string get_value_lower_bound(Xapian::valueno slot) const
Get a lower bound on the values stored in the given value slot.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Xapian::doccount get_value_freq(Xapian::valueno slot) const
Return the frequency of a given value slot.
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Class representing a document.
void set_data(std::string_view data)
Set the document data.
std::string get_data() const
Get the document data.
void add_term(std::string_view term, Xapian::termcount wdf_inc=1)
Add a term to this document.
void add_value(Xapian::valueno slot, std::string_view value)
Add a value to a slot in this document.
InvalidOperationError indicates the API was used in an invalid way.
This class provides read/write access to a database.
void begin_transaction(bool flushed=true)
Begin a transaction.
void commit_transaction()
Complete the transaction currently in progress.
void cancel_transaction()
Abort the transaction currently in progress.
void commit()
Commit pending modifications.
Xapian::docid add_document(const Xapian::Document &doc)
Add a document to the database.
const int DBCHECK_SHOW_STATS
Show statistics for the B-tree.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
std::ostringstream tout
The debug printing stream.
#define TEST_EQUAL(a, b)
Test for equality of two things.
#define TEST(a)
Test a condition, without an additional explanation for failure.
Xapian-specific test helper functions and macros.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
Public interfaces for the Xapian library.