[PATCH 3.5/8] Query parser tests for wildcard queries.

Michal Sojka sojkam1 at fel.cvut.cz
Sat Jan 22 08:47:05 PST 2011


On Fri, 21 Jan 2011, Austin Clements wrote:
> Since wildcard queries require a database, qparser-test can now open a
> database.

Hi Austin,

I had to apply the following changes in order to be able to compile the
tests (make test).

I'm going to test the parser in my daily use, but so far it looks really
nice. I especially enjoy the before and after searches. Thanks.

-Michal

diff --git a/test/qparser-test.cc b/test/qparser-test.cc
index 18318aa..5be6220 100644
--- a/test/qparser-test.cc
+++ b/test/qparser-test.cc
@@ -61,7 +61,7 @@ test_one (void *ctx, const char *query_str)
     void *local = talloc_new (ctx);
     Xapian::Query q;
     _notmuch_token_t *toks, *root;
-    char *error, *qparser_desc, *xqparser_desc;
+    char *error, *qparser_desc = NULL, *xqparser_desc;
 
     toks = _notmuch_qparser_lex (local, qparser, query_str);
     printf("[lex]    %s\n", _notmuch_token_show_list (local, toks));
@@ -100,9 +100,9 @@ static _notmuch_qparser_t *
 create_qparser (void *ctx)
 {
     _notmuch_qparser_t *qparser = _notmuch_qparser_create (ctx, notmuch);
-    _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE);
-    _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE);
-    _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE);
+    _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE, FALSE);
+    _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE, FALSE);
+    _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE, FALSE);
     return qparser;
 }
 


More information about the notmuch mailing list