45 #ifdef HAVE_SOCKETPAIR
59 #if !defined __WIN32__ && !defined __CYGWIN__ && !defined __OS2__
60 mode_t old_umask = umask(022);
68 TEST(stat(path.c_str(), &statbuf) == 0);
93 for (
int i = 0; i != 20; ++i) {
118 SKIP_TEST(
"Not supported with 32-bit docid currently");
147 bool multi = (db1.
size() > 1);
149 doc = i.get_document();
177 get_dbtype().find(
"remote") == string::npos) {
220 get_dbtype().find(
"remote") == string::npos) {
294 #if !defined __WIN32__ && !defined __CYGWIN__ && !defined __OS2__
295 int old_stdin = dup(0);
296 int old_stdout = dup(1);
338 int fd =
::open((path +
"/flintlock").c_str(), O_RDONLY);
368 SKIP_TEST(
"Database::locked() not supported on this platform");
370 db_as_database = rdb;
374 db_as_database.
close();
439 auto wdb = rdb.
lock());
457 SKIP_TEST(
"Database::locked() not supported on this platform");
469 db_as_database.
lock());
474 auto wdb = rdb.
lock();
510 mset = enquire.
get_mset(0, 10, NULL, &mdecider));
540 for (
int i = 0; i < 10000; ++i) {
616 for (
int i = 0; i < N; ++i) {
631 FAIL_TEST(
"Expected DatabaseModifiedError wasn't thrown");
639 FAIL_TEST(
"Expected DatabaseModifiedError wasn't thrown");
651 for (
int i = 100; i < 120; ++i) {
655 for (
int j = 0; j < 50; ++j) {
664 for (
int k = 0; k < 1000; ++k) {
669 SKIP_TEST(
"didn't manage to trigger DatabaseModifiedError");
676 const char * value0 =
677 "ABBCDEFGHIJKLMMNOPQQRSTTUUVVWXYZZaabcdefghhijjkllmnopqrsttuvwxyz";
678 const char * value1 =
679 "EMLEMMMMMMMNMMLMELEDNLEDMLMLDMLMLMLMEDGFHPOPBAHJIQJNGRKCGF";
726 const char * value0 =
"AAABCDEEFGHIIJJKLLMNNOOPPQQRSTTUVWXYZ";
727 const char * value1 =
"MLEMNMLMLMEDEDEMLEMLMLMLPOAHGF";
774 for (
int n = 1; n != 50; ++n) {
776 for (
int i = 1; i != 50; ++i) {
802 const char *
p =
"VJ=QC]LUNTaARLI;715RR^];A4O=P4ZG<2CS4EM^^VS[A6QENR";
803 for (
int d = 0;
p[d]; ++d) {
804 int l = int(
p[d] -
'0');
806 for (
int n = 1; n < l; ++n) {
808 if (n % (d + 1) == 0) {
825 for (
unsigned int i = 1; i < msetall.
size(); ++i) {
837 std::vector<Xapian::Query> q;
848 for (
unsigned int i = 1; i < msetall.
size(); ++i) {
857 static const unsigned t1[] = {2, 4, 6, 8, 10};
858 static const unsigned t2[] = {6, 7, 8, 11, 12, 13, 14, 15, 16, 17};
859 static const unsigned t3[] = {3, 7, 8, 11, 12, 13, 14, 15, 16, 17};
861 for (
unsigned i = 1; i <= 17; ++i) {
865 for (
unsigned i : t1) {
870 for (
unsigned i : t2) {
879 for (
unsigned i : t3) {
904 tout <<
"Checking q2 OR q3\n";
909 tout <<
"Checking q2l OR q3\n";
914 tout <<
"Checking q2 OR q3l\n";
919 tout <<
"Checking v2 OR q3\n";
924 tout <<
"Checking q2 OR v3\n";
976 static const char *
const phrase_words[] = {
"phrase",
"near" };
994 mset = enquire.
get_mset(0xfffffff0, 1);
997 mset = enquire.
get_mset(1, 0xfffffff0);
1055 static const char* terms[] = {
"two",
"all",
"paragraph",
"banana"};
1057 for (
auto& test :
tests) {
1060 tout << op <<
" should give " << hits <<
" hits\n";
1094 static const struct {
Xapian::docid did;
double wt; } expected[] = {
1095 { 2, 1.2058248004573934864 },
1096 { 4, 0.81127876655507624726 },
1097 { 1, 0.17309550762546158098 },
1098 { 3, 0.14609528172558261527 }
1112 static const struct {
Xapian::docid did;
double wt; } expected2[] = {
1113 { 6, 0.73354729848273669823 },
1114 { 2, 0.45626501034348893038 }
1117 TEST_EQUAL(mset.
size(),
sizeof(expected2) /
sizeof(expected2[0]));
1159 mkdir(db_dir.c_str(), 0755);
1160 db_dir +=
"/db__blocksize1";
1167 static const int bad_sizes[] = {
1168 65537, 8000, 2000, 1024, 16, 7, 3, 1, 0
1170 for (
int block_size : bad_sizes) {
1184 mkdir(db_dir.c_str(), 0755);
1185 db_dir +=
"/db__notermlist1";
1205 for (
int i = 100; i < 120; ++i) {
1210 for (
int j = 0; j < 50; ++j) {
1215 for (
int k = 0; k < 1000; ++k) {
1227 #if !defined __WIN32__ && !defined __CYGWIN__ && !defined __OS2__
1230 (void)chmod(path.c_str(), 0700);
1231 mkdir(path.c_str(), 0777);
1232 mkdir((path +
"/sub").c_str(), 0777);
1234 TEST(chmod(path.c_str(), 0500) == 0);
1244 (void)chmod(path.c_str(), 0700);
1247 TEST(chmod(path.c_str(), 0700) == 0);
1266 static const char *
const qterms[] = {
"katrina",
"hurricane" };
1272 static const char *
const qterms2[] = {
"hurricane",
"katrina" };
1283 #if defined HAVE_FORK && defined HAVE_SOCKETPAIR
1285 if (socketpair(AF_UNIX, SOCK_STREAM|
SOCK_CLOEXEC, PF_UNSPEC, fds) < 0) {
1288 if (fds[1] >= FD_SETSIZE)
1289 SKIP_TEST(
"socketpair() gave fd >= FD_SETSIZE");
1290 if (fcntl(fds[1], F_SETFL, O_NONBLOCK) < 0)
1291 FAIL_TEST(
"fcntl() failed to set O_NONBLOCK");
1292 pid_t child = fork();
1298 while (read(fds[0], &ch, 1) < 0) { }
1303 if (write(fds[0],
"y", 1)) { }
1305 if (write(fds[0],
"l", 1)) { }
1308 if (write(fds[0], m.data(), m.size())) { }
1310 if (write(fds[0],
"o", 1)) { }
1318 if (write(fds[1],
"", 1) != 1)
1319 FAIL_TEST(
"Failed to signal to child process");
1322 int r = read(fds[1], result,
sizeof(result));
1324 if (errno == EAGAIN) {
1333 }
else if (r >= 1) {
1334 if (result[0] ==
'y') {
1347 kill(child, SIGKILL);
1349 while (waitpid(child, &status, 0) < 0) {
1350 if (errno != EINTR)
break;
1355 if (result[0] ==
'y') {
1362 FD_SET(fds[1], &fdset);
1363 int sr = select(fds[1] + 1, &fdset, NULL, NULL, &tv);
1368 }
else if (sr == -1) {
1369 if (errno == EINTR || errno == EAGAIN)
1371 tout <<
"select() failed with errno=" << errno <<
": "
1376 r = read(fds[1], result,
sizeof(result));
1379 tout <<
"read() failed with errno=" << errno <<
": "
1383 }
else if (r == 0) {
1393 kill(child, SIGKILL);
1395 while (waitpid(child, &status, 0) < 0) {
1396 if (errno != EINTR)
break;
1399 tout << string(result, r) <<
'\n';
1406 #if !defined __WIN32__ && !defined __CYGWIN__ && !defined __OS2__
1408 for (
int i = 0; i < 3; ++i) {
1412 for (
int j = 0; j < 3; ++j) {
1414 TEST_REL(lseek(j, 0, SEEK_CUR), <, 0);
1423 for (
int fd = 0; fd < 3; ++fd) {
1427 int flags = fcntl(fd, F_GETFL);
1430 }
else if ((flags & O_ACCMODE) != O_RDWR) {
1436 TEST(S_ISSOCK(sb.st_mode));
1445 for (
int j = 0; j < 3; ++j) {
1452 for (
int j = 0; j < 3; ++j) {
1467 for (
int repeat = 0; repeat < 10; ++repeat) {
1469 tout <<
"iteration #" << repeat <<
'\n';
1471 const int ITEMS = 10;
1473 int offset = max(free_id, ITEMS * 2) - (ITEMS * 2);
1474 int limit = offset + (ITEMS * 2);
1476 mset = enq.
get_mset(offset, limit);
1478 (void)m1.get_document().get_value(0);
1481 for (
int i = free_id; i <= free_id + ITEMS; ++i) {
1483 const string &
id =
str(i);
1484 string qterm =
"Q" + id;
1492 mset = enq.
get_mset(offset, limit);
1494 (void)m2.get_document().get_value(0);
1513 TEST(old_key <= key);
1528 off_t offset = 1234;
1532 const string & tmp_path = db_path +
"-embedded";
1533 ofstream out(tmp_path, fstream::trunc|fstream::binary);
1535 out << ifstream(db_path, fstream::binary).rdbuf();
1540 lseek(fd, offset, SEEK_SET);
1547 lseek(fd, offset, SEEK_SET);
1548 size_t check_errors =
1559 static const char *
const words[4] = {
1560 "blank",
"test",
"paragraph",
"banana"
1571 static const char *
const words2[4] = {
1572 "queri",
"test",
"paragraph",
"word"
1681 static const char*
const terms1[] = {
"foo",
"baz" };
1682 static const char*
const terms2[] = {
"baz",
"foo" };
1686 begin(terms1), end(terms1), 10));
1690 begin(terms2), end(terms2), 10));
1694 begin(terms1), end(terms1), 10));
1698 begin(terms2), end(terms2), 10));
1703 begin(terms1), end(terms1), 2));
1707 begin(terms2), end(terms2), 2));
1757 size_t check_errors =
1784 if (expect % 20 == 15) expect += 5;
1821 "and yet anoth this one doe mention banana split "
1822 "though so cant be that bad");
1855 auto p = postit.positionlist_begin();
1870 auto p = postit.positionlist_begin();
1887 const unsigned MAX_LEN = 300;
1889 term.reserve(MAX_LEN);
1890 while (
term.size() < MAX_LEN) {
1893 TEST_EQUAL(enquire.get_mset(0, 10).size(), 0);
1937 for (
int reuse_options : { 0, 1,
1938 #ifdef SO_EXCLUSIVEADDRUSE
1942 tout <<
"reuse_options = " << reuse_options <<
'\n';
1945 for (
auto&& r :
Resolver(
"127.0.0.1", port, AI_PASSIVE)) {
1947 int fd = socket(r.ai_family, socktype, r.ai_protocol);
1951 if (reuse_options == 1) {
1956 int retval = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
1957 reinterpret_cast<char*
>(&on),
1963 FAIL_TEST(
"setsockopt SO_REUSEADDR failed " +
1966 #ifdef SO_EXCLUSIVEADDRUSE
1967 }
else if (reuse_options == 2) {
1969 int retval = setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
1970 reinterpret_cast<char*
>(&on),
1976 FAIL_TEST(
"setsockopt SO_EXCLUSIVEADDRUSE failed " +
1982 if (::bind(fd, r.ai_addr, r.ai_addrlen) == 0) {
1990 if (bind_errno == 0)
1996 if (socketfd >= 0) {
1998 FAIL_TEST(
"Managed to bind to TCP port used by xapian-tcpsrv");
2003 if (bind_errno == WSAEACCES) bind_errno = EADDRINUSE;
2006 if (bind_errno != EADDRINUSE) {
2007 FAIL_TEST(
"bind() failed with unexpected error: " +
2015 mkdir(
".stub", 0755);
2016 const char* stubpath =
".stub/unsupportedcheck1";
2017 ofstream out(stubpath);
2018 TEST(out.is_open());
2025 FAIL_TEST(
"Managed to check remote stub");
2026 #ifdef XAPIAN_HAS_REMOTE_BACKEND
2030 "Remote database checking not implemented");
2039 mkdir(
".stub", 0755);
2040 const char* stubpath =
".stub/unsupportedcheck2";
2041 ofstream out(stubpath);
2042 TEST(out.is_open());
2043 out <<
"inmemory\n";
2068 for (
int n =
'1'; n <=
'4'; ++n) {
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
static void make_xordecay1_db(Xapian::WritableDatabase &db, const string &)
DEFINE_TESTCASE(lockfileumask1, glass)
Regression test - lockfile should honour umask, was only user-readable.
static void make_msize2_db(Xapian::WritableDatabase &db, const string &)
static void make_msize1_db(Xapian::WritableDatabase &db, const string &)
static void make_phrasebug1_db(Xapian::WritableDatabase &db, const string &)
static void make_ordecay_db(Xapian::WritableDatabase &db, const string &)
static void gen_uniqterms_gt_doclen_db(Xapian::WritableDatabase &db, const string &)
static void make_orcheck_db(Xapian::WritableDatabase &db, const string &)
Xapian::Database get_writable_database_as_database()
string get_database_path(const string &dbname)
Xapian::WritableDatabase get_writable_database(const string &dbname)
std::string get_named_writable_database_path(const std::string &name)
Xapian::WritableDatabase get_writable_database_again()
Xapian::Database get_database(const string &dbname)
Xapian::WritableDatabase get_named_writable_database(const std::string &name, const std::string &source)
Xapian::Database get_remote_database(const string &dbname, unsigned int timeout, int *port_ptr)
test functionality of the Xapian API
#define SKIP_TEST_FOR_BACKEND(B)
Base class for backend handling in test harness.
static const char * get_xapian_progsrv_command()
Get the command line required to run xapian-progsrv.
bool operator()(const Xapian::Document &) const override
Decide whether to accept a document.
Class implementing a "boolean" weighting scheme.
Indicates an attempt to access a closed database.
DatabaseCorruptError indicates database corruption was detected.
DatabaseLockError indicates failure to lock a database.
DatabaseModifiedError indicates a database was modified.
Indicates an attempt to access a database not present.
DatabaseOpeningError indicates failure to open a database.
An indexed database of documents.
Xapian::rev get_revision() const
Get the revision of the database.
ValueIterator valuestream_begin(Xapian::valueno slot) const
Return an iterator over the value in slot slot for each document.
Xapian::doccount get_termfreq(std::string_view term) const
Get the number of documents indexed by a specified term.
Xapian::termcount get_unique_terms_lower_bound() const
Get a lower bound on the unique terms size of a document in this DB.
static size_t check(std::string_view path, int opts=0, std::ostream *out=NULL)
Check the integrity of a database or database table.
void close()
Close the database.
Xapian::totallength get_total_length() const
Get the total length of all the documents in the database.
PositionIterator positionlist_end(Xapian::docid, std::string_view) const noexcept
End iterator corresponding to positionlist_begin().
Xapian::WritableDatabase lock(int flags=0)
Lock a read-only database for writing.
Xapian::termcount get_doclength_lower_bound() const
Get a lower bound on the length of a document in this DB.
PostingIterator postlist_begin(std::string_view term) const
Start iterating the postings of a term.
std::string reconstruct_text(Xapian::docid did, size_t length=0, std::string_view prefix={}, Xapian::termpos start_pos=0, Xapian::termpos end_pos=0) const
Reconstruct document text.
bool locked() const
Test if this database is currently locked for writing.
TermIterator termlist_begin(Xapian::docid did) const
Start iterating the terms in a document.
double get_avlength() const
Old name for get_average_length() for backward compatibility.
Xapian::termcount get_wdf_upper_bound(std::string_view term) const
Get an upper bound on the wdf of term term.
PositionIterator positionlist_begin(Xapian::docid did, std::string_view term) const
Start iterating positions for a term in a document.
size_t size() const
Return number of shards in this Database object.
void add_database(const Database &other)
Add shards from another Database.
Xapian::termcount get_doclength(Xapian::docid did) const
Get the length of a specified document.
Xapian::termcount get_unique_terms_upper_bound() const
Get an upper bound on the unique terms size of a document in this DB.
TermIterator allterms_end(std::string_view={}) const noexcept
End iterator corresponding to allterms_begin(prefix).
Xapian::termcount get_collection_freq(std::string_view term) const
Get the total number of occurrences of a specified term.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
PostingIterator postlist_end(std::string_view) const noexcept
End iterator corresponding to postlist_begin().
TermIterator termlist_end(Xapian::docid) const noexcept
End iterator corresponding to termlist_begin().
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
TermIterator allterms_begin(std::string_view prefix={}) const
Start iterating all terms in the database with a given prefix.
ValueIterator valuestream_end(Xapian::valueno) const noexcept
Return end iterator corresponding to valuestream_begin().
bool reopen()
Reopen the database at the latest available revision.
Xapian::termcount get_doclength_upper_bound() const
Get an upper bound on the length of a document in this DB.
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Xapian::Database unlock()
Release a database write lock.
Xapian::termcount get_unique_terms(Xapian::docid did) const
Get the number of unique terms in a specified document.
Indicates an attempt to access a document not present in the database.
Class representing a document.
void add_boolean_term(std::string_view term)
Add a boolean filter term to the document.
Xapian::docid get_docid() const
Get the document ID this document came from.
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.
std::string get_value(Xapian::valueno slot) const
Read a value slot in this document.
Xapian::termcount termlist_count() const
Return the number of distinct terms in this document.
void clear_terms()
Clear all terms from the document.
void add_value(Xapian::valueno slot, std::string_view value)
Add a value to a slot in this document.
void add_posting(std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_inc=1)
Add a posting for a term.
void set_weighting_scheme(const Weight &weight)
Set the weighting scheme to use.
MSet get_mset(doccount first, doccount maxitems, doccount checkatleast=0, const RSet *rset=NULL, const MatchDecider *mdecider=NULL) const
Run the query.
void set_query(const Query &query, termcount query_length=0)
Set the query.
void set_sort_by_value(valueno sort_key, bool reverse)
Set the sorting to be by value only.
const Query & get_query() const
Get the currently set query.
void set_collapse_key(valueno collapse_key, doccount collapse_max=1)
Control collapsing of results.
All exceptions thrown by Xapian are subclasses of Xapian::Error.
const char * get_error_string() const
Returns any system error string associated with this exception.
const std::string & get_msg() const noexcept
Message giving details of the error, intended for human consumption.
std::string get_description() const
Return a string describing this object.
Indicates an attempt to use a feature which is unavailable.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Iterator over a Xapian::MSet.
Class representing a list of search results.
Xapian::doccount size() const
Return number of items in this MSet object.
Xapian::doccount get_firstitem() const
Rank of first item in this MSet.
Xapian::doccount get_matches_upper_bound() const
Upper bound on the total number of matching documents.
MSetIterator begin() const
Return iterator pointing to the first item in this MSet.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
MSetIterator end() const
Return iterator pointing to just after the last item in this MSet.
Xapian::doccount get_matches_estimated() const
Estimate of the total number of matching documents.
Abstract base class for match deciders.
virtual bool skip_to(Xapian::termpos termpos)=0
Skip forward to the specified position.
Class for iterating over term positions.
void skip_to(Xapian::termpos termpos)
Advance the iterator to term position termpos.
Class for iterating over a list of terms.
Build a Xapian::Query object from a user query string.
void set_database(const Database &db)
Specify the database being searched.
Query parse_query(std::string_view query_string, unsigned flags=FLAG_DEFAULT, std::string_view default_prefix={})
Parse a query.
@ FLAG_PARTIAL
Enable partial matching.
Class representing a query.
std::string get_description() const
Return a string describing this object.
@ OP_MAX
Pick the maximum weight of any subquery.
@ OP_VALUE_RANGE
Match only documents where a value slot is within a given range.
@ OP_WILDCARD
Wildcard expansion.
@ OP_XOR
Match documents which an odd number of subqueries match.
@ OP_AND_MAYBE
Match the first subquery taking extra weight from other subqueries.
@ OP_NEAR
Match only documents where all subqueries match near each other.
@ OP_ELITE_SET
Pick the best N subqueries and combine with OP_OR.
@ OP_AND
Match only documents which all subqueries match.
@ OP_OR
Match documents which at least one subquery matches.
@ OP_FILTER
Match like OP_AND but only taking weight from the first subquery.
@ OP_PHRASE
Match only documents where all subqueries match near and in order.
@ OP_SYNONYM
Match like OP_OR but weighting as if a single term.
@ OP_AND_NOT
Match documents which the first subquery matches but no others do.
static const Xapian::Query MatchNothing
A query matching no documents.
static const Xapian::Query MatchAll
A query matching all documents.
Class for iterating over a list of terms.
void skip_to(std::string_view term)
Advance the iterator to term term.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
UnimplementedError indicates an attempt to use an unimplemented feature.
Class for iterating over document values.
bool check(Xapian::docid docid)
Check if the specified docid occurs.
void skip_to(Xapian::docid docid_or_slot)
Advance the iterator to document id or value slot docid_or_slot.
This class provides read/write access to a database.
void delete_document(Xapian::docid did)
Delete a document from the database.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a document in the database.
void set_metadata(std::string_view key, std::string_view metadata)
Set the user-specified metadata associated with a given key.
void commit()
Commit pending modifications.
Xapian::docid add_document(const Xapian::Document &doc)
Add a document to the database.
static std::string get_srcdir()
Read srcdir from environment and if not present, make a valiant attempt to guess a value.
void errno_to_string(int e, string &s)
Convert errno value to std::string, thread-safe if possible.
Utility functions for testing files.
bool file_exists(const char *path)
Test if a file exists.
static const test_desc tests[]
The lists of tests to perform.
string str(int value)
Convert int to std::string.
Database open(std::string_view host, unsigned int port, unsigned timeout=10000, unsigned connect_timeout=10000)
Construct a Database object for read-only access to a remote database accessed via a TCP connection.
const int DB_CREATE
Create a new database.
const int DBCHECK_SHOW_STATS
Show statistics for the B-tree.
const int DB_RETRY_LOCK
If the database is already locked, retry the lock.
const int DB_CREATE_OR_OPEN
Create database if it doesn't already exist.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
const int DB_BACKEND_STUB
Open a stub database file.
const int DOC_ASSUME_VALID
Assume document id is valid.
const int DB_OPEN
Open an existing database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
const int DB_NO_TERMLIST
When creating a database, don't create a termlist table.
const int DB_BACKEND_GLASS
Use the glass backend.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Resolve hostnames and ip addresses.
include <fcntl.h>, but working around broken platforms.
include <netdb.h>, with portability workarounds.
include <sys/socket.h> with portability workarounds.
include <sys/stat.h> with portability enhancements
include <sys/wait.h>, with portability stuff.
<unistd.h>, but with compat.
Socket handling utilities.
Convert types to std::string.
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
Run multiple tests for different backends.
std::ostringstream tout
The debug printing stream.
a generic test suite engine
#define FAIL_TEST(MSG)
Fail the current testcase with message MSG.
#define SKIP_TEST(MSG)
Skip the current testcase with message MSG.
#define TEST_EQUAL(a, b)
Test for equality of two things.
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
#define TEST_EQUAL_DOUBLE(a, b)
Test two doubles for near equality.
#define TEST(a)
Test a condition, without an additional explanation for failure.
#define TEST_NOT_EQUAL(a, b)
Test for non-equality of two things.
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)
bool mset_range_is_same(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
Xapian-specific test helper functions and macros.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
#define TEST_EXCEPTION3(TYPE, CODE, FAIL_TO_THROW_ACTION)
Check that CODE throws exactly Xapian exception TYPE.
void rm_rf(const string &filename)
Remove a directory and contents, just like the Unix "rm -rf" command.
C++ function versions of useful Unix commands.
Public interfaces for the Xapian library.