Closed MohitMaliFtechiz closed 1 year ago
@MohitMaliFtechiz This PR has to be based on #27, I don't understand how this can work otherwise.
@MohitMaliFtechiz This PR has to be based on #27, I don't understand how this can work otherwise.
@kelson42 , i have made this branch from #27 and after that added new test cases in it, Once #27 is merged i'll re base this PR on main branch.
currently test cases are failing of because Linux libzim tar file containing 0 bytes .so file, so i have open a ticket for it in libzim https://github.com/openzim/libzim/issues/772 .
For now i have made this branch from https://github.com/kiwix/java-libkiwix/pull/31 to avoid the build failure because of linux zim
file.
@mgautierfr , I am getting some errors while adding new test cases, can you please help me out on these errors.
When i am getting book from library Book book = lib.getBookById(bookIds[0]);
via this method . It is giving error in utils.h
/media/hp-pc03/D/java-libkiwix/lib/src/main/cpp/utils.h:71: void setPtr(JNIEnv*, jobject, std::shared_ptr<_Tp>&&, const char*) [with T = const kiwix::Book; JNIEnv = JNIEnv_; jobject = _jobject*]: Assertion `env->GetLongField(thisObj, fieldId) == 0' failed.
When i am making object of query to test searcher Query query = new Query("test");
it is giving error. I think it means , it is not persent in .so
file but we are including query.cpp
while building the .so
file. Is something missing in linux.so
file or we are doing something wrong here?.
java.lang.UnsatisfiedLinkError: 'long org.kiwix.libzim.Query.setNativeQuery(java.lang.String)'
at org.kiwix.libzim.Query.setNativeQuery(Native Method)
at org.kiwix.libzim.Query.<init>(Query.java:25)
at test.testSearcher(test.java:216)
When i am using suggestionSearch.getEstimatedMatches()
it is returning 0
results. But i have tried small.zim
with kiwix-app
and search for test
, there it is showing result in search result list
.
I have push all the latest test cases on this PR. Currently CI is not running, Can you please try to run these tests locally.
@mgautierfr any update?
@MohitMaliFtechiz First problem (setPtr) is fixed.
But there is something wrong in the build system. I've spend a lot of time try to fix a crash in java interpreter and it was because the test was using a old version of the java .class definition (I think). I suppose that buildsystem doesn't detect correctly that .class
have changed and don't update the one in the test
directory.
I'm looking for the two others issues.
But on my side, I face a new test failure where the illustration data is not equal to expected (test.java:137). It is probably because the String constructor interpret the bytes (and probably stop at first \0
).
:exclamation: No coverage uploaded for pull request base (
main@66ebc4e
). Click here to learn what that means. Patch has no changes to coverable lines.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
The branch now compile and tests are passing. Let's merge it and move on with a new iteration.
Fixes #29
In this PR we are adding new test cases for latest wrapper.