tests/api_anydb.cc File Reference

#include <config.h>
#include "api_anydb.h"
#include <algorithm>
#include <string>
#include <xapian.h>
#include "backendmanager_local.h"
#include "testsuite.h"
#include "testutils.h"
#include "utils.h"
#include "apitest.h"
#include <list>

Include dependency graph for api_anydb.cc:

Go to the source code of this file.

Classes

class  myExpandFunctor

Functions

static void print_mset_weights (const Xapian::MSet &mset)
static void print_mset_percentages (const Xapian::MSet &mset)
static Xapian::Query query (Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
static Xapian::Query query (Xapian::Query::op op, Xapian::termcount parameter, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
static Xapian::Query query (const string &t)
 DEFINE_TESTCASE (zerodocid1, backend)
 DEFINE_TESTCASE (emptyquery1, backend)
 DEFINE_TESTCASE (simplequery1, backend)
 DEFINE_TESTCASE (simplequery2, backend)
 DEFINE_TESTCASE (simplequery3, backend)
 DEFINE_TESTCASE (wildquery1, backend)
 DEFINE_TESTCASE (multidb1, backend)
 DEFINE_TESTCASE (multidb2, backend &&!multi)
 DEFINE_TESTCASE (multidb3, backend &&!multi)
 DEFINE_TESTCASE (multidb4, backend &&!multi)
 DEFINE_TESTCASE (multidb5, backend &&!multi)
 DEFINE_TESTCASE (msetmaxitems1, backend)
 DEFINE_TESTCASE (expandweights1, backend)
 DEFINE_TESTCASE (expandweights2, backend)
 DEFINE_TESTCASE (expandweights3, backend)
 DEFINE_TESTCASE (expandweights4, backend)
 DEFINE_TESTCASE (expandmaxitems1, backend)
 DEFINE_TESTCASE (boolquery1, backend)
 DEFINE_TESTCASE (msetfirst1, backend)
 DEFINE_TESTCASE (topercent1, backend)
 DEFINE_TESTCASE (topercent2, backend)
 DEFINE_TESTCASE (expandfunctor1, backend)
 DEFINE_TESTCASE (pctcutoff1, backend)
 DEFINE_TESTCASE (pctcutoff2, backend)
 DEFINE_TESTCASE (pctcutoff3, backend)
 DEFINE_TESTCASE (cutoff1, backend)
 DEFINE_TESTCASE (allowqterms1, backend)
 DEFINE_TESTCASE (maxattain1, backend)
 DEFINE_TESTCASE (reversebool1, backend)
 DEFINE_TESTCASE (reversebool2, backend)
 DEFINE_TESTCASE (getmterms1, backend)
 DEFINE_TESTCASE (getmterms2, backend)
 DEFINE_TESTCASE (poscollapse1, backend)
 DEFINE_TESTCASE (repeatquery1, backend)
 DEFINE_TESTCASE (fetchdocs1, backend)
 DEFINE_TESTCASE (absentterm1, backend)
 DEFINE_TESTCASE (absentterm2, backend)
 DEFINE_TESTCASE (rset1, backend)
 DEFINE_TESTCASE (rset2, backend)
 DEFINE_TESTCASE (rsetmultidb1, backend &&!multi)
 DEFINE_TESTCASE (rsetmultidb3, backend &&!multi)
 DEFINE_TESTCASE (eliteset1, backend)
 Simple test of the elite set operator.
 DEFINE_TESTCASE (eliteset2, backend)
 Test that the elite set operator works if the set contains sub-expressions (regression test).
 DEFINE_TESTCASE (eliteset3, backend)
 Test that elite set doesn't affect query results if we have fewer terms than the threshold.
 DEFINE_TESTCASE (eliteset4, backend)
 Test that elite set doesn't pick terms with 0 frequency.
 DEFINE_TESTCASE (eliteset5, backend)
 Regression test for problem with excess precision.
 DEFINE_TESTCASE (termlisttermfreq1, backend)
 Test that the termfreq returned by termlists is correct.
 DEFINE_TESTCASE (qterminfo1, backend)
 Test the termfrequency and termweight info returned for query terms.
 DEFINE_TESTCASE (qterminfo2, backend)
 Regression test for bug #37.
 DEFINE_TESTCASE (msetzeroitems1, backend)
 DEFINE_TESTCASE (matches1, backend)
 DEFINE_TESTCASE (wqf1, backend)
 DEFINE_TESTCASE (qlen1, backend)
 DEFINE_TESTCASE (termlist1, backend)
 DEFINE_TESTCASE (termlist2, backend)
static Xapian::TermIterator test_termlist3_helper ()
 DEFINE_TESTCASE (termlist3, backend)
 DEFINE_TESTCASE (termlist4, backend)
 DEFINE_TESTCASE (puncterms1, backend)
 DEFINE_TESTCASE (spaceterms1, backend)
 DEFINE_TESTCASE (xor1, backend)
 DEFINE_TESTCASE (xor2, backend)
 Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21).
 DEFINE_TESTCASE (getdoc1, backend)
 DEFINE_TESTCASE (emptyop1, backend)
 DEFINE_TESTCASE (checkatleast1, backend)
 DEFINE_TESTCASE (checkatleast2, backend)
 DEFINE_TESTCASE (checkatleast3, backend)
 DEFINE_TESTCASE (allpostlist1, backend)
static void test_emptyterm1_helper (Xapian::Database &db)
 DEFINE_TESTCASE (emptyterm1, backend)
 DEFINE_TESTCASE (alldocspl1, writable)
 DEFINE_TESTCASE (alldocspl2, writable)
 DEFINE_TESTCASE (scaleweight1, backend)
 DEFINE_TESTCASE (scaleweight2, backend)
 DEFINE_TESTCASE (bm25weight1, backend)
 DEFINE_TESTCASE (tradweight1, backend)
 DEFINE_TESTCASE (uuid1, backend &&!multi)


Function Documentation

DEFINE_TESTCASE ( uuid1  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( tradweight1  ,
backend   
)

DEFINE_TESTCASE ( bm25weight1  ,
backend   
)

DEFINE_TESTCASE ( scaleweight2  ,
backend   
)

DEFINE_TESTCASE ( scaleweight1  ,
backend   
)

DEFINE_TESTCASE ( alldocspl2  ,
writable   
)

DEFINE_TESTCASE ( alldocspl1  ,
writable   
)

DEFINE_TESTCASE ( emptyterm1  ,
backend   
)

DEFINE_TESTCASE ( allpostlist1  ,
backend   
)

DEFINE_TESTCASE ( checkatleast3  ,
backend   
)

DEFINE_TESTCASE ( checkatleast2  ,
backend   
)

DEFINE_TESTCASE ( checkatleast1  ,
backend   
)

DEFINE_TESTCASE ( emptyop1  ,
backend   
)

DEFINE_TESTCASE ( getdoc1  ,
backend   
)

DEFINE_TESTCASE ( xor2  ,
backend   
)

Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21).

Definition at line 1855 of file api_anydb.cc.

References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), and stemmer.

