xapian-core  1.4.19
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 <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 &&!multi)
 
 DEFINE_TESTCASE (adddoc3, writable)
 
 DEFINE_TESTCASE (adddoc4, writable)
 
 DEFINE_TESTCASE (adddoc5, writable &&!multi)
 
 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, writable)
 
 DEFINE_TESTCASE (longpositionlist1, writable)
 
 DEFINE_TESTCASE (consistency2, writable)
 
 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...
 
 DEFINE_TESTCASE (lazytablebug1, chert||glass)
 
 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...
 

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/35]

DEFINE_TESTCASE ( adddoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [2/35]

DEFINE_TESTCASE ( adddoc2  ,
writable &&!  multi 
)

◆ DEFINE_TESTCASE() [3/35]

DEFINE_TESTCASE ( adddoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [4/35]

DEFINE_TESTCASE ( adddoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [5/35]

DEFINE_TESTCASE ( adddoc5  ,
writable &&!  multi 
)

◆ DEFINE_TESTCASE() [6/35]

DEFINE_TESTCASE ( adddoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [7/35]

DEFINE_TESTCASE ( implicitendsession1  ,
writable   
)

◆ DEFINE_TESTCASE() [8/35]

DEFINE_TESTCASE ( databaseassign1  ,
writable   
)

Definition at line 512 of file api_wrdb.cc.

References get_database(), and get_writable_database().

◆ DEFINE_TESTCASE() [9/35]

DEFINE_TESTCASE ( deldoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [10/35]

DEFINE_TESTCASE ( deldoc2  ,
writable   
)

◆ DEFINE_TESTCASE() [11/35]

DEFINE_TESTCASE ( deldoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [12/35]

DEFINE_TESTCASE ( deldoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [13/35]

DEFINE_TESTCASE ( deldoc5  ,
writable   
)

◆ DEFINE_TESTCASE() [14/35]

DEFINE_TESTCASE ( deldoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [15/35]

DEFINE_TESTCASE ( replacedoc1  ,
writable   
)

◆ DEFINE_TESTCASE() [16/35]

DEFINE_TESTCASE ( replacedoc2  ,
writable   
)

◆ DEFINE_TESTCASE() [17/35]

DEFINE_TESTCASE ( replacedoc3  ,
writable   
)

◆ DEFINE_TESTCASE() [18/35]

DEFINE_TESTCASE ( replacedoc4  ,
writable   
)

◆ DEFINE_TESTCASE() [19/35]

DEFINE_TESTCASE ( replacedoc5  ,
writable   
)

◆ DEFINE_TESTCASE() [20/35]

DEFINE_TESTCASE ( replacedoc6  ,
writable   
)

◆ DEFINE_TESTCASE() [21/35]

DEFINE_TESTCASE ( uniqueterm1  ,
writable   
)

◆ DEFINE_TESTCASE() [22/35]

DEFINE_TESTCASE ( allpostlist2  ,
writable   
)

◆ DEFINE_TESTCASE() [23/35]

DEFINE_TESTCASE ( emptyterm2  ,
writable   
)

◆ DEFINE_TESTCASE() [24/35]

DEFINE_TESTCASE ( phraseorneartoand1  ,
writable   
)

◆ DEFINE_TESTCASE() [25/35]

DEFINE_TESTCASE ( longpositionlist1  ,
writable   
)

◆ DEFINE_TESTCASE() [26/35]

DEFINE_TESTCASE ( consistency2  ,
writable   
)

◆ DEFINE_TESTCASE() [27/35]

DEFINE_TESTCASE ( crashrecovery1  ,
chert   
)

◆ DEFINE_TESTCASE() [28/35]

DEFINE_TESTCASE ( nomoredocids1  ,
writable   
)

◆ DEFINE_TESTCASE() [29/35]

DEFINE_TESTCASE ( synonymitor1  ,
writable &&  synonyms 
)

◆ DEFINE_TESTCASE() [30/35]

DEFINE_TESTCASE ( termtoolong1  ,
writable   
)

◆ DEFINE_TESTCASE() [31/35]

DEFINE_TESTCASE ( postlist7  ,
writable   
)

◆ DEFINE_TESTCASE() [32/35]

DEFINE_TESTCASE ( lazytablebug1  ,
chert||  glass 
)

◆ DEFINE_TESTCASE() [33/35]

DEFINE_TESTCASE ( cursordelbug1  ,
writable &&  path 
)

◆ DEFINE_TESTCASE() [34/35]

DEFINE_TESTCASE ( modifyvalues1  ,
writable   
)

◆ DEFINE_TESTCASE() [35/35]

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 2065 of file api_wrdb.cc.

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

◆ test_emptyterm2_helper()

static void test_emptyterm2_helper ( Xapian::WritableDatabase db)
static