tests/api_backend.cc File Reference

Backend-related tests. More...

#include <config.h>
#include "api_backend.h"
#include <xapian.h>
#include "str.h"
#include "testsuite.h"
#include "testutils.h"
#include "utils.h"
#include "apitest.h"
#include "safeunistd.h"

Include dependency graph for api_backend.cc:

Go to the source code of this file.

Classes

struct  MyMatchDecider

Defines

#define XAPIAN_DEPRECATED(X)   X

Functions

 DEFINE_TESTCASE (lockfileumask1, brass||chert||flint)
 Regression test - lockfile should honour umask, was only user-readable.
 DEFINE_TESTCASE (totaldoclen1, writable)
 Check that the backend handles total document length > 0xffffffff.
 DEFINE_TESTCASE (dbstats1, backend)
 DEFINE_TESTCASE (alldocspl3, backend)
 Check handling of alldocs on an empty database.
 DEFINE_TESTCASE (modifiedpostlist1, writable)
 Regression test for bug#392 in ModifiedPostList iteration, fixed in 1.0.15.
 DEFINE_TESTCASE (doclenaftercommit1, writable)
 Regression test for chert bug fixed in 1.1.3 (ticket#397).
 DEFINE_TESTCASE (valuesaftercommit1, writable)
 DEFINE_TESTCASE (lockfilefd0or1, brass||chert||flint)
 DEFINE_TESTCASE (matchdecider4, remote)
 Test Xapian::MatchDecider with remote backend fails.
 DEFINE_TESTCASE (replacedoc7, writable &&!inmemory &&!remote)
 Check that replacing an unmodified document doesn't increase the automatic flush counter.
 DEFINE_TESTCASE (replacedoc8, writable)
 Check that replacing a document deleted since the last flush works.
 DEFINE_TESTCASE (databasemodified1, writable &&!inmemory &&!remote)
 Test coverage for DatabaseModifiedError.
 DEFINE_TESTCASE (qpmemoryleak1, writable &&!inmemory)
 Regression test for bug#462 fixed in 1.0.19 and 1.1.5.
static void make_msize1_db (Xapian::WritableDatabase &db, const string &)
 DEFINE_TESTCASE (msize1, generated)
 Regression test for ticket#464, fixed in 1.1.6 and 1.0.20.
static void make_msize2_db (Xapian::WritableDatabase &db, const string &)
 DEFINE_TESTCASE (msize2, generated)
 Regression test for bug related to ticket#464, fixed in 1.1.6 and 1.0.20.
static void make_xordecay1_db (Xapian::WritableDatabase &db, const string &)
 DEFINE_TESTCASE (xordecay1, generated)
 Regression test for bug in decay of XOR, fixed in 1.2.1 and 1.0.21.
static void make_ordecay_db (Xapian::WritableDatabase &db, const string &)
 DEFINE_TESTCASE (ordecay1, generated)
 Regression test for bug in decay of OR to AND, fixed in 1.2.1 and 1.0.21.
 DEFINE_TESTCASE (ordecay2, generated)
 Regression test for bug in decay of OR to AND_MAYBE, fixed in 1.2.1 and 1.0.21.
static void make_orcheck_db (Xapian::WritableDatabase &db, const string &)
 DEFINE_TESTCASE (orcheck1, generated)
 Regression test for bugs in the check() method of OrPostList.
 DEFINE_TESTCASE (failedreplace1, brass||chert||flint)
 Regression test for bug fixed in 1.2.1 and 1.0.21.
 DEFINE_TESTCASE (failedreplace2, brass||chert||flint)
 DEFINE_TESTCASE (phrase3, positional)
 Coverage for SelectPostList::skip_to().
 DEFINE_TESTCASE (msetfirst2, backend)
 Check that get_mset(<large number>, 10) doesn't exhaust memory needlessly.
 DEFINE_TESTCASE (bm25weight2, backend)
 DEFINE_TESTCASE (tradweight2, backend)


Detailed Description

Backend-related tests.

Definition in file api_backend.cc.


Define Documentation

#define XAPIAN_DEPRECATED (  )     X

Definition at line 27 of file api_backend.cc.


Function Documentation

DEFINE_TESTCASE ( tradweight2  ,
backend   
)

DEFINE_TESTCASE ( bm25weight2  ,
backend   
)

DEFINE_TESTCASE ( msetfirst2  ,
backend   
)

Check that get_mset(<large number>, 10) doesn't exhaust memory needlessly.

Definition at line 707 of file api_backend.cc.

References get_database(), Xapian::MSet::get_firstitem(), Xapian::Enquire::get_mset(), Xapian::Query::MatchNothing, Xapian::Enquire::set_query(), and TEST_EQUAL.

DEFINE_TESTCASE ( phrase3  ,
positional   
)

DEFINE_TESTCASE ( failedreplace2  ,
brass||chert||  flint 
)

DEFINE_TESTCASE ( failedreplace1  ,
brass||chert||  flint 
)

DEFINE_TESTCASE ( orcheck1  ,
generated   
)

Regression test for bugs in the check() method of OrPostList.

(ticket #485) Bugs introduced and fixed between 1.2.0 and 1.2.1 (never in a release).

Definition at line 608 of file api_backend.cc.

References get_database(), Xapian::Database::get_doccount(), Xapian::Enquire::get_mset(), make_orcheck_db(), mset_expect_order(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Query::OP_VALUE_RANGE, Xapian::Enquire::set_query(), and tout.

DEFINE_TESTCASE ( ordecay2  ,
generated   
)

DEFINE_TESTCASE ( ordecay1  ,
generated   
)

DEFINE_TESTCASE ( xordecay1  ,
generated   
)

DEFINE_TESTCASE ( msize2  ,
generated   
)

DEFINE_TESTCASE ( msize1  ,
generated   
)

DEFINE_TESTCASE ( qpmemoryleak1  ,
writable &&!  inmemory 
)

DEFINE_TESTCASE ( databasemodified1  ,
writable &&!inmemory &&!  remote 
)

DEFINE_TESTCASE ( replacedoc8  ,
writable   
)

Check that replacing a document deleted since the last flush works.

Prior to 1.1.4/1.0.18, this failed to update the collection frequency and wdf, and caused an assertion failure when assertions were enabled.

Definition at line 285 of file api_backend.cc.

References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::WritableDatabase::delete_document(), Xapian::WritableDatabase::flush(), Xapian::Database::get_collection_freq(), get_writable_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.

DEFINE_TESTCASE ( replacedoc7  ,
writable &&!inmemory &&!  remote 
)

DEFINE_TESTCASE ( matchdecider4  ,
remote   
)

DEFINE_TESTCASE ( lockfilefd0or1  ,
brass||chert||  flint 
)

DEFINE_TESTCASE ( valuesaftercommit1  ,
writable   
)

DEFINE_TESTCASE ( doclenaftercommit1  ,
writable   
)

DEFINE_TESTCASE ( modifiedpostlist1  ,
writable   
)

DEFINE_TESTCASE ( alldocspl3  ,
backend   
)

DEFINE_TESTCASE ( dbstats1  ,
backend   
)

DEFINE_TESTCASE ( totaldoclen1  ,
writable   
)

DEFINE_TESTCASE ( lockfileumask1  ,
brass||chert||  flint 
)

Regression test - lockfile should honour umask, was only user-readable.

Definition at line 42 of file api_backend.cc.

References get_named_writable_database(), get_named_writable_database_path(), stat(), TEST, and TEST_EQUAL.

static void make_msize1_db ( Xapian::WritableDatabase db,
const string &   
) [static]

static void make_msize2_db ( Xapian::WritableDatabase db,
const string &   
) [static]

static void make_orcheck_db ( Xapian::WritableDatabase db,
const string &   
) [static]

static void make_ordecay_db ( Xapian::WritableDatabase db,
const string &   
) [static]

static void make_xordecay1_db ( Xapian::WritableDatabase db,
const string &   
) [static]


Documentation for Xapian (version 1.2.8).
Generated on 14 Dec 2011 by Doxygen 1.5.9.