Make the UpdatableNameMapper keep a shared_ptr.

Same as `Manager`, we want to be sure that `Library` actually exists
when we use it.
This commit is contained in:
Matthieu Gautier
2023-09-25 16:13:52 +02:00
parent 139b561253
commit efcbf6ef1e
3 changed files with 6 additions and 6 deletions

View File

@ -110,7 +110,7 @@ TEST_F(NameMapperTest, HumanReadableNameMapperWithAliases)
TEST_F(NameMapperTest, UpdatableNameMapperWithoutAliases)
{
CapturedStderr stderror;
kiwix::UpdatableNameMapper nm(*lib, false);
kiwix::UpdatableNameMapper nm(lib, false);
EXPECT_EQ("", std::string(stderror));
checkUnaliasedEntriesInNameMapper(nm);
@ -126,7 +126,7 @@ TEST_F(NameMapperTest, UpdatableNameMapperWithoutAliases)
TEST_F(NameMapperTest, UpdatableNameMapperWithAliases)
{
CapturedStderr stderror;
kiwix::UpdatableNameMapper nm(*lib, true);
kiwix::UpdatableNameMapper nm(lib, true);
EXPECT_EQ(
"Path collision: /data/zero_four_2021-10.zim and"
" /data/zero_four_2021-11.zim can't share the same URL path 'zero_four'."