Commit Graph
18 Commits
Author SHA1 Message Date
Hamazasp Avetisyan fe9efe84ec Add readOnly parameter to Manager::readOpds() 2026-08-29 21:32:26 +04:00
Hamazasp Avetisyan a855af4849 Preparation of test cases to support upcoming changes in readOpds interface 2026-08-29 21:32:26 +04:00
Hamazasp AvetisyanandClaude Sonnet 5 bfb148e4c5 Fix Manager::readFile() losing writableLibraryPath for new libraries
The fileExists() early-return skipped setting writableLibraryPath,
so relative --zimPathToSave resolved against CWD instead of the new
library's own directory when creating a library that doesn't exist yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 11:42:43 +04:00
Hamazasp Avetisyan f5e5f283ab Add resolveAbsPath() test helper
Wrap the recurring kiwix::computeAbsolutePath(kiwix::removeLastPathElement(...), ...)
pattern in a small helper and use it in addBookFromPathAndGetIdTest.
2026-08-24 10:58:57 +04:00
Hamazasp Avetisyan 5eb00fea04 Enhance readOpds() tests
Added couple of test cases to test readOpds() method deeper.
2026-08-15 16:36:44 +04:00
Hamazasp Avetisyan 01ae801044 Enhance readXml() tests
Check more of the fields populated by readXml(). Also fixed a return value bug of readXml() method.
2026-08-15 16:36:42 +04:00
Hamazasp Avetisyan db1320c077 Replace try/catch with explicit presence checks in parseOpdsDom()
totalResults/startIndex/itemsPerPage were parsed inside a try/catch,
but strtoull() never throws on malformed input, so a feed missing
those elements silently fell through with zeroed-out fields and no
way to distinguish "not a search result" from "search result of size
zero". Check each node's presence directly instead, and cover both
paths with new Manager tests.
2026-08-15 13:30:04 +04:00
Veloman Yunkan 8a3c4c92e0 Enhanced test library.xml with an entry not backed by a ZIM file
The test data was modified so that support for catalog only mode
of kiwix-serve can be properly tested.

The effect of this change in the test data on the library_server unit
test demonstrates that although the new entry does not appear in the
catalog (for example, no catalog_v2_entries* test cases were affected)
the category and language of this ghost entry slipped into the
observable output.
2025-09-08 18:39:48 +04:00
Matthieu Gautier 5182a66b19 Update test to have Windows paths on Windows 2024-08-27 13:17:53 +02:00
Matthieu Gautier 139b561253 Make the Manager keep a shared_ptr instead of a raw Library reference.
We want to be sure that `Library` actually exists when we modify it.
While it is not a silver bullet (user can still create a shared_ptr on
a raw pointer), making the `Manager` keep `shared_ptr` on the library
help us a lot here.
2023-09-25 16:30:56 +02:00
Matthieu Gautier c203e07ee9 Make the library creatable only within a shared_ptr. 2023-09-25 16:28:25 +02:00
Veloman Yunkan eb002ae306 Deprecated Book::getLanguage()
Introduced `Book::getCommaSeparatedLanguages()` instead.
2023-03-08 15:24:53 +01:00
Veloman Yunkan 3aeeeeee76 Manager::reload() 2021-11-30 18:20:27 +04:00
Matthieu Gautier b70c92cade Move back used helper functions to the public API.
- Add docstring
- Move the declaration in kiwix namespace.
- Adapt our include to include the right headers.
2021-07-07 14:43:13 +02:00
Matthieu Gautier fa83a61a54 Move all public *Tools.h in src.
This by definition remove all the tool functions from the public API.
2021-07-07 14:43:13 +02:00
Veloman Yunkan 0c7d19ab45 Testing of Manager.readXml() 2021-04-12 15:14:12 +02:00
Matthieu Gautier 17bc1a3e1a [TEST] Do not try to use the bookId if it is wrong. 2021-01-26 17:53:25 +01:00
luddens 0630298fb9 Manager::addBookFromPathAndGetId unit test 2020-04-28 10:56:12 +02:00