xapian-core  1.4.26
Functions
api_wrdb.cc File Reference

tests which need a writable backend More...

#include <config.h>
#include "api_wrdb.h"
#include <xapian.h>
#include "filetests.h"
#include "omassert.h"
#include "str.h"
#include "stringutils.h"
#include "testsuite.h"
#include "testutils.h"
#include "unixcmds.h"
#include "apitest.h"
#include "safeunistd.h"
#include <cmath>
#include <cstdlib>
#include <limits>
#include <map>
#include <string>
+ Include dependency graph for api_wrdb.cc:

Go to the source code of this file.

Functions

 DEFINE_TESTCASE (adddoc1, writable)
 
 DEFINE_TESTCASE (adddoc2, writable)
 
 DEFINE_TESTCASE (adddoc3, writable)
 
 DEFINE_TESTCASE (adddoc4, writable)
 
 DEFINE_TESTCASE (adddoc5, writable)
 
 DEFINE_TESTCASE (adddoc6, writable)
 
 DEFINE_TESTCASE (implicitendsession1, writable)
 
 DEFINE_TESTCASE (databaseassign1, writable)
 
 DEFINE_TESTCASE (deldoc1, writable)
 
 DEFINE_TESTCASE (deldoc2, writable)
 
 DEFINE_TESTCASE (deldoc3, writable)
 
 DEFINE_TESTCASE (deldoc4, writable)
 
 DEFINE_TESTCASE (deldoc5, writable)
 
 DEFINE_TESTCASE (deldoc6, writable)
 
 DEFINE_TESTCASE (replacedoc1, writable)
 
 DEFINE_TESTCASE (replacedoc2, writable)
 
 DEFINE_TESTCASE (replacedoc3, writable)
 
 DEFINE_TESTCASE (replacedoc4, writable)
 
 DEFINE_TESTCASE (replacedoc5, writable)
 
 DEFINE_TESTCASE (replacedoc6, writable)
 
 DEFINE_TESTCASE (uniqueterm1, writable)
 
 DEFINE_TESTCASE (allpostlist2, writable)
 
static void test_emptyterm2_helper (Xapian::WritableDatabase &db)
 
 DEFINE_TESTCASE (emptyterm2, writable)
 
 DEFINE_TESTCASE (phraseorneartoand1, backend)
 
static void gen_longpositionlist1_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (longpositionlist1, backend)
 
static void gen_consistency2_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (consistency2, backend)
 
 DEFINE_TESTCASE (crashrecovery1, chert)
 
 DEFINE_TESTCASE (nomoredocids1, writable)
 
 DEFINE_TESTCASE (synonymitor1, writable &&synonyms)
 
 DEFINE_TESTCASE (termtoolong1, writable)
 
 DEFINE_TESTCASE (postlist7, writable)
 Test playing with a postlist. More...
 
static void gen_lazytablebug1_db (Xapian::WritableDatabase &db, const string &)
 
 DEFINE_TESTCASE (lazytablebug1, synonyms)
 
 DEFINE_TESTCASE (cursordelbug1, writable &&path)
 Regression test for bug #287 for flint. More...
 
static void check_vals (const Xapian::Database &db, const map< Xapian::docid, string > &vals)
 Helper function for modifyvalues1. More...
 
 DEFINE_TESTCASE (modifyvalues1, writable)
 Regression test for bug in initial streaming values implementation in chert. More...
 
 DEFINE_TESTCASE (protocolbug1, remote &&writable)
 Regression test for protocol design bug. More...
 
 DEFINE_TESTCASE (remotefdleak1, remote &&writable)
 

Detailed Description

tests which need a writable backend

Definition in file api_wrdb.cc.

Function Documentation

◆ check_vals()

static void check_vals ( const Xapian::Database db,
const map< Xapian::docid, string > &  vals 
)
static

◆ DEFINE_TESTCASE() [1/36]