DEFINE_TESTCASE ( xor1  ,
backend   
)

DEFINE_TESTCASE ( spaceterms1  ,
backend   
)

DEFINE_TESTCASE ( puncterms1  ,
backend   
)

DEFINE_TESTCASE ( termlist4  ,
backend   
)

DEFINE_TESTCASE ( termlist3  ,
backend   
)

DEFINE_TESTCASE ( termlist2  ,
backend   
)

DEFINE_TESTCASE ( termlist1  ,
backend   
)

Definition at line 1688 of file api_anydb.cc.

References get_database(), Xapian::Database::termlist_begin(), and TEST_EXCEPTION.

DEFINE_TESTCASE ( qlen1  ,
backend   
)

DEFINE_TESTCASE ( wqf1  ,
backend   
)

DEFINE_TESTCASE ( matches1  ,
backend   
)

DEFINE_TESTCASE ( msetzeroitems1  ,
backend   
)

DEFINE_TESTCASE ( qterminfo2  ,
backend   
)

DEFINE_TESTCASE ( qterminfo1  ,
backend   
)

DEFINE_TESTCASE ( termlisttermfreq1  ,
backend   
)

DEFINE_TESTCASE ( eliteset5  ,
backend   
)

DEFINE_TESTCASE ( eliteset4  ,
backend   
)

DEFINE_TESTCASE ( eliteset3  ,
backend   
)

Test that elite set doesn't affect query results if we have fewer terms than the threshold.

Definition at line 1298 of file api_anydb.cc.

References get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termfreq(), Xapian::MSet::get_termweight(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), stemmer, and TEST_EQUAL.

DEFINE_TESTCASE ( eliteset2  ,
backend   
)

