mirror of https://github.com/kiwix/libkiwix.git
Fix library test on windows.
This commit is contained in:
parent
89582d526e
commit
4ca9558e30
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Tommi Maekitalo
|
* Copyright (C) 2019 Matthieu Gautier <mgautier@kymeria.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
@ -262,8 +262,13 @@ TEST_F(LibraryTest, filterCheck)
|
||||||
TEST_F(LibraryTest, getBookByPath)
|
TEST_F(LibraryTest, getBookByPath)
|
||||||
{
|
{
|
||||||
auto& book = lib.getBookById(lib.getBooksIds()[0]);
|
auto& book = lib.getBookById(lib.getBooksIds()[0]);
|
||||||
book.setPath("/some/abs/path.zim");
|
#ifdef _WIN32
|
||||||
EXPECT_EQ(lib.getBookByPath("/some/abs/path.zim").getId(), book.getId());
|
auto path = "C:\\some\\abs\\path.zim";
|
||||||
|
#else
|
||||||
|
auto path = "/some/abs/path.zim";
|
||||||
|
#endif
|
||||||
|
book.setPath(path);
|
||||||
|
EXPECT_EQ(lib.getBookByPath(path).getId(), book.getId());
|
||||||
EXPECT_THROW(lib.getBookByPath("non/existant/path.zim"), std::out_of_range);
|
EXPECT_THROW(lib.getBookByPath("non/existant/path.zim"), std::out_of_range);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue