242 Commits

Author SHA1 Message Date
Matthieu Gautier
ce1f216108 Introduce TestBlob.java 2023-06-13 17:49:02 +02:00
Matthieu Gautier
80f6920201 Introduce TestItem.java 2023-06-13 17:46:21 +02:00
Matthieu Gautier
ff6469a34f Introduce TestEntry.java 2023-06-13 17:38:18 +02:00
Matthieu Gautier
d4f2f82e98 Introduce test package.
Jacoco don't track native methods, so our code coverage don't
include all the native methods, and it is exactly want we want to check.

By introducing a test package wrapping all native methods with a small
java function, we have the coverage of the wrapping methods.
2023-06-13 17:38:03 +02:00
MohitMaliFtechiz
07defa8356 Generating test binding and jacoco reports in build directory 2023-06-09 17:45:11 +02:00
Matthieu Gautier
8cc362730b
Merge pull request #30 from kiwix/Issue#29 2023-05-20 17:16:30 +02:00
Matthieu Gautier
932faed309 Switch ci to ubuntu 20.04 2023-05-20 17:07:25 +02:00
Matthieu Gautier
3577824507 Deactivate testSearcher() to fix.
`small.zim` doesn't seems to contain a xapian database, so searcher
cannot work.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
9dee22fd9d Illustration.height must return the height. 2023-05-20 17:07:25 +02:00
Matthieu Gautier
9312e32435 Fix illustration.
`Book::getIllustration(size)` return a `shared_ptr<Illustration>`.
The current `buildWrapper` was creating a wrapper on a
`shared_ptr<Illustration>` (so a `shared_ptr<shared_ptr<Illustration>>`)
but we was converting to a `shared_ptr<Illustration>` and so we were doing
wrong reads.

By specializing the buildWrapper for `shared_ptr<T>`, we avoid the
"double shared_ptr" and we are good.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
4d73e57c69 Fix Query.
Correctly include `org_kiwix_libwzim_Query.h`.
Property set the return type of setNativeQuery to void.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
915866a5fe Make Blob.getData return a byte[] instead of a String.
Blob IS a `char[]`. C++ allow a char[] to be stored in a string but in
java, a String is associated to a encoding.
Content in a Blob may have no encoding so we cannot convert to a string.

Fix the test part.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
81993af3c1 Correctly construct Book.
Introduce a new set of wrapper (with a nice `2` postfix) with use a
constructor taking a handle as parameter.
It allow Book to have two constructor:
- One creating a default empty (cpp) book.
- One setting the wrapper around a exsiting cpp book.
2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
a0fd51228c Added more test cases for bookmark 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
c38ccd8015 Added test cases for searcher, SuggestionSearcher. Added test cases for getting books from library 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
d6e4479621 Added test cases for checking is archive created with invalid zim file , added remove book from library by id tests 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
bea92d800d Fixed source file path in compileTestFile task 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
3fd6a01f0f Renamed generateHeader as buildHeader and buildLinuxSoFile as buildLinuxBinding for better naming 2023-05-20 17:07:23 +02:00
MohitMaliFtechiz
84235ee822 Removed javac bash commands to compile and run test cases, now we are using the gradle tasks to compile and run test cases 2023-05-20 17:06:32 +02:00
MohitMaliFtechiz
fb380e208a Removed dependency from date for copying the .so and headers files of (libkiwix, libzim) , Now we are renameing the folders names via renameFolders method 2023-05-20 17:06:31 +02:00
MohitMaliFtechiz
5ec2f412fe run_test.sh script now mostly run java compilation and run java program for testing. In this commit we are compiling, running java test cases for gradle task, So we are removing the run_test.sh as it is unused now 2023-05-20 17:05:18 +02:00
MohitMaliFtechiz
bc93a5deed Renamed compile_and_run_test.sh to run_test.sh as now this script is only for running test cases, removed unnecessary check for directory in run_test.sh 2023-05-20 17:05:18 +02:00
MohitMaliFtechiz
cee67f6129 Removed different tasks for coping libzim,libkiwix headers and .so files 2023-05-20 17:05:18 +02:00
MohitMaliFtechiz
f2dfa01a72 Generating .aar file for android and .so file for testing via CmakeList as we are generating the .so file in app/CMakeList now test/CMakeList file is unused so we are removing it 2023-05-20 17:05:18 +02:00
MohitMaliFtechiz
78c57aa361 Renamed generateHeaderFilesFromJavaWrapper method to generateHeaders for better readability 2023-05-20 17:05:18 +02:00
Kelson
66ebc4ecba
Merge pull request #27 from kiwix/FixBrokenCi
Fixes of Broken CI
2023-03-22 17:32:54 +01:00
MohitMaliFtechiz
160428de9d Changes after review 2023-03-22 17:02:01 +05:30
MohitMaliFtechiz
33dd97d5f4 Removed commented code 2023-03-22 15:26:23 +05:30
MohitMaliFtechiz
4ee1e7fddf Added new test cases for bookmark 2023-03-21 19:04:26 +05:30
MohitMaliFtechiz
57dd239b9a Remove bookmark test cases added 2023-03-21 18:21:53 +05:30
MohitMaliFtechiz
ee9a47df38 main.html has extra spaces, which small.zim file not containing so in this commit i have removed that extra spaces to pass test cases 2023-03-21 12:38:44 +05:30
Matthieu Gautier
285817f959 Fix creation of Bookmark.
Bookmark wrapper can be created using two ways:
- From a existing (cpp) bookmark (done internally by Library wrapper code)
- As a totally new one (empty) the java code will have to setup (using
  `set*` methods).

