xapian-core  1.4.21
Classes | Macros | Functions
api_db.cc File Reference

tests which need a backend More...

#include <config.h>
#include "api_db.h"
#include <algorithm>
#include <fstream>
#include <map>
#include <string>
#include <vector>
#include "safenetdb.h"
#include "safesysstat.h"
#include "safeunistd.h"
#include <xapian.h>
#include "backendmanager.h"
#include "testsuite.h"
#include "testutils.h"
#include "unixcmds.h"
#include "apitest.h"
+ Include dependency graph for api_db.cc:

Go to the source code of this file.

Classes

class  GrepMatchDecider
 
class  MyWeight
 

Macros

#define EXPECTED_EXCEPTION   Xapian::DatabaseOpeningError
 

Functions

static Xapian::Query query (const string &t)
 
 DEFINE_TESTCASE (termstats, backend)
 
 DEFINE_TESTCASE (stubdb1, path)
 
 DEFINE_TESTCASE (stubdb2, path)
 
 DEFINE_TESTCASE (stubdb3, path)
 
 DEFINE_TESTCASE (stubdb4, !backend)
 
 DEFINE_TESTCASE (stubdb5, path)
 
 DEFINE_TESTCASE (stubdb6, inmemory)
 
 DEFINE_TESTCASE (stubdb8, inmemory)
 Test error running Database::check() on a stub database. More...
 
 DEFINE_TESTCASE (stubdb9, path)
 Test error running Database::check() on a remote stub database. More...
 
 DEFINE_TESTCASE (matchdecider1, backend &&!remote)
 
 DEFINE_TESTCASE (matchdecider2, backend &&!remote)
 
 DEFINE_TESTCASE (matchdecider3, backend &&!remote)
 
 DEFINE_TESTCASE (msetiterator1, backend)
 
 DEFINE_TESTCASE (msetiterator2, backend)
 
 DEFINE_TESTCASE (msetiterator3, backend)
 
 DEFINE_TESTCASE (esetiterator1, backend)
 
 DEFINE_TESTCASE (esetiterator2, backend)
 
 DEFINE_TESTCASE (collapsekey1, backend)
 
 DEFINE_TESTCASE (collapsekey2, backend)
 
 DEFINE_TESTCASE (collapsekey3, backend)
 
 DEFINE_TESTCASE (collapsekey4, backend)
 
 DEFINE_TESTCASE (keepalive1, remote)
 
 DEFINE_TESTCASE (allterms1, backend)
 
 DEFINE_TESTCASE (allterms2, backend)
 
 DEFINE_TESTCASE (allterms3, backend)
 
 DEFINE_TESTCASE (allterms4, backend)
 
 DEFINE_TESTCASE (allterms5, backend)
 
 DEFINE_TESTCASE (allterms6, backend)
 
 DEFINE_TESTCASE (specialterms1, backend)
 
 DEFINE_TESTCASE (specialterms2, backend)
 
 DEFINE_TESTCASE (rsetmultidb2, backend &&!multi)
 
 DEFINE_TESTCASE (multiexpand1, backend &&!multi)
 
 DEFINE_TESTCASE (postlist1, backend)
 
 DEFINE_TESTCASE (postlist2, backend)
 
 DEFINE_TESTCASE (postlist3, backend)
 
 DEFINE_TESTCASE (postlist4, backend)
 
 DEFINE_TESTCASE (postlist5, backend)
 
 DEFINE_TESTCASE (postlist6, backend)
 
 DEFINE_TESTCASE (collfreq1, backend)
 
 DEFINE_TESTCASE (sortvalue1, backend)
 
 DEFINE_TESTCASE (consistency1, backend &&!remote)
 
 DEFINE_TESTCASE (chertdatabasenotfounderror1, chert)
 
 DEFINE_TESTCASE (glassdatabasenotfounderror1, glass)
 
 DEFINE_TESTCASE (databasenotfounderror2, !backend)
 
 DEFINE_TESTCASE (chertdatabaseopen1, chert)
 Test opening of a chert database. More...
 
 DEFINE_TESTCASE (sortrel1, backend)
 