Test that the elite set operator works if the set contains sub-expressions (regression test).

Definition at line 1266 of file api_anydb.cc.

References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), SKIP_TEST_FOR_BACKEND, and TEST_EQUAL.

DEFINE_TESTCASE ( eliteset1  ,
backend   
)

DEFINE_TESTCASE ( rsetmultidb3  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( rsetmultidb1  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( rset2  ,
backend   
)

DEFINE_TESTCASE ( rset1  ,
backend   
)

DEFINE_TESTCASE ( absentterm2  ,
backend   
)

DEFINE_TESTCASE ( absentterm1  ,
backend   
)

DEFINE_TESTCASE ( fetchdocs1  ,
backend   
)

DEFINE_TESTCASE ( repeatquery1  ,
backend   
)

DEFINE_TESTCASE ( poscollapse1  ,
backend   
)

DEFINE_TESTCASE ( getmterms2  ,
backend   
)

DEFINE_TESTCASE ( getmterms1  ,
backend   
)

DEFINE_TESTCASE ( reversebool2  ,
backend   
)

DEFINE_TESTCASE ( reversebool1  ,
backend   
)

DEFINE_TESTCASE ( maxattain1  ,
backend   
)

DEFINE_TESTCASE ( allowqterms1  ,
backend   
)

DEFINE_TESTCASE ( cutoff1  ,
backend   
)

DEFINE_TESTCASE ( pctcutoff3  ,
backend   
)

DEFINE_TESTCASE ( pctcutoff2  ,
backend   
)

DEFINE_TESTCASE ( pctcutoff1  ,
backend   
)

DEFINE_TESTCASE ( expandfunctor1  ,
backend   
)

DEFINE_TESTCASE ( topercent2  ,
backend   
)

DEFINE_TESTCASE ( topercent1  ,
backend   
)

DEFINE_TESTCASE ( msetfirst1  ,
backend   
)

DEFINE_TESTCASE ( boolquery1  ,
backend   
)

DEFINE_TESTCASE ( expandmaxitems1  ,
backend   
)

DEFINE_TESTCASE ( expandweights4  ,
backend   
)

DEFINE_TESTCASE ( expandweights3  ,
backend   
)

DEFINE_TESTCASE ( expandweights2  ,
backend   
)

DEFINE_TESTCASE ( expandweights1  ,
backend   
)

DEFINE_TESTCASE ( msetmaxitems1  ,
backend   
)

DEFINE_TESTCASE ( multidb5  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( multidb4  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( multidb3  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( multidb2  ,
backend &&!  multi 
)

DEFINE_TESTCASE ( multidb1  ,
backend   
)

DEFINE_TESTCASE ( wildquery1  ,
backend   
)

DEFINE_TESTCASE ( simplequery3  ,
backend   
)

DEFINE_TESTCASE ( simplequery2  ,
backend   
)

DEFINE_TESTCASE ( simplequery1  ,
backend   
)

DEFINE_TESTCASE ( emptyquery1  ,
backend   
)

DEFINE_TESTCASE ( zerodocid1  ,
backend   
)

static void print_mset_percentages ( const Xapian::MSet mset  )  [static]

static void print_mset_weights ( const Xapian::MSet mset  )  [static]

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

Definition at line 109 of file api_anydb.cc.

static Xapian::Query query ( Xapian::Query::op  op,
Xapian::termcount  parameter,
const string &  t1 = string(),
const string &  t2 = string(),
const string &  t3 = string(),
const string &  t4 = string(),
const string &  t5 = string(),
const string &  t6 = string(),
const string &  t7 = string(),
const string &  t8 = string(),
const string &  t9 = string(),
const string &  t10 = string() 
) [static]

Definition at line 86 of file api_anydb.cc.

References stemmer.

static Xapian::Query query ( Xapian::Query::op  op,
const string &  t1 = string(),
const string &  t2 = string(),
const string &  t3 = string(),
const string &  t4 = string(),
const string &  t5 = string(),
const string &  t6 = string(),
const string &  t7 = string(),
const string &  t8 = string(),
const string &  t9 = string(),
const string &  t10 = string() 
) [static]

static void test_emptyterm1_helper ( Xapian::Database db  )  [static]

static Xapian::TermIterator test_termlist3_helper (  )  [static]

Definition at line 1731 of file api_anydb.cc.

References get_database(), and Xapian::Database::termlist_begin().

Referenced by DEFINE_TESTCASE().


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