xapian-core  1.4.26
Classes | Macros | Functions
api_none.cc File Reference

tests which don't need a backend More...

#include <config.h>
#include "api_none.h"
#include <xapian.h>
#include "apitest.h"
#include "str.h"
#include "testsuite.h"
#include "testutils.h"
+ Include dependency graph for api_none.cc:

Go to the source code of this file.

Classes

class  DestroyedFlag
 
class  TestRangeProcessor
 
class  TestFieldProcessor
 
class  TestMatchSpy
 
class  TestStopper
 
class  TestKeyMaker
 
class  TestExpandDecider
 
class  TestValueRangeProcessor
 

Macros

#define XAPIAN_DEPRECATED(D)   D
 
#define singlesubquery1_(OP)
 
#define singlesubquery2_(OP)
 
#define singlesubquery3_(OP)
 

Functions

 DEFINE_TESTCASE (version1, !backend)
 
 DEFINE_TESTCASE (nosubdatabases1, !backend)
 
 DEFINE_TESTCASE (document1, !backend)
 Feature test for Document::add_boolean_term(), new in 1.0.18/1.1.4. More...
 
 DEFINE_TESTCASE (document2, !backend)
 Regression test - the docid wasn't initialised prior to 1.0.22/1.2.4. More...
 
 DEFINE_TESTCASE (documentclearterms1, !backend)
 Feature tests for Document::clear_terms(). More...
 
 DEFINE_TESTCASE (documentclearvalues1, !backend)
 Feature tests for Document::clear_values(). More...
 
 DEFINE_TESTCASE (documentemptyterm1, !backend)
 Feature tests for errors for empty terms. More...
 
 DEFINE_TESTCASE (emptyquery4, !backend)
 
 DEFINE_TESTCASE (singlesubquery1, !backend)
 
 DEFINE_TESTCASE (singlesubquery2, !backend)
 
 DEFINE_TESTCASE (singlesubquery3, !backend)
 
 DEFINE_TESTCASE (combinewqfnomore1, !backend)
 Check we no longer combine wqf for same term at the same position. More...
 
 DEFINE_TESTCASE (subclassablerefcount1, !backend)
 Check reference counting of user-subclassable classes. More...
 
 DEFINE_TESTCASE (subclassablerefcount2, !backend)
 Check reference counting of user-subclassable classes. More...
 
 DEFINE_TESTCASE (subclassablerefcount3, backend)
 Check reference counting of MatchSpy. More...
 
 DEFINE_TESTCASE (subclassablerefcount4, !backend)
 Check reference counting of Stopper with QueryParser. More...
 
 DEFINE_TESTCASE (subclassablerefcount5, !backend)
 Check reference counting of Stopper with TermGenerator. More...
 
 DEFINE_TESTCASE (subclassablerefcount6, backend)
 Check reference counting of KeyMaker. More...
 
 DEFINE_TESTCASE (subclassablerefcount7, backend)
 Check reference counting of ExpandDecider. More...
 
 DEFINE_TESTCASE (subclassablerefcount8, !backend)
 Check reference counting of user-subclassable classes. More...
 
 DEFINE_TESTCASE (nonutf8docdesc1, !backend)
 Check encoding of non-UTF8 document data. More...
 
 DEFINE_TESTCASE (deletewhileiterating1, !backend)
 Test removal of terms from a document while iterating over them. More...
 
 DEFINE_TESTCASE (removepostings, !backend)
 Feature test for Document::remove_postings(). More...
 
static void errorcopyctor_helper (Xapian::Error &error)
 
 DEFINE_TESTCASE (errorcopyctor, !backend)
 Regression test for warning with GCC 9. More...
 

Detailed Description

tests which don't need a backend

Definition in file api_none.cc.

Macro Definition Documentation

◆ singlesubquery1_

#define singlesubquery1_ (   OP)
Value:
"Query(test)")
std::string get_description() const
Return a string describing this object.
Definition: query.cc:232
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
Definition: testsuite.h:287
Class representing a query.
Definition: query.h:46

Referenced by DEFINE_TESTCASE().

◆ singlesubquery2_

#define singlesubquery2_ (   OP)
Value:
"Query()")
std::string get_description() const
Return a string describing this object.
Definition: query.cc:232
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
Definition: testsuite.h:287
Class representing a query.
Definition: query.h:46

Referenced by DEFINE_TESTCASE().

◆ singlesubquery3_

#define singlesubquery3_ (   OP)
Value:
"Query(<alldocuments>)")
std::string get_description() const
Return a string describing this object.
Definition: query.cc:232
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
Definition: testsuite.h:287
Class representing a query.
Definition: query.h:46

Referenced by DEFINE_TESTCASE().

◆ XAPIAN_DEPRECATED

#define XAPIAN_DEPRECATED (   D)    D

Definition at line 27 of file api_none.cc.

Function Documentation

◆ DEFINE_TESTCASE() [1/24]

DEFINE_TESTCASE ( version1  ,
backend 
)

◆ DEFINE_TESTCASE() [2/24]

DEFINE_TESTCASE ( nosubdatabases1  ,
backend 
)

◆ DEFINE_TESTCASE() [3/24]

DEFINE_TESTCASE ( document1  ,
backend 
)

◆ DEFINE_TESTCASE() [4/24]

DEFINE_TESTCASE ( document2  ,
backend 
)

Regression test - the docid wasn't initialised prior to 1.0.22/1.2.4.

Definition at line 85 of file api_none.cc.

References Xapian::Document::get_docid(), and TEST_EQUAL.