static void make_netstats1_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (netstats1, generated)
 
 DEFINE_TESTCASE (userweight1, backend &&!remote)
 
 DEFINE_TESTCASE (matchall1, backend)
 
 DEFINE_TESTCASE (valuesetmatchdecider2, backend &&!remote)
 

Detailed Description

tests which need a backend

Definition in file api_db.cc.

Macro Definition Documentation

◆ EXPECTED_EXCEPTION

#define EXPECTED_EXCEPTION   Xapian::DatabaseOpeningError

Referenced by DEFINE_TESTCASE().

Function Documentation

◆ DEFINE_TESTCASE() [1/50]

DEFINE_TESTCASE ( termstats  ,
backend   
)

◆ DEFINE_TESTCASE() [2/50]

DEFINE_TESTCASE ( stubdb1  ,
path   
)

◆ DEFINE_TESTCASE() [3/50]

DEFINE_TESTCASE ( stubdb2  ,
path   
)

◆ DEFINE_TESTCASE() [4/50]

DEFINE_TESTCASE ( stubdb3  ,
path   
)

Definition at line 223 of file api_db.cc.

References Xapian::DB_BACKEND_STUB, get_database_path(), TEST, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [5/50]

DEFINE_TESTCASE ( stubdb4  ,
backend 
)

Definition at line 240 of file api_db.cc.

References Xapian::DB_BACKEND_STUB, TEST, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [6/50]

DEFINE_TESTCASE ( stubdb5  ,
path   
)

Definition at line 257 of file api_db.cc.

References Xapian::DB_BACKEND_STUB, get_database_path(), TEST, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [7/50]

DEFINE_TESTCASE ( stubdb6  ,
inmemory   
)

◆ DEFINE_TESTCASE() [8/50]

DEFINE_TESTCASE ( stubdb8  ,
inmemory   
)

Test error running Database::check() on a stub database.

Definition at line 320 of file api_db.cc.

References Xapian::Database::check(), FAIL_TEST, Xapian::Error::get_msg(), TEST, and TEST_STRINGS_EQUAL.

◆ DEFINE_TESTCASE() [9/50]

DEFINE_TESTCASE ( stubdb9  ,
path   
)

◆ DEFINE_TESTCASE() [10/50]

