43 list<string> answers_list;
44 answers_list.push_back(
"one");
45 answers_list.push_back(
"two");
46 answers_list.push_back(
"three");
47 answers_list.push_back(
"four");
63 TEST(list1 == answers_list);
65 TEST(list2 == answers_list);
83 vector<Xapian::Query> v;
98 for (
size_t i = 0; i <
sizeof(ops) /
sizeof(ops[0]); ++i) {
99 tout <<
"Testing op #" << i <<
'\n';
143 vector<string> v1(terms, terms + 3);
144 vector<Xapian::Query> v2(queries, queries + 3);
145 vector<Xapian::Query *> v3;
148 v3.push_back(&query1);
149 v3.push_back(&query2);
152 tout <<
"myq1=" << myq1 <<
"\n";
156 tout <<
"myq2_1=" << myq2_1 <<
"\n";
160 tout <<
"myq2_2=" << myq2_2 <<
"\n";
164 tout <<
"myq2=" << myq2 <<
"\n";
168 tout <<
"myquery=" << myquery <<
"\n";
191 vector<Xapian::Query> vec1(queries1, queries1 + 3);
194 "Query((wibble OR wobble OR (jelly OR belly)))");
196 vector<Xapian::Query> vec2(queries2, queries2 + 3);
199 "Query(((jelly AND belly) AND wibble AND wobble))");
204 vector<string> emptyterms;
214 tout <<
"available languages '" << langs <<
"'\n";
215 TEST(!langs.empty());
218 langs +=
" ar hy eu ca da nl en fi fr de hu id ga it lt ne nb nn no pt ro" 221 string::size_type i = 0;
223 string::size_type spc = langs.find(
' ', i);
231 tout <<
"checking language code '" << language <<
"' works\n";
234 if (language.size() > 2) {
235 string expected(
"Xapian::Stem(");
241 if (spc == string::npos)
break;
265 FAIL_TEST(
"Managed to open 'NOsuChdaTabASe'");
274 FAIL_TEST(
"Managed to check 'NOsuChdaTabASe'");
280 "Couldn't find Xapian database or table to check");
390 string prefix =
"tw";
392 TEST(!decider(
"one"));
395 TEST(!decider(
"Two"));
396 TEST(decider(
"two"));
397 TEST(decider(
"twitter"));
398 TEST(decider(prefix));
const TermIterator get_unique_terms_end() const
End iterator for unique terms in the query object.
Xapian::termcount get_length() const
Return the length of this query object.
bool is_none() const
Return true if this is a no-op stemmer.
ExpandDecider subclass which restrict terms to a particular prefix.
Xapian::doccount size() const
The number of documents in this R-Set.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
MatchDecider filtering results based on whether document values are in a user-defined set...
static size_t check(const std::string &path, int opts=0, std::ostream *out=NULL)
Check the integrity of a database or database table.
#define TEST(a)
Test a condition, without an additional explanation for failure.
std::string get_description() const
Return a string describing this object.
This class is used to access a database, or a group of databases.
Match documents which an odd number of subqueries match.
InvalidOperationError indicates the API was used in an invalid way.
const TermIterator get_terms_begin() const
Begin iterator for terms in the query object.
DatabaseOpeningError indicates failure to open a database.
Class representing a stemming algorithm.
void remove_value(const std::string &value)
Remove a value from the test set.
const std::string & get_msg() const
Message giving details of the error, intended for human consumption.
a generic test suite engine
void add_value(const std::string &value)
Add a value to the test set.
Class representing a list of search results.
static Xapian::Stem stemmer
DEFINE_TESTCASE(getqterms1, !backend)
void remove_value(Xapian::valueno slot)
Remove any value with the given number.
const TermIterator get_unique_terms_begin() const
Begin iterator for unique terms in the query object.
test functionality of the Xapian API
Class for iterating over a list of terms.
#define TEST_NOT_EQUAL(a, b)
Test for non-equality of two things.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
std::ostringstream tout
The debug printing stream.
Scale the weight contributed by a subquery.
Match the first subquery taking extra weight from other subqueries.
std::string get_description() const
Return a string describing this object.
Public interfaces for the Xapian library.
static std::string get_available_languages()
Return a list of available languages.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
void add_document(Xapian::docid did)
Add a document to the relevance set.
#define FAIL_TEST(MSG)
Fail the current testcase with message MSG.
Match only documents which all subqueries match.
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())
std::string get_description() const
Return a string describing this object.
This class provides an interface to the information retrieval system for the purpose of searching...
bool empty() const
Check if this query is Xapian::Query::MatchNothing.
Match documents which the first subquery matches but no others do.
Match documents which at least one subquery matches.
Xapian-specific test helper functions and macros.
static const Xapian::Query MatchNothing
A query matching no documents.
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
Xapian::doccount get_termfreq(const std::string &term) const
Get the termfreq of a term.
Class representing a query.
#define TEST_EQUAL(a, b)
Test for equality of two things.
bool empty() const
Test if this R-Set is empty.
const TermIterator get_terms_end() const
End iterator for terms in the query object.
std::string get_value(Xapian::valueno slot) const
Get value by number.
A handle representing a document in a Xapian database.