Brad Bishop | ca2a841 | 2018-12-13 12:35:35 -0500 | [diff] [blame] | 1 | #include "../serialize.hpp" |
Brad Bishop | a248550 | 2019-04-15 15:59:28 -0400 | [diff] [blame] | 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | using namespace phosphor::inventory::manager; |
| 6 | using namespace std::string_literals; |
| 7 | |
| 8 | TEST(SerializeTest, TestStoragePathNoSlashes) |
| 9 | { |
| 10 | auto path = "foo/bar/baz"s; |
| 11 | auto iface = "xyz.foo"s; |
| 12 | auto p1 = detail::getStoragePath(path, iface); |
| 13 | auto p2 = fs::path(PIM_PERSIST_PATH "/foo/bar/baz/xyz.foo"); |
| 14 | EXPECT_EQ(p1, p2); |
| 15 | } |
| 16 | |
| 17 | TEST(SerializeTest, TestStoragePathSlashes) |
| 18 | { |
| 19 | auto path = "/foo/bar/baz"s; |
| 20 | auto iface = "/xyz.foo"s; |
| 21 | auto p1 = detail::getStoragePath(path, iface); |
| 22 | auto p2 = fs::path(PIM_PERSIST_PATH "/foo/bar/baz/xyz.foo"); |
| 23 | EXPECT_EQ(p1, p2); |
| 24 | } |