DEFINE_TESTCASE ( matchdecider1  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [11/50]

DEFINE_TESTCASE ( matchdecider2  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [12/50]

DEFINE_TESTCASE ( matchdecider3  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [13/50]

DEFINE_TESTCASE ( msetiterator1  ,
backend   
)

◆ DEFINE_TESTCASE() [14/50]

DEFINE_TESTCASE ( msetiterator2  ,
backend   
)

◆ DEFINE_TESTCASE() [15/50]

DEFINE_TESTCASE ( msetiterator3  ,
backend   
)

◆ DEFINE_TESTCASE() [16/50]

DEFINE_TESTCASE ( esetiterator1  ,
backend   
)

◆ DEFINE_TESTCASE() [17/50]

DEFINE_TESTCASE ( esetiterator2  ,
backend   
)

◆ DEFINE_TESTCASE() [18/50]

DEFINE_TESTCASE ( collapsekey1  ,
backend   
)

◆ DEFINE_TESTCASE() [19/50]

DEFINE_TESTCASE ( collapsekey2  ,
backend   
)

◆ DEFINE_TESTCASE() [20/50]

DEFINE_TESTCASE ( collapsekey3  ,
backend   
)

◆ DEFINE_TESTCASE() [21/50]

DEFINE_TESTCASE ( collapsekey4  ,
backend   
)

◆ DEFINE_TESTCASE() [22/50]

DEFINE_TESTCASE ( keepalive1  ,
remote   
)

◆ DEFINE_TESTCASE() [23/50]

DEFINE_TESTCASE ( allterms1  ,
backend   
)

◆ DEFINE_TESTCASE() [24/50]

DEFINE_TESTCASE ( allterms2  ,
backend   
)

◆ DEFINE_TESTCASE() [25/50]

DEFINE_TESTCASE ( allterms3  ,
backend   
)

◆ DEFINE_TESTCASE() [26/50]

DEFINE_TESTCASE ( allterms4  ,
backend   
)

◆ DEFINE_TESTCASE() [27/50]

DEFINE_TESTCASE ( allterms5  ,
backend   
)

◆ DEFINE_TESTCASE() [28/50]

DEFINE_TESTCASE ( allterms6  ,
backend   
)

◆ DEFINE_TESTCASE() [29/50]

DEFINE_TESTCASE ( specialterms1  ,
backend   
)

◆ DEFINE_TESTCASE() [30/50]

DEFINE_TESTCASE ( specialterms2  ,
backend   
)

◆ DEFINE_TESTCASE() [31/50]

DEFINE_TESTCASE ( rsetmultidb2  ,
backend &&!  multi 
)

◆ DEFINE_TESTCASE() [32/50]

DEFINE_TESTCASE ( multiexpand1  ,
backend &&!  multi 
)

◆ DEFINE_TESTCASE() [33/50]

DEFINE_TESTCASE ( postlist1  ,
backend   
)

◆ DEFINE_TESTCASE() [34/50]

DEFINE_TESTCASE ( postlist2  ,
backend   
)

◆ DEFINE_TESTCASE() [35/50]

DEFINE_TESTCASE ( postlist3  ,
backend   
)

◆ DEFINE_TESTCASE() [36/50]

DEFINE_TESTCASE ( postlist4  ,
backend   
)

◆ DEFINE_TESTCASE() [37/50]

DEFINE_TESTCASE ( postlist5  ,
backend   
)

◆ DEFINE_TESTCASE() [38/50]

DEFINE_TESTCASE ( postlist6  ,
backend   
)

◆ DEFINE_TESTCASE() [39/50]

DEFINE_TESTCASE ( collfreq1  ,
backend   
)

◆ DEFINE_TESTCASE() [40/50]

DEFINE_TESTCASE ( sortvalue1  ,
backend   
)

◆ DEFINE_TESTCASE() [41/50]

DEFINE_TESTCASE ( consistency1  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [42/50]

DEFINE_TESTCASE ( chertdatabasenotfounderror1  ,
chert   
)

◆ DEFINE_TESTCASE() [43/50]

DEFINE_TESTCASE ( glassdatabasenotfounderror1  ,
glass   
)

◆ DEFINE_TESTCASE() [44/50]

DEFINE_TESTCASE ( databasenotfounderror2  ,
backend 
)

Definition at line 1610 of file api_db.cc.

References Xapian::DB_OPEN, and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [45/50]

DEFINE_TESTCASE ( chertdatabaseopen1  ,
chert   
)

◆ DEFINE_TESTCASE() [46/50]

DEFINE_TESTCASE ( sortrel1  ,
backend   
)

◆ DEFINE_TESTCASE() [47/50]

DEFINE_TESTCASE ( netstats1  ,
generated   
)

◆ DEFINE_TESTCASE() [48/50]

DEFINE_TESTCASE ( userweight1  ,
backend &&!  remote 
)

◆ DEFINE_TESTCASE() [49/50]

DEFINE_TESTCASE ( matchall1  ,
backend   
)

◆ DEFINE_TESTCASE() [50/50]

DEFINE_TESTCASE ( valuesetmatchdecider2  ,
backend &&!  remote 
)

◆ make_netstats1_db()

static void make_netstats1_db ( Xapian::WritableDatabase db,
const string &   
)
static

◆ query()

static Xapian::Query query ( const string &  t)
static

Definition at line 50 of file api_db.cc.

Referenced by DEFINE_TESTCASE().