blob: 7061978b4e8e05a079676cdf498d4eaa2b79dea9 [file] [log] [blame]
Brad Bishopca2a8412018-12-13 12:35:35 -05001#include "../serialize.hpp"
Brad Bishopa2485502019-04-15 15:59:28 -04002
3#include <gtest/gtest.h>
4
5using namespace phosphor::inventory::manager;
6using namespace std::string_literals;
7
8TEST(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
17TEST(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}