xapian-core  1.4.26
api_generated.cc
Go to the documentation of this file.
1 
4 /* Warning: This file is generated by ./generate-api_generated - do not modify directly! */
5 /* Copyright (C) 2007,2009,2012,2014,2015,2016,2018 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <config.h>
23 
24 #include "api_generated.h"
25 
26 #define XAPIAN_DEPRECATED(D) D
27 #include <xapian.h>
28 
29 #include "apitest.h"
30 #include "testutils.h"
31 
32 using namespace std;
33 
35 DEFINE_TESTCASE(defaultctor1, !backend) {
36  Xapian::BB2Weight bb2weight;
37  Xapian::BM25Weight bm25weight;
38  Xapian::BoolWeight boolweight;
39  Xapian::DLHWeight dlhweight;
40  Xapian::DateRangeProcessor daterangeprocessor(0);
41  Xapian::DateValueRangeProcessor datevaluerangeprocessor(0);
42  Xapian::DecreasingValueWeightPostingSource decreasingvalueweightpostingsource(0);
43  TEST(!decreasingvalueweightpostingsource.get_description().empty());
44  Xapian::FixedWeightPostingSource fixedweightpostingsource(0);
45  TEST(!fixedweightpostingsource.get_description().empty());
46  Xapian::IfB2Weight ifb2weight;
47  Xapian::InL2Weight inl2weight;
48  Xapian::IneB2Weight ineb2weight;
49  Xapian::MultiValueKeyMaker multivaluekeymaker;
50  Xapian::NumberRangeProcessor numberrangeprocessor(0, "");
51  Xapian::NumberValueRangeProcessor numbervaluerangeprocessor(0, "");
52  Xapian::RangeProcessor rangeprocessor;
53  Xapian::SimpleStopper simplestopper;
54  TEST(!simplestopper.get_description().empty());
55  Xapian::StringValueRangeProcessor stringvaluerangeprocessor(0);
56  Xapian::TfIdfWeight tfidfweight;
57  Xapian::TradWeight tradweight;
58  Xapian::ValueCountMatchSpy valuecountmatchspy(0);
59  TEST(!valuecountmatchspy.get_description().empty());
60  Xapian::ValueMapPostingSource valuemappostingsource(0);
61  TEST(!valuemappostingsource.get_description().empty());
62  Xapian::ValuePostingSource valuepostingsource(0);
63  TEST(!valuepostingsource.get_description().empty());
64  Xapian::ValueWeightPostingSource valueweightpostingsource(0);
65  TEST(!valueweightpostingsource.get_description().empty());
66 }
67 
69 DEFINE_TESTCASE(copyassign1, !backend) {
70  Xapian::Database database;
71  TEST(!database.get_description().empty());
72  Xapian::Database copy_database(database);
73  TEST(!copy_database.get_description().empty());
74  Xapian::Database move_database(std::move(database));
75  TEST(!move_database.get_description().empty());
76  database = copy_database;
77  TEST(!database.get_description().empty());
78  copy_database = std::move(move_database);
79  TEST(!copy_database.get_description().empty());
80 
81  Xapian::Document document;
82  TEST(!document.get_description().empty());
83  Xapian::Document copy_document(document);
84  TEST(!copy_document.get_description().empty());
85  Xapian::Document move_document(std::move(document));
86  TEST(!move_document.get_description().empty());
87  document = copy_document;
88  TEST(!document.get_description().empty());
89  copy_document = std::move(move_document);
90  TEST(!copy_document.get_description().empty());
91 
92  Xapian::ESet eset;
93  TEST(!eset.get_description().empty());
94  Xapian::ESet copy_eset(eset);
95  TEST(!copy_eset.get_description().empty());
96  Xapian::ESet move_eset(std::move(eset));
97  TEST(!move_eset.get_description().empty());
98  eset = copy_eset;
99  TEST(!eset.get_description().empty());
100  copy_eset = std::move(move_eset);
101  TEST(!copy_eset.get_description().empty());
102 
103  Xapian::ESetIterator esetiterator;
104  TEST(!esetiterator.get_description().empty());
105  Xapian::ESetIterator copy_esetiterator(esetiterator);
106  TEST(!copy_esetiterator.get_description().empty());
107  Xapian::ESetIterator move_esetiterator(std::move(esetiterator));
108  TEST(!move_esetiterator.get_description().empty());
109  esetiterator = copy_esetiterator;
110  TEST(!esetiterator.get_description().empty());
111  copy_esetiterator = std::move(move_esetiterator);
112  TEST(!copy_esetiterator.get_description().empty());
113 
114 #ifdef XAPIAN_HAS_INMEMORY_BACKEND
116  TEST(!enquire.get_description().empty());
117  Xapian::Enquire copy_enquire(enquire);
118  TEST(!copy_enquire.get_description().empty());
119  Xapian::Enquire move_enquire(std::move(enquire));
120  TEST(!move_enquire.get_description().empty());
121  enquire = copy_enquire;
122  TEST(!enquire.get_description().empty());
123  copy_enquire = std::move(move_enquire);
124  TEST(!copy_enquire.get_description().empty());
125 #endif
126 
127  Xapian::MSet mset;
128  TEST(!mset.get_description().empty());
129  Xapian::MSet copy_mset(mset);
130  TEST(!copy_mset.get_description().empty());
131  Xapian::MSet move_mset(std::move(mset));
132  TEST(!move_mset.get_description().empty());
133  mset = copy_mset;
134  TEST(!mset.get_description().empty());
135  copy_mset = std::move(move_mset);
136  TEST(!copy_mset.get_description().empty());
137 
138  Xapian::MSetIterator msetiterator;
139  TEST(!msetiterator.get_description().empty());
140  Xapian::MSetIterator copy_msetiterator(msetiterator);
141  TEST(!copy_msetiterator.get_description().empty());
142  Xapian::MSetIterator move_msetiterator(std::move(msetiterator));
143  TEST(!move_msetiterator.get_description().empty());
144  msetiterator = copy_msetiterator;
145  TEST(!msetiterator.get_description().empty());
146  copy_msetiterator = std::move(move_msetiterator);
147  TEST(!copy_msetiterator.get_description().empty());
148 
149  Xapian::PositionIterator positioniterator;
150  TEST(!positioniterator.get_description().empty());
151  Xapian::PositionIterator copy_positioniterator(positioniterator);
152  TEST(!copy_positioniterator.get_description().empty());
153  Xapian::PositionIterator move_positioniterator(std::move(positioniterator));
154  TEST(!move_positioniterator.get_description().empty());
155  positioniterator = copy_positioniterator;
156  TEST(!positioniterator.get_description().empty());
157  copy_positioniterator = std::move(move_positioniterator);
158  TEST(!copy_positioniterator.get_description().empty());
159 
160  Xapian::PostingIterator postingiterator;
161  TEST(!postingiterator.get_description().empty());
162  Xapian::PostingIterator copy_postingiterator(postingiterator);
163  TEST(!copy_postingiterator.get_description().empty());
164  Xapian::PostingIterator move_postingiterator(std::move(postingiterator));
165  TEST(!move_postingiterator.get_description().empty());
166  postingiterator = copy_postingiterator;
167  TEST(!postingiterator.get_description().empty());
168  copy_postingiterator = std::move(move_postingiterator);
169  TEST(!copy_postingiterator.get_description().empty());
170 
172  TEST(!query.get_description().empty());
173  Xapian::Query copy_query(query);
174  TEST(!copy_query.get_description().empty());
175  Xapian::Query move_query(std::move(query));
176  TEST(!move_query.get_description().empty());
177  query = copy_query;
178  TEST(!query.get_description().empty());
179  copy_query = std::move(move_query);
180  TEST(!copy_query.get_description().empty());
181 
182  Xapian::QueryParser queryparser;
183  TEST(!queryparser.get_description().empty());
184  Xapian::QueryParser copy_queryparser(queryparser);
185  TEST(!copy_queryparser.get_description().empty());
186  Xapian::QueryParser move_queryparser(std::move(queryparser));
187  TEST(!move_queryparser.get_description().empty());
188  queryparser = copy_queryparser;
189  TEST(!queryparser.get_description().empty());
190  copy_queryparser = std::move(move_queryparser);
191  TEST(!copy_queryparser.get_description().empty());
192 
193  Xapian::RSet rset;
194  TEST(!rset.get_description().empty());
195  Xapian::RSet copy_rset(rset);
196  TEST(!copy_rset.get_description().empty());
197  Xapian::RSet move_rset(std::move(rset));
198  TEST(!move_rset.get_description().empty());
199  rset = copy_rset;
200  TEST(!rset.get_description().empty());
201  copy_rset = std::move(move_rset);
202  TEST(!copy_rset.get_description().empty());
203 
204  Xapian::Registry registry;
205  Xapian::Registry copy_registry(registry);
206  Xapian::Registry move_registry(std::move(registry));
207  registry = copy_registry;
208  copy_registry = std::move(move_registry);
209 
210  Xapian::Stem stem;
211  TEST(!stem.get_description().empty());
212  Xapian::Stem copy_stem(stem);
213  TEST(!copy_stem.get_description().empty());
214  Xapian::Stem move_stem(std::move(stem));
215  TEST(!move_stem.get_description().empty());
216  stem = copy_stem;
217  TEST(!stem.get_description().empty());
218  copy_stem = std::move(move_stem);
219  TEST(!copy_stem.get_description().empty());
220 
221  Xapian::TermGenerator termgenerator;
222  TEST(!termgenerator.get_description().empty());
223  Xapian::TermGenerator copy_termgenerator(termgenerator);
224  TEST(!copy_termgenerator.get_description().empty());
225  Xapian::TermGenerator move_termgenerator(std::move(termgenerator));
226  TEST(!move_termgenerator.get_description().empty());
227  termgenerator = copy_termgenerator;
228  TEST(!termgenerator.get_description().empty());
229  copy_termgenerator = std::move(move_termgenerator);
230  TEST(!copy_termgenerator.get_description().empty());
231 
232  Xapian::TermIterator termiterator;
233  TEST(!termiterator.get_description().empty());
234  Xapian::TermIterator copy_termiterator(termiterator);
235  TEST(!copy_termiterator.get_description().empty());
236  Xapian::TermIterator move_termiterator(std::move(termiterator));
237  TEST(!move_termiterator.get_description().empty());
238  termiterator = copy_termiterator;
239  TEST(!termiterator.get_description().empty());
240  copy_termiterator = std::move(move_termiterator);
241  TEST(!copy_termiterator.get_description().empty());
242 
243  Xapian::ValueIterator valueiterator;
244  TEST(!valueiterator.get_description().empty());
245  Xapian::ValueIterator copy_valueiterator(valueiterator);
246  TEST(!copy_valueiterator.get_description().empty());
247  Xapian::ValueIterator move_valueiterator(std::move(valueiterator));
248  TEST(!move_valueiterator.get_description().empty());
249  valueiterator = copy_valueiterator;
250  TEST(!valueiterator.get_description().empty());
251  copy_valueiterator = std::move(move_valueiterator);
252  TEST(!copy_valueiterator.get_description().empty());
253 
254  Xapian::WritableDatabase writabledatabase;
255  TEST(!writabledatabase.get_description().empty());
256  Xapian::WritableDatabase copy_writabledatabase(writabledatabase);
257  TEST(!copy_writabledatabase.get_description().empty());
258  Xapian::WritableDatabase move_writabledatabase(std::move(writabledatabase));
259  TEST(!move_writabledatabase.get_description().empty());
260  writabledatabase = copy_writabledatabase;
261  TEST(!writabledatabase.get_description().empty());
262  copy_writabledatabase = std::move(move_writabledatabase);
263  TEST(!copy_writabledatabase.get_description().empty());
264 
265 }
const int DB_BACKEND_INMEMORY
Use the "in memory" backend.
Definition: constants.h:195
Handle a date range.
Definition: queryparser.h:520
virtual std::string get_description() const
Return a string describing this object.
Definition: matchspy.cc:402
Simple implementation of Stopper class - this will suit most users.
Definition: queryparser.h:100
#define TEST(a)
Test a condition, without an additional explanation for failure.
Definition: testsuite.h:275
This class is used to access a database, or a group of databases.
Definition: database.h:68
Class representing a stemming algorithm.
Definition: stem.h:62
std::string get_description() const
Return a string describing this object.
A posting source which looks up weights in a map using values as the key.
Parses a piece of text and generate terms.
Definition: termgenerator.h:48
virtual std::string get_description() const
Return a string describing this object.
Definition: omdatabase.cc:548
Handle a number range.
Definition: queryparser.h:343
Build a Xapian::Query object from a user query string.
Definition: queryparser.h:778
Class for iterating over document values.
Definition: valueiterator.h:40
Class representing a list of search results.
Definition: mset.h:44
This class implements the InL2 weighting scheme.
Definition: weight.h:844
STL namespace.
DEFINE_TESTCASE(defaultctor1, !backend)
Check uncopyable API classes which should have a default ctor actually do.
Read weights from a value which is known to decrease as docid increases.
test functionality of the Xapian API
This class implements the BB2 weighting scheme.
Definition: weight.h:1060
Class for iterating over a list of terms.
Definition: termiterator.h:41
Class for iterating over a list of terms.
KeyMaker subclass which combines several values.
Definition: keymaker.h:104
Class implementing a "boolean" weighting scheme.
Definition: weight.h:433
Handle a date range.
Definition: queryparser.h:253
This class provides read/write access to a database.
Definition: database.h:789
Iterator over a Xapian::MSet.
Definition: mset.h:368
std::string get_description() const
Return a string describing this object.
Definition: stem.cc:147
Registry for user subclasses.
Definition: registry.h:47
Public interfaces for the Xapian library.
A posting source which returns a fixed weight for all documents.
Xapian::Weight subclass implementing the traditional probabilistic formula.
Definition: weight.h:774
This class implements the DLH weighting scheme, which is a representative scheme of the Divergence fr...
Definition: weight.h:1136
Class for iterating over term positions.
This class implements the IneB2 weighting scheme.
Definition: weight.h:988
Iterator over a Xapian::ESet.
Definition: eset.h:160
Handle a string range.
Definition: queryparser.h:466
A posting source which generates weights from a value slot.
Base class for range processors.
Definition: queryparser.h:140
Class for counting the frequencies of values in the matching documents.
Definition: matchspy.h:205
This class implements the IfB2 weighting scheme.
Definition: weight.h:915
A posting source which reads weights from a value slot.
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())
Definition: api_anydb.cc:63
Handle a number range.
Definition: queryparser.h:662
This class provides an interface to the information retrieval system for the purpose of searching...
Definition: enquire.h:152
virtual std::string get_description() const
Return a string describing this object.
Definition: queryparser.cc:48
Xapian-specific test helper functions and macros.
Class representing a list of search results.
Definition: eset.h:43
Class representing a query.
Definition: query.h:46
A handle representing a document in a Xapian database.
Definition: document.h:61
Xapian::Weight subclass implementing the BM25 probabilistic formula.
Definition: weight.h:546
A relevance set (R-Set).
Definition: enquire.h:60
Xapian::Weight subclass implementing the tf-idf weighting scheme.
Definition: weight.h:458