From f9131e901c2d5c21f3f5fc4d51c0ba0cd400d77e Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 20 Jun 2023 16:47:13 +0200 Subject: [PATCH 1/9] Add wrapper for libzim search and suggestion. --- .../test/org/kiwix/test/libzim/TestQuery.java | 35 ++++++++++++++ .../org/kiwix/test/libzim/TestSearch.java | 31 ++++++++++++ .../kiwix/test/libzim/TestSearchIterator.java | 40 ++++++++++++++++ .../org/kiwix/test/libzim/TestSearcher.java | 47 +++++++++++++++++++ .../kiwix/test/libzim/TestSuggestionItem.java | 32 +++++++++++++ .../test/libzim/TestSuggestionIterator.java | 31 ++++++++++++ .../test/libzim/TestSuggestionSearch.java | 31 ++++++++++++ .../test/libzim/TestSuggestionSearcher.java | 37 +++++++++++++++ lib/src/test/test.java | 22 ++++----- 9 files changed, 295 insertions(+), 11 deletions(-) create mode 100644 lib/src/test/org/kiwix/test/libzim/TestQuery.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSearch.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSearchIterator.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSearcher.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSuggestionItem.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSuggestionIterator.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSuggestionSearch.java create mode 100644 lib/src/test/org/kiwix/test/libzim/TestSuggestionSearcher.java diff --git a/lib/src/test/org/kiwix/test/libzim/TestQuery.java b/lib/src/test/org/kiwix/test/libzim/TestQuery.java new file mode 100644 index 0000000..24b4dcb --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestQuery.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.Query; + +public class TestQuery +{ + private Query inner; + public Query inner() { return inner; } + public TestQuery(String query) { + inner = new Query(query); + } + + public TestQuery setQuery(String query) { inner.setQuery(query); return this; } + public TestQuery setGeorange(float latitude, float longitute, float distance) { inner.setGeorange(latitude, latitude, distance); return this; } + +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSearch.java b/lib/src/test/org/kiwix/test/libzim/TestSearch.java new file mode 100644 index 0000000..d7c2ca1 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSearch.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.Search; +import org.kiwix.libzim.SearchIterator; + +public class TestSearch +{ + private Search inner; + public TestSearch(Search _inner) { inner = _inner; } + public TestSearchIterator getResults(int start, int maxResults) { return new TestSearchIterator(inner.getResults(start, maxResults)); } + public long getEstimatedMatches() { return inner.getEstimatedMatches(); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSearchIterator.java b/lib/src/test/org/kiwix/test/libzim/TestSearchIterator.java new file mode 100644 index 0000000..f942c28 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSearchIterator.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.SearchIterator; +import java.util.Iterator; + +public class TestSearchIterator implements Iterator +{ + private SearchIterator inner; + public TestSearchIterator(SearchIterator _inner) { inner = _inner; } + public String getPath() { return inner.getPath(); } + public String getTitle() { return inner.getTitle(); } + public int getScore() { return inner.getScore(); } + public String getSnippet() { return inner.getSnippet(); } + public int getWordCount() { return inner.getWordCount(); } + public int getFileIndex() { return inner.getFileIndex(); } + public int getSize() { return inner.getSize(); } + public String getZimId() { return inner.getZimId(); } + + public boolean hasNext() { return inner.hasNext(); } + public TestEntry next() { return new TestEntry(inner.next()); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSearcher.java b/lib/src/test/org/kiwix/test/libzim/TestSearcher.java new file mode 100644 index 0000000..4fd7de4 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSearcher.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.Archive; +import org.kiwix.libzim.Searcher; +import org.kiwix.libzim.Search; +import java.util.stream.Stream; + +public class TestSearcher +{ + private Searcher inner; + public TestSearcher(TestArchive archive) throws Exception + { + inner = new Searcher(archive.inner()); + } + + public TestSearcher(TestArchive[] archives) throws Exception + { + inner = new Searcher( + Stream.of(archives).map(a -> a.inner()).toArray(Archive[]::new) + ); + } + + public TestSearcher addArchive(TestArchive archive) { inner.addArchive(archive.inner()); return this; } + public TestSearch search(TestQuery query) { return new TestSearch(inner.search(query.inner())); } + public void setVerbose(boolean verbose) { inner.setVerbose(verbose); } + + public void dispose() { inner.dispose(); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSuggestionItem.java b/lib/src/test/org/kiwix/test/libzim/TestSuggestionItem.java new file mode 100644 index 0000000..b3f9ab3 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSuggestionItem.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.SuggestionItem; + +public class TestSuggestionItem +{ + private SuggestionItem inner; + public TestSuggestionItem(SuggestionItem _inner) { inner = _inner; } + public String getTitle() { return inner.getTitle(); } + public String getPath() { return inner.getPath(); } + public String getSnippet() { return inner.getSnippet(); } + public boolean hasSnippet() { return inner.hasSnippet(); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSuggestionIterator.java b/lib/src/test/org/kiwix/test/libzim/TestSuggestionIterator.java new file mode 100644 index 0000000..89133fe --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSuggestionIterator.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.SuggestionIterator; +import java.util.Iterator; + +public class TestSuggestionIterator implements Iterator +{ + private SuggestionIterator inner; + public TestSuggestionIterator(SuggestionIterator _inner) { inner = _inner; } + public boolean hasNext() { return inner.hasNext(); } + public TestSuggestionItem next() { return new TestSuggestionItem(inner.next()); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearch.java b/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearch.java new file mode 100644 index 0000000..093bff7 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearch.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.SuggestionSearch; + +public class TestSuggestionSearch +{ + private SuggestionSearch inner; + public TestSuggestionSearch(SuggestionSearch _inner) { inner = _inner; } + + public TestSuggestionIterator getResults(int start, int maxResults) { return new TestSuggestionIterator(inner.getResults(start, maxResults)); } + public long getEstimatedMatches() { return inner.getEstimatedMatches(); } +} diff --git a/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearcher.java b/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearcher.java new file mode 100644 index 0000000..e91eba5 --- /dev/null +++ b/lib/src/test/org/kiwix/test/libzim/TestSuggestionSearcher.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 Matthieu Gautier + * + * 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 3 of the License, or + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +package org.kiwix.test.libzim; + +import org.kiwix.libzim.SuggestionSearcher; + +import java.io.FileDescriptor; + +public class TestSuggestionSearcher +{ + private SuggestionSearcher inner; + public TestSuggestionSearcher(TestArchive archive) throws Exception + { + inner = new SuggestionSearcher(archive.inner()); + } + + public TestSuggestionSearch suggest(String query) { return new TestSuggestionSearch(inner.suggest(query)); } + public void setVerbose(boolean verbose) { inner.setVerbose(verbose); } + public void dispose() { inner.dispose(); } +} diff --git a/lib/src/test/test.java b/lib/src/test/test.java index 6528de2..8a636cb 100644 --- a/lib/src/test/test.java +++ b/lib/src/test/test.java @@ -177,30 +177,30 @@ public class test { bookmarkArray = lib.getBookmarks(true); assertEquals(0, bookmarkArray.length); } -/* + @Test public void testSearcher() throws Exception, ZimFileFormatException, JNIKiwixException { - Archive archive = new Archive("small.zim"); + TestArchive archive = new TestArchive("small.zim"); - Searcher searcher = new Searcher(archive); - Query query = new Query("test"); - Search search = searcher.search(query); + TestSearcher searcher = new TestSearcher(archive); + TestQuery query = new TestQuery("test"); + TestSearch search = searcher.search(query); int estimatedMatches = (int) search.getEstimatedMatches(); assertEquals(1, estimatedMatches); - SearchIterator iterator = search.getResults(0, estimatedMatches); + TestSearchIterator iterator = search.getResults(0, estimatedMatches); assertEquals("Test ZIM file", iterator.getTitle()); searcher.dispose(); - SuggestionSearcher suggestionSearcher = new SuggestionSearcher(archive); - SuggestionSearch suggestionSearch = suggestionSearcher.suggest("test"); + TestSuggestionSearcher suggestionSearcher = new TestSuggestionSearcher(archive); + TestSuggestionSearch suggestionSearch = suggestionSearcher.suggest("test"); int matches = (int) suggestionSearch.getEstimatedMatches(); assertEquals(1, matches); - SuggestionIterator results = suggestionSearch.getResults(1, matches); - SuggestionItem suggestionItem = results.next(); + TestSuggestionIterator results = suggestionSearch.getResults(1, matches); + TestSuggestionItem suggestionItem = results.next(); assertEquals("Test ZIM file", suggestionItem.getTitle()); suggestionSearcher.dispose(); } -*/ + static public void main(String[] args) { Library lib = new Library(); From fb83f1154b284fe9e25ac4181b5b8976a2ccb2a1 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:34:29 +0200 Subject: [PATCH 2/9] Create the test zim file with a xapian FT index. --- lib/src/test/create_test_zimfiles | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/test/create_test_zimfiles b/lib/src/test/create_test_zimfiles index 4610b7d..95e0dfd 100755 --- a/lib/src/test/create_test_zimfiles +++ b/lib/src/test/create_test_zimfiles @@ -8,8 +8,7 @@ die() cd "$(dirname "$0")" rm -f small.zim -zimwriterfs --withoutFTIndex \ - -w main.html \ +zimwriterfs -w main.html \ -f favicon.png \ -l en \ -t "Test ZIM file" \ From 61faa653430d71a4a0fc6ea09e0af7150097aa9f Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:35:08 +0200 Subject: [PATCH 3/9] Addapt create_test_zimfiles to last zimwriterfs. --- lib/src/test/create_test_zimfiles | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/test/create_test_zimfiles b/lib/src/test/create_test_zimfiles index 95e0dfd..ac60bcd 100755 --- a/lib/src/test/create_test_zimfiles +++ b/lib/src/test/create_test_zimfiles @@ -9,10 +9,12 @@ die() cd "$(dirname "$0")" rm -f small.zim zimwriterfs -w main.html \ - -f favicon.png \ - -l en \ + -n "Test" \ + -I favicon.png \ + -l eng \ -t "Test ZIM file" \ -d "N/A" \ + -L "Test File" \ -c "N/A" \ -p "N/A" \ small_zimfile_data \ From c7ac3a0878686e1e0b9ab18c4af4927dff5b9066 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:36:36 +0200 Subject: [PATCH 4/9] Update test zim file. zim files have been created using a recent version of zimwriterfs (including the fix for openzim/zim-tools#355 --- lib/src/test/small.zim | Bin 4070 -> 66910 bytes lib/src/test/small.zim.embedded | Bin 4084 -> 66924 bytes lib/src/test/test.java | 14 +++++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/src/test/small.zim b/lib/src/test/small.zim index cb7072da6ec68a73f35bfe73c81c745b087ae8d5..eb9674bd6a7809353ab0313919d1bd0586d26857 100644 GIT binary patch literal 66910 zcmeI*c|4SB-vID?%-HumQX_Pdoyb;FlqFk{r6XoCV@%DAWd=hW(neBb3l*nCi|9!U zC0Vl-qLLhIRA?iTB=0?Pdd}%R@B99D-sgEfzxjNw`Ca#YU31^p{hiTteP-r&ZMU(< z@gNwa%0#!a+U<0Vsl})8q5wKh5hg{&Qb)>vdV zOWTh{r+uph(1=vVAF8H4e#9UqnYA{U<*RA5Fd_&b00JNY0w4ea|Ca!_>UHf|#BVtt zlGbXds(8tj7x7g>Qa|al(`2@NHL_kk`qb&9$dRODc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Q{%xW-?BYFCDDe7bFP+oIvcHUz%5vT7)VAvcb71HL)ZgO@bXL;gVRAimIFiB$`^BT$EW* zl9@kUhnbOE7$^h=K8bnhrHSbv9n&W=Gm6#&&4xPw30i{9`(~D7U zVg`w3mgE49bB6|y4@e9MSpJ$D~Hr z;yJAcYK6DX96j>(88=U@UG4!#{k-&GXOvUXwQY^3G*D625QlO>EVfabt6$ z`paCQZTb}x|9MT~{Fi6*xb*x{rkj$ix~J}3QNQkJ+HCq=-|~4g(}Vr5`0r2H{WC0r zf#GJ!Nihb-`;04qK_I-1ZJM0{Z#OtJ7$c(?Ie^~on+aSI9pA diff --git a/lib/src/test/test.java b/lib/src/test/test.java index 8a636cb..a7d0b6c 100644 --- a/lib/src/test/test.java +++ b/lib/src/test/test.java @@ -49,14 +49,18 @@ public class test { private void testArchive(TestArchive archive) throws IOException { // test the zim file main page title - assertEquals("Test ZIM file", archive.getMainEntry().getTitle()); - // test zim file size - assertEquals(4070, archive.getFilesize()); // The file size is in KiB + TestEntry mainPage = archive.getMainEntry(); + assertEquals("mainPage", mainPage.getTitle()); + assertEquals("Test ZIM file", mainPage.getItem(true).getTitle()); // test zim file main url - assertEquals("A/main.html", archive.getMainEntry().getPath()); + assertEquals("mainPage", mainPage.getPath()); + assertEquals("main.html", mainPage.getItem(true).getPath()); + + // test zim file size + assertEquals(66910, archive.getFilesize()); // The file size is in KiB // test zim file content byte[] mainData = getFileContent("small_zimfile_data/main.html"); - byte[] inZimMainData = archive.getEntryByPath("A/main.html").getItem(true).getData().getData(); + byte[] inZimMainData = archive.getEntryByPath("main.html").getItem(true).getData().getData(); assert(Arrays.equals(mainData, inZimMainData)); // test zim file icon From 7315228b06abf65c5a20461836a03d3f6b70cf08 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:38:00 +0200 Subject: [PATCH 5/9] Fix typos in search/suggestion getResults. --- lib/src/main/cpp/libzim/search.cpp | 2 +- lib/src/main/cpp/libzim/suggestion_search.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/main/cpp/libzim/search.cpp b/lib/src/main/cpp/libzim/search.cpp index 763bb2c..5e26433 100644 --- a/lib/src/main/cpp/libzim/search.cpp +++ b/lib/src/main/cpp/libzim/search.cpp @@ -37,7 +37,7 @@ DISPOSE METHOD(jobject, getResults, jint start, jint maxResults) { auto results = THIS->getResults(TO_C(start), TO_C(maxResults)); - auto obj = NEW_OBJECT("ork/kiwix/libzim/SearchIterator"); + auto obj = NEW_OBJECT("org/kiwix/libzim/SearchIterator"); SET_HANDLE(zim::SearchIterator, obj, results.begin()); // We have to set the nativeHandleEnd but no macro ease our work here. diff --git a/lib/src/main/cpp/libzim/suggestion_search.cpp b/lib/src/main/cpp/libzim/suggestion_search.cpp index 26fa783..27507d8 100644 --- a/lib/src/main/cpp/libzim/suggestion_search.cpp +++ b/lib/src/main/cpp/libzim/suggestion_search.cpp @@ -37,7 +37,7 @@ DISPOSE METHOD(jobject, getResults, jint start, jint maxResults) { auto results = THIS->getResults(TO_C(start), TO_C(maxResults)); - auto obj = NEW_OBJECT("ork/kiwix/libzim/SuggestionIterator"); + auto obj = NEW_OBJECT("org/kiwix/libzim/SuggestionIterator"); SET_HANDLE(zim::SuggestionIterator, obj, results.begin()); // We have to set the nativeHandleEnd but no macro ease our work here. From 1806febcf4f90adea471bf4ebd5edc6fc92315e3 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:38:47 +0200 Subject: [PATCH 6/9] Fix iterator `next`. `next` must return the "next" value. But here, the next value is the value of the current iterator. --- lib/src/main/cpp/libzim/search_iterator.cpp | 2 +- lib/src/main/cpp/libzim/suggestion_iterator.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/main/cpp/libzim/search_iterator.cpp b/lib/src/main/cpp/libzim/search_iterator.cpp index 6c04c7d..65e1342 100644 --- a/lib/src/main/cpp/libzim/search_iterator.cpp +++ b/lib/src/main/cpp/libzim/search_iterator.cpp @@ -64,8 +64,8 @@ METHOD0(jboolean, hasNext) { } METHOD0(jobject, next) { - (*THIS)++; zim::Entry entry = **THIS; + (*THIS)++; return BUILD_WRAPPER("org/kiwix/libzim/Entry", entry); } diff --git a/lib/src/main/cpp/libzim/suggestion_iterator.cpp b/lib/src/main/cpp/libzim/suggestion_iterator.cpp index 5181ae1..2d2c410 100644 --- a/lib/src/main/cpp/libzim/suggestion_iterator.cpp +++ b/lib/src/main/cpp/libzim/suggestion_iterator.cpp @@ -49,8 +49,8 @@ METHOD0(jboolean, hasNext) { } METHOD0(jobject, next) { - (*THIS)++; zim::SuggestionItem item = **THIS; + (*THIS)++; return BUILD_WRAPPER("org/kiwix/libzim/SuggestionItem", item); } From eaf9b3aac98f29820d6383d0ab716cf4ad664eda Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 21 Jun 2023 11:39:17 +0200 Subject: [PATCH 7/9] [test] Get the suggestion result from the first result. --- lib/src/test/test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/test/test.java b/lib/src/test/test.java index a7d0b6c..7d4b25e 100644 --- a/lib/src/test/test.java +++ b/lib/src/test/test.java @@ -199,7 +199,7 @@ public class test { TestSuggestionSearch suggestionSearch = suggestionSearcher.suggest("test"); int matches = (int) suggestionSearch.getEstimatedMatches(); assertEquals(1, matches); - TestSuggestionIterator results = suggestionSearch.getResults(1, matches); + TestSuggestionIterator results = suggestionSearch.getResults(0, matches); TestSuggestionItem suggestionItem = results.next(); assertEquals("Test ZIM file", suggestionItem.getTitle()); suggestionSearcher.dispose(); From 56fd73932e2c4c59d9dd591535f7156de0522417 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 28 Jun 2023 15:15:12 +0200 Subject: [PATCH 8/9] =?UTF-8?q?Run=20CI=C2=A0on=20PR=C2=A0and=20push=20on?= =?UTF-8?q?=20main.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 653568d..885bddf 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,8 +2,9 @@ name: Pull requests on: pull_request: + push: branches: - - '**' + - main jobs: From 15f42f07577047f80f585947b13009273f4a869d Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 28 Jun 2023 15:17:15 +0200 Subject: [PATCH 9/9] Make CodeFactor happy. --- lib/src/test/org/kiwix/test/libzim/TestQuery.java | 11 +++++++++-- lib/src/test/org/kiwix/test/libzim/TestSearcher.java | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/src/test/org/kiwix/test/libzim/TestQuery.java b/lib/src/test/org/kiwix/test/libzim/TestQuery.java index 24b4dcb..5a45f96 100644 --- a/lib/src/test/org/kiwix/test/libzim/TestQuery.java +++ b/lib/src/test/org/kiwix/test/libzim/TestQuery.java @@ -29,7 +29,14 @@ public class TestQuery inner = new Query(query); } - public TestQuery setQuery(String query) { inner.setQuery(query); return this; } - public TestQuery setGeorange(float latitude, float longitute, float distance) { inner.setGeorange(latitude, latitude, distance); return this; } + public TestQuery setQuery(String query) { + inner.setQuery(query); + return this; + } + + public TestQuery setGeorange(float latitude, float longitute, float distance) { + inner.setGeorange(latitude, latitude, distance); + return this; + } } diff --git a/lib/src/test/org/kiwix/test/libzim/TestSearcher.java b/lib/src/test/org/kiwix/test/libzim/TestSearcher.java index 4fd7de4..2259f0d 100644 --- a/lib/src/test/org/kiwix/test/libzim/TestSearcher.java +++ b/lib/src/test/org/kiwix/test/libzim/TestSearcher.java @@ -39,7 +39,10 @@ public class TestSearcher ); } - public TestSearcher addArchive(TestArchive archive) { inner.addArchive(archive.inner()); return this; } + public TestSearcher addArchive(TestArchive archive) { + inner.addArchive(archive.inner()); + return this; + } public TestSearch search(TestQuery query) { return new TestSearch(inner.search(query.inner())); } public void setVerbose(boolean verbose) { inner.setVerbose(verbose); }