◆ DEFINE_TESTCASE() [5/24]

DEFINE_TESTCASE ( documentclearterms1  ,
backend 
)

◆ DEFINE_TESTCASE() [6/24]

DEFINE_TESTCASE ( documentclearvalues1  ,
backend 
)

◆ DEFINE_TESTCASE() [7/24]

DEFINE_TESTCASE ( documentemptyterm1  ,
backend 
)

◆ DEFINE_TESTCASE() [8/24]

DEFINE_TESTCASE ( emptyquery4  ,
backend 
)

◆ DEFINE_TESTCASE() [9/24]

DEFINE_TESTCASE ( singlesubquery1  ,
backend 
)

Definition at line 187 of file api_none.cc.

References singlesubquery1_.

◆ DEFINE_TESTCASE() [10/24]

DEFINE_TESTCASE ( singlesubquery2  ,
backend 
)

Definition at line 207 of file api_none.cc.

References Xapian::Query::MatchNothing, and singlesubquery2_.

◆ DEFINE_TESTCASE() [11/24]

DEFINE_TESTCASE ( singlesubquery3  ,
backend 
)

Definition at line 226 of file api_none.cc.

References Xapian::Query::MatchAll, and singlesubquery3_.

◆ DEFINE_TESTCASE() [12/24]

DEFINE_TESTCASE ( combinewqfnomore1  ,
backend 
)

Check we no longer combine wqf for same term at the same position.

Definition at line 245 of file api_none.cc.

References Xapian::Query::get_description(), Xapian::Query::OP_OR, and TEST_EQUAL.

◆ DEFINE_TESTCASE() [13/24]

DEFINE_TESTCASE ( subclassablerefcount1  ,
backend 
)

Check reference counting of user-subclassable classes.

Definition at line 280 of file api_none.cc.

References Xapian::QueryParser::add_rangeprocessor(), Xapian::RangeProcessor::release(), and TEST.

◆ DEFINE_TESTCASE() [14/24]

DEFINE_TESTCASE ( subclassablerefcount2  ,
backend 
)

Check reference counting of user-subclassable classes.

Definition at line 361 of file api_none.cc.

References Xapian::QueryParser::add_prefix(), Xapian::FieldProcessor::release(), and TEST.

◆ DEFINE_TESTCASE() [15/24]

DEFINE_TESTCASE ( subclassablerefcount3  ,
backend   
)

Check reference counting of MatchSpy.

Definition at line 423 of file api_none.cc.

References Xapian::Enquire::add_matchspy(), get_database(), Xapian::MatchSpy::release(), and TEST.

◆ DEFINE_TESTCASE() [16/24]

DEFINE_TESTCASE ( subclassablerefcount4  ,
backend 
)

Check reference counting of Stopper with QueryParser.

Definition at line 487 of file api_none.cc.

References Xapian::Stopper::release(), Xapian::QueryParser::set_stopper(), and TEST.

◆ DEFINE_TESTCASE() [17/24]

DEFINE_TESTCASE ( subclassablerefcount5  ,
backend 
)

Check reference counting of Stopper with TermGenerator.

Definition at line 557 of file api_none.cc.

References Xapian::Stopper::release(), Xapian::TermGenerator::set_stopper(), and TEST.

◆ DEFINE_TESTCASE() [18/24]

DEFINE_TESTCASE ( subclassablerefcount6  ,
backend   
)

◆ DEFINE_TESTCASE() [19/24]

DEFINE_TESTCASE ( subclassablerefcount7  ,
backend   
)

◆ DEFINE_TESTCASE() [20/24]

DEFINE_TESTCASE ( subclassablerefcount8  ,
backend 
)

Check reference counting of user-subclassable classes.

Definition at line 809 of file api_none.cc.

References Xapian::QueryParser::add_valuerangeprocessor(), Xapian::ValueRangeProcessor::release(), and TEST.

◆ DEFINE_TESTCASE() [21/24]

DEFINE_TESTCASE ( nonutf8docdesc1  ,
backend 
)

Check encoding of non-UTF8 document data.

Definition at line 880 of file api_none.cc.

References Xapian::Document::get_description(), Xapian::Document::set_data(), and TEST_EQUAL.

◆ DEFINE_TESTCASE() [22/24]

DEFINE_TESTCASE ( deletewhileiterating1  ,
backend 
)

Test removal of terms from a document while iterating over them.

Prior to 1.5.0 and 1.4.6 the underlying iterator was invalidated when preinc == false, leading to undefined behaviour (typically a segmentation fault).

Definition at line 900 of file api_none.cc.

References Xapian::TermGenerator::index_text(), Xapian::Document::remove_term(), Xapian::TermGenerator::set_document(), Xapian::TermIterator::skip_to(), startswith(), Xapian::Document::termlist_begin(), Xapian::Document::termlist_count(), Xapian::Document::termlist_end(), TEST, and TEST_EQUAL.

◆ DEFINE_TESTCASE() [23/24]

DEFINE_TESTCASE ( removepostings  ,
backend 
)

◆ DEFINE_TESTCASE() [24/24]

DEFINE_TESTCASE ( errorcopyctor  ,
backend 
)

Regression test for warning with GCC 9.

Definition at line 997 of file api_none.cc.

References errorcopyctor_helper(), and FAIL_TEST.

◆ errorcopyctor_helper()

static void errorcopyctor_helper ( Xapian::Error error)
static

Definition at line 989 of file api_none.cc.

Referenced by DEFINE_TESTCASE().