DEFINE_TESTCASE ( adddoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [2/36]

DEFINE_TESTCASE ( adddoc2  ,
writable   
)

◆ DEFINE_TESTCASE() [3/36]

DEFINE_TESTCASE ( adddoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [4/36]

DEFINE_TESTCASE ( adddoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [5/36]

DEFINE_TESTCASE ( adddoc5  ,
writable   
)

◆ DEFINE_TESTCASE() [6/36]

DEFINE_TESTCASE ( adddoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [7/36]

DEFINE_TESTCASE ( implicitendsession1  ,
writable   
)

◆ DEFINE_TESTCASE() [8/36]

DEFINE_TESTCASE ( databaseassign1  ,
writable   
)

Definition at line 536 of file api_wrdb.cc.

References get_database(), and get_writable_database().

◆ DEFINE_TESTCASE() [9/36]

DEFINE_TESTCASE ( deldoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [10/36]

DEFINE_TESTCASE ( deldoc2  ,
writable   
)

◆ DEFINE_TESTCASE() [11/36]

DEFINE_TESTCASE ( deldoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [12/36]

DEFINE_TESTCASE ( deldoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [13/36]

DEFINE_TESTCASE ( deldoc5  ,
writable   
)

◆ DEFINE_TESTCASE() [14/36]

DEFINE_TESTCASE ( deldoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [15/36]

DEFINE_TESTCASE ( replacedoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [16/36]

DEFINE_TESTCASE ( replacedoc2  ,
writable   
)

◆ DEFINE_TESTCASE() [17/36]

DEFINE_TESTCASE ( replacedoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [18/36]

DEFINE_TESTCASE ( replacedoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [19/36]

DEFINE_TESTCASE ( replacedoc5  ,
writable   
)

◆ DEFINE_TESTCASE() [20/36]

DEFINE_TESTCASE ( replacedoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [21/36]

DEFINE_TESTCASE ( uniqueterm1  ,
writable   
)

◆ DEFINE_TESTCASE() [22/36]

DEFINE_TESTCASE ( allpostlist2  ,
writable   
)

◆ DEFINE_TESTCASE() [23/36]

DEFINE_TESTCASE ( emptyterm2  ,
writable   
)

◆ DEFINE_TESTCASE() [24/36]

DEFINE_TESTCASE ( phraseorneartoand1  ,
backend   
)

◆ DEFINE_TESTCASE() [25/36]

DEFINE_TESTCASE ( longpositionlist1  ,
backend   
)

◆ DEFINE_TESTCASE() [26/36]

DEFINE_TESTCASE ( consistency2  ,
backend   
)

◆ DEFINE_TESTCASE() [27/36]

DEFINE_TESTCASE ( crashrecovery1  ,
chert   
)

◆ DEFINE_TESTCASE() [28/36]

DEFINE_TESTCASE ( nomoredocids1  ,
writable   
)

◆ DEFINE_TESTCASE() [29/36]

DEFINE_TESTCASE ( synonymitor1  ,
writable &&  synonyms 
)

◆ DEFINE_TESTCASE() [30/36]

DEFINE_TESTCASE ( termtoolong1  ,
writable   
)

◆ DEFINE_TESTCASE() [31/36]

DEFINE_TESTCASE ( postlist7  ,
writable   
)

◆ DEFINE_TESTCASE() [32/36]

DEFINE_TESTCASE ( lazytablebug1  ,
synonyms   
)

◆ DEFINE_TESTCASE() [33/36]

DEFINE_TESTCASE ( cursordelbug1  ,
writable &&  path 
)

◆ DEFINE_TESTCASE() [34/36]

DEFINE_TESTCASE ( modifyvalues1  ,
writable   
)

◆ DEFINE_TESTCASE() [35/36]

DEFINE_TESTCASE ( protocolbug1  ,
remote &&  writable 
)

Regression test for protocol design bug.

Previously some messages didn't send a reply but could result in an exception being sent over the link. That exception would then get read as a response to the next message instead of its actual response so we'd be out of step.

This also affected MSG_DELETEDOCUMENTTERM, MSG_CANCEL, MSG_SETMETADATA and MSG_ADDSPELLING but it's harder to reliably trigger an exception from any of those.

See #783. Fixed in 1.4.12.

Definition at line 2098 of file api_wrdb.cc.

References Xapian::Document::add_term(), Xapian::WritableDatabase::commit(), get_writable_database(), Xapian::WritableDatabase::replace_document(), and TEST_EXCEPTION.

◆ DEFINE_TESTCASE() [36/36]

DEFINE_TESTCASE ( remotefdleak1  ,
remote &&  writable 
)

◆ gen_consistency2_db()

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

◆ gen_lazytablebug1_db()

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

◆ gen_longpositionlist1_db()

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

◆ test_emptyterm2_helper()

static void test_emptyterm2_helper ( Xapian::WritableDatabase db)
static