If the `Bookmark` constructor always create an empty new cpp bookmark,
when we set the wrapper to point to the existing bookmark, we will have a
leak of the new created bookmark.

As we want to keep the "basic" constructor as the normal java api to
create an empty bookmark, we need another (private) constructor to avoid
the construction of an empty bookmark.

The new constructor take a handle and directly set the `nativeHandle`.

On `Library.getBookmarks` we cannot use the helper `BUILD_WRAPPER` and
we must use "internal" function to use the `(J)V` constructor instead of
the basic `()V`.
2023-03-20 14:50:46 +01:00
Matthieu Gautier
3073712aa9 Fix typo in Library.getBookmarks
Fix @28
2023-03-20 14:28:17 +01:00
MohitMali
c5bf83ad0b Removed absolute path of JNI_INCLUDE_DIR 2023-03-16 11:25:55 +05:30
MohitMali
441a154881 Add book to library for bookmark test 2023-03-14 19:00:10 +05:30
MohitMali
97f2b4d3f4 Added searcher test cases 2023-03-14 19:00:00 +05:30
MohitMali
9a2573e7ca Removed extra spaces from main.html, we have tested small.zim and there is no extra space in it. 2023-03-14 18:59:45 +05:30
MohitMali
09539e209e Added test cases for libkiwix package 2023-03-14 18:52:33 +05:30
MohitMali
7d073926c9 Re-enable failed test cases 2023-03-13 19:05:24 +05:30
MohitMali
45f3e86801 Fixed jacoco report path 2023-03-13 18:55:48 +05:30
MohitMali
9d962a3af1 Fixed generated jar path 2023-03-13 18:38:42 +05:30
MohitMali
306916fc5c Fixed jni directory in test cases 2023-03-10 16:54:46 +05:30
MohitMali
38043b0b67 Refactored test cases 2023-03-10 16:37:21 +05:30
MohitMali
f427d53957 Fix cpp error while compiling 2023-03-06 17:39:57 +05:30
MohitMali
37618f2c63 Reverting minSdk,targetSdk version 2023-03-06 15:47:35 +05:30
MohitMali
9b7067ddd2 Fix path according to new folder structure 2023-03-03 18:38:40 +05:30
MohitMali
f7e4a5be6c Fix path of compiled so file 2023-03-03 18:23:08 +05:30
MohitMali
e14a12324e Removed wrapper.app from testing 2023-03-03 17:10:04 +05:30
MohitMali
49de5c457e Include new wrapper files in test CmakeLists file 2023-03-03 16:08:53 +05:30
Kelson
4b5cc44577
Merge pull request #23 from kiwix/adapt_wrapper
Adapt wrapper to new API of libzim/libkiwix
2023-02-09 17:28:25 +01:00