mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-09-18 09:03:33 -04:00
Add readOnly parameter to Manager::readOpds()
This commit is contained in:
1 parent
a855af4849
commit
fe9efe84ec
3 files changed
+33
-13
No files matched your search
@@ -246,6 +246,20 @@ const char sampleOpdsFeed[] = R"(
|
||||
</feed>
|
||||
)";
|
||||
|
||||
TEST(ManagerTest, readOpdsHonorsReadOnlyTrue)
|
||||
{
|
||||
// readOpds() defaults to readOnly=false (see
|
||||
// ManagerTest.readOpdsAddsEntriesAndParsesSearchMetadata below, which
|
||||
// covers that case) - this checks that readOnly=true is honored too.
|
||||
auto lib = kiwix::Library::create();
|
||||
kiwix::Manager manager(lib);
|
||||
|
||||
EXPECT_TRUE(manager.readOpds(sampleOpdsFeed, "http://example.com", /*readOnly=*/true));
|
||||
|
||||
EXPECT_TRUE(lib->getBookById("book1").readOnly());
|
||||
EXPECT_TRUE(lib->getBookById("book2").readOnly());
|
||||
}
|
||||
|
||||
TEST(ManagerTest, readOpdsAddsEntriesAndParsesSearchMetadata)
|
||||
{
|
||||
auto lib = kiwix::Library::create();
|
||||
|
||||
Reference in new issue
Block a user