From 49a776571dcc1c1b4b4a5a070ee4a336c885ed03 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 1 Dec 2017 15:03:25 +0100 Subject: [PATCH] Tests: adapt to new way of Xapian 1.4 for printing queries --- src/qtgui/confgui/conflinkrcl.h | 68 ------------------------------- tests/info/info.sh | 2 + tests/info/info.txt | 3 +- tests/langparser1/langparser1.txt | 54 ++++++++++++------------ tests/pythonapi/pythonapi.txt | 12 +++--- 5 files changed, 36 insertions(+), 103 deletions(-) delete mode 100644 src/qtgui/confgui/conflinkrcl.h diff --git a/src/qtgui/confgui/conflinkrcl.h b/src/qtgui/confgui/conflinkrcl.h deleted file mode 100644 index c5554887..00000000 --- a/src/qtgui/confgui/conflinkrcl.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 2004 J.F.Dockes - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the - * Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _CONFLINKRCL_H_INCLUDED_ -#define _CONFLINKRCL_H_INCLUDED_ - -/** - * A Gui-to-Data link class for ConfTree - * Has a subkey pointer member which makes it easy to change the - * current subkey for a number at a time. - */ -#include "confgui.h" -#include "conftree.h" -#include "log.h" - -namespace confgui { - -class ConfLinkRclRep : public ConfLinkRep { -public: - ConfLinkRclRep(ConfNull *conf, const string& nm, - string *sk = 0) - : m_conf(conf), m_nm(nm), m_sk(sk) - { - } - virtual ~ConfLinkRclRep() {} - - virtual bool set(const string& val) - { - if (!m_conf) - return false; - LOGDEB1("Setting [" << (m_nm) << "] value to [" << (val) << "]\n" ); - bool ret = m_conf->set(m_nm, val, m_sk?*m_sk:""); - if (!ret) - LOGERR("Value set failed\n" ); - return ret; - } - virtual bool get(string& val) - { - if (!m_conf) - return false; - bool ret = m_conf->get(m_nm, val, m_sk?*m_sk:""); - LOGDEB1("ConfLinkRcl::get: [" << (m_nm) << "] sk [" << (m_sk?m_sk:"") << "] -> [" << (ret ? val : "no value") << "]\n" ); - return ret; - } -private: - ConfNull *m_conf; - const string m_nm; - const string *m_sk; -}; - -} // Namespace confgui - -#endif /* _CONFLINKRCL_H_INCLUDED_ */ - diff --git a/tests/info/info.sh b/tests/info/info.sh index c7f396f3..5c2c472f 100755 --- a/tests/info/info.sh +++ b/tests/info/info.sh @@ -12,6 +12,8 @@ initvariables $0 # text/plain files. Previous versions only returned the info file, # which was better, but I'm not sure that we can do something about # it. +# It seems that later versions of xdg-mime return octet-stream so all back +# to normal recollq '"GPGME is compiled with largefile support by default"' 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout diff --git a/tests/info/info.txt b/tests/info/info.txt index d9c2ea46..02e011dc 100644 --- a/tests/info/info.txt +++ b/tests/info/info.txt @@ -1,3 +1,2 @@ -2 results +1 results text/html [file:///home/dockes/projets/fulltext/testrecoll/info/gpgme.info] [gpgme.info / Preparation / Largefile Support (LFS)] 4225 bytes -text/plain [file:///home/dockes/projets/fulltext/testrecoll/info/gpgme.info-1] [gpgme.info-1] 275877 bytes diff --git a/tests/langparser1/langparser1.txt b/tests/langparser1/langparser1.txt index 18335d11..add2b1cb 100644 --- a/tests/langparser1/langparser1.txt +++ b/tests/langparser1/langparser1.txt @@ -1,27 +1,27 @@ - Query: A -> Recoll query: (a:(wqf=11)) - Query: A B -> Recoll query: ((a:(wqf=11) AND b:(wqf=11))) - Query: A AND B -> Recoll query: ((a:(wqf=11) AND b:(wqf=11))) - Query: A OR B -> Recoll query: ((a:(wqf=11) OR b:(wqf=11))) - Query: A OR B AND C -> Recoll query: (((a:(wqf=11) OR b:(wqf=11)) AND c:(wqf=11))) - Query: A AND B OR C -> Recoll query: ((a:(wqf=11) AND (b:(wqf=11) OR c:(wqf=11)))) - Query: (A AND B) OR (C AND D) -> Recoll query: (((a:(wqf=11) AND b:(wqf=11)) OR (c:(wqf=11) AND d:(wqf=11)))) - Query: (A OR B) AND (C OR D) -> Recoll query: (((a:(wqf=11) OR b:(wqf=11)) AND (c:(wqf=11) OR d:(wqf=11)))) - Query: -the B -> Recoll query: ((( AND_NOT the:(wqf=11)) AND b:(wqf=11))) - Query: A -B -> Recoll query: ((a:(wqf=11) AND ( AND_NOT b:(wqf=11)))) - Query: mime:text/plain -> Recoll query: (( FILTER Ttext/plain)) - Query: size>10k -> Recoll query: (( FILTER VALUE_GE 2 000000010000)) - Query: date:3000-01-01 -> Recoll query: (( FILTER D30000101)) - Query: mime:text/plain A OR B mime:text/html -> Recoll query: (((a:(wqf=11) OR b:(wqf=11)) FILTER (Ttext/html OR Ttext/plain))) - Query: mime:text/plain A AND B mime:text/html -> Recoll query: (((a:(wqf=11) AND b:(wqf=11)) FILTER (Ttext/html OR Ttext/plain))) - Query: mime:text/plain mime:text/html (A B) -> Recoll query: (((a:(wqf=11) AND b:(wqf=11)) FILTER (Ttext/html OR Ttext/plain))) - Query: mime:text/plain OR mime:text/html OR (A B) -> Recoll query: (((a:(wqf=11) AND b:(wqf=11)) FILTER (Ttext/html OR Ttext/plain))) - Query: rclcat:media A -> Recoll query: ((a:(wqf=11) FILTER (Tapplication/ogg OR Tapplication/x-flac OR Taudio/mpeg OR Taudio/x-karaoke OR Timage/bmp OR Timage/gif OR Timage/jpeg OR Timage/png OR Timage/svg+xml OR Timage/tiff OR Timage/vnd.djvu OR Timage/x-icon OR Timage/x-xcf OR Timage/x-xpmi OR Tvideo/*))) - Query: rclcat:media rclcat:message A -> Recoll query: ((a:(wqf=11) FILTER (Tapplication/ogg OR Tapplication/x-flac OR Taudio/mpeg OR Taudio/x-karaoke OR Timage/bmp OR Timage/gif OR Timage/jpeg OR Timage/png OR Timage/svg+xml OR Timage/tiff OR Timage/vnd.djvu OR Timage/x-icon OR Timage/x-xcf OR Timage/x-xpmi OR Tmessage/rfc822 OR Ttext/x-gaim-log OR Ttext/x-mail OR Ttext/x-purple-html-log OR Ttext/x-purple-log OR Tvideo/*))) - Query: A size>10k -> Recoll query: ((a:(wqf=11) FILTER VALUE_GE 2 000000010000)) - Query: size>10k A -> Recoll query: ((a:(wqf=11) FILTER VALUE_GE 2 000000010000)) - Query: date:3000-01-01 A -> Recoll query: ((a:(wqf=11) FILTER D30000101)) - Query: A OR B date:3000-01-01 -> Recoll query: (((a:(wqf=11) OR b:(wqf=11)) FILTER D30000101)) - Query: A OR B AND date:3000-01-01 -> Recoll query: (((a:(wqf=11) OR b:(wqf=11)) FILTER D30000101)) - Query: title:A B -> Recoll query: ((Sa:(wqf=11) AND b:(wqf=11))) - Query: title:A -B -> Recoll query: ((Sa:(wqf=11) AND ( AND_NOT b:(wqf=11)))) - Query: A -title:B -> Recoll query: ((a:(wqf=11) AND ( AND_NOT Sb:(wqf=11)))) + Query: A -> Recoll query: Query((a OR a#10)) + Query: A B -> Recoll query: Query(((a OR a#10) AND (b OR b#10))) + Query: A AND B -> Recoll query: Query(((a OR a#10) AND (b OR b#10))) + Query: A OR B -> Recoll query: Query(((a OR a#10) OR (b OR b#10))) + Query: A OR B AND C -> Recoll query: Query((((a OR a#10) OR (b OR b#10)) AND (c OR c#10))) + Query: A AND B OR C -> Recoll query: Query(((a OR a#10) AND ((b OR b#10) OR (c OR c#10)))) + Query: (A AND B) OR (C AND D) -> Recoll query: Query((((a OR a#10) AND (b OR b#10)) OR ((c OR c#10) AND (d OR d#10)))) + Query: (A OR B) AND (C OR D) -> Recoll query: Query((((a OR a#10) OR (b OR b#10)) AND ((c OR c#10) OR (d OR d#10)))) + Query: -the B -> Recoll query: Query((( AND_NOT (the OR the#10)) AND (b OR b#10))) + Query: A -B -> Recoll query: Query(((a OR a#10) AND ( AND_NOT (b OR b#10)))) + Query: mime:text/plain -> Recoll query: Query(( FILTER Ttext/plain)) + Query: size>10k -> Recoll query: Query(( FILTER VALUE_GE 2 000000010000)) + Query: date:3000-01-01 -> Recoll query: Query(( FILTER D30000101)) + Query: mime:text/plain A OR B mime:text/html -> Recoll query: Query((((a OR a#10) OR (b OR b#10)) FILTER (Ttext/html OR Ttext/plain))) + Query: mime:text/plain A AND B mime:text/html -> Recoll query: Query((((a OR a#10) AND (b OR b#10)) FILTER (Ttext/html OR Ttext/plain))) + Query: mime:text/plain mime:text/html (A B) -> Recoll query: Query((((a OR a#10) AND (b OR b#10)) FILTER (Ttext/html OR Ttext/plain))) + Query: mime:text/plain OR mime:text/html OR (A B) -> Recoll query: Query((((a OR a#10) AND (b OR b#10)) FILTER (Ttext/html OR Ttext/plain))) + Query: rclcat:media A -> Recoll query: Query(((a OR a#10) FILTER ((((((((((((((Tapplication/ogg OR Tapplication/x-flac) OR Taudio/mpeg) OR Taudio/x-karaoke) OR Timage/bmp) OR Timage/gif) OR Timage/jpeg) OR Timage/png) OR Timage/svg+xml) OR Timage/tiff) OR Timage/vnd.djvu) OR Timage/x-icon) OR Timage/x-xcf) OR Timage/x-xpmi) OR Tvideo/*))) + Query: rclcat:media rclcat:message A -> Recoll query: Query(((a OR a#10) FILTER (((((((((((((((((((Tapplication/ogg OR Tapplication/x-flac) OR Taudio/mpeg) OR Taudio/x-karaoke) OR Timage/bmp) OR Timage/gif) OR Timage/jpeg) OR Timage/png) OR Timage/svg+xml) OR Timage/tiff) OR Timage/vnd.djvu) OR Timage/x-icon) OR Timage/x-xcf) OR Timage/x-xpmi) OR Tmessage/rfc822) OR Ttext/x-gaim-log) OR Ttext/x-mail) OR Ttext/x-purple-html-log) OR Ttext/x-purple-log) OR Tvideo/*))) + Query: A size>10k -> Recoll query: Query(((a OR a#10) FILTER VALUE_GE 2 000000010000)) + Query: size>10k A -> Recoll query: Query(((a OR a#10) FILTER VALUE_GE 2 000000010000)) + Query: date:3000-01-01 A -> Recoll query: Query(((a OR a#10) FILTER D30000101)) + Query: A OR B date:3000-01-01 -> Recoll query: Query((((a OR a#10) OR (b OR b#10)) FILTER D30000101)) + Query: A OR B AND date:3000-01-01 -> Recoll query: Query((((a OR a#10) OR (b OR b#10)) FILTER D30000101)) + Query: title:A B -> Recoll query: Query(((Sa OR Sa#10) AND (b OR b#10))) + Query: title:A -B -> Recoll query: Query(((Sa OR Sa#10) AND ( AND_NOT (b OR b#10)))) + Query: A -title:B -> Recoll query: Query(((a OR a#10) AND ( AND_NOT (Sb OR Sb#10)))) diff --git a/tests/pythonapi/pythonapi.txt b/tests/pythonapi/pythonapi.txt index 931156bd..dddba7a4 100644 --- a/tests/pythonapi/pythonapi.txt +++ b/tests/pythonapi/pythonapi.txt @@ -1,5 +1,5 @@ python doc.py -Xapian query: [(TSTFLDtestfieldvalue1:(wqf=11))] +Xapian query: [Query((TSTFLDtestfieldvalue1 OR TSTFLDtestfieldvalue1#10))] Result count: 1 1 doc.title: [HTML fields test file: été à noël] doc.testfield: [testfieldvalue1] @@ -24,7 +24,7 @@ for fld in sorted(doc.keys()): [pcbytes] -> [267] [rcludi] -> [/home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html|] [relevancyrating] -> [100%] -[sig] -> [2671402138880] +[sig] -> [2671383154417] [testfield] -> [testfieldvalue1] [title] -> [HTML fields test file: été à noël] [url] -> [file:///home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html] @@ -43,14 +43,14 @@ for k,v in sorted(doc.items().items()): [pcbytes] -> [267] [rcludi] -> [/home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html|] [relevancyrating] -> [100%] -[sig] -> [2671402138880] +[sig] -> [2671383154417] [testfield] -> [testfieldvalue1] [title] -> [HTML fields test file: été à noël] [url] -> [file:///home/dockes/projets/fulltext/testrecoll/html/htmlfield1.html] Accented query: User query [title:"été à noël"] -Xapian query: [(10 * (Sete PHRASE 3 Sa PHRASE 3 Snoel))] +Xapian query: [Query(10 * (Sete PHRASE 3 Sa PHRASE 3 Snoel))] nres 1 doc.title: [HTML fields test file: été à noël] python extract.py @@ -58,7 +58,7 @@ Result count: 1 1 Text length: 3457 bfbb63f7a245c31767585b45014dbd07 python simple.py -Xapian query: [(huniique:(wqf=11))] +Xapian query: [Query((huniique OR huniique#10))] Result count: 2 2 for i in range(nres): Home.ics @@ -70,7 +70,7 @@ unique.txt Catched bad mode. (ok) python url.py -Xapian query: [((latin1name_uniquexxx:(wqf=11) AND XPiso8859name))] +Xapian query: [Query(((latin1name_uniquexxx OR latin1name_uniquexxx#10) AND XPiso8859name))] Result count: 1 1 iso8859-1_????????.txt Contents: [LATIN1NAME_UNIQUEXXX