openbmc_dbus_rest_test: revive tests
The test today exists but it isn't enabled. This commit revives the
test, and fixed obsolete interfaces.
This commit also fixes the test case "i{si}b", which should be split
into {"i", "{si}", "b"}. Existing values might be typos.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I962c349c237d59be89337af5df88d3ee6f625f13
diff --git a/meson.build b/meson.build
index 8724c62..59b6887 100644
--- a/meson.build
+++ b/meson.build
@@ -398,6 +398,7 @@
'redfish-core/ut/registries_test.cpp',
'redfish-core/ut/stl_utils_test.cpp',
'redfish-core/ut/time_utils_test.cpp',
+ 'src/openbmc_jtag_rest_test.cpp',
]
if(get_option('tests').enabled())
diff --git a/src/openbmc_jtag_rest_test.cpp b/src/openbmc_jtag_rest_test.cpp
index 42504d3..cb262e0 100644
--- a/src/openbmc_jtag_rest_test.cpp
+++ b/src/openbmc_jtag_rest_test.cpp
@@ -6,48 +6,48 @@
TEST(OpenBmcDbusTest, TestArgSplit)
{
// test the basic types
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("x"),
::testing::ElementsAre("x"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("y"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("y"),
::testing::ElementsAre("y"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("b"),
::testing::ElementsAre("b"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("n"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("n"),
::testing::ElementsAre("n"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("q"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("q"),
::testing::ElementsAre("q"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("i"),
::testing::ElementsAre("i"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("u"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("u"),
::testing::ElementsAre("u"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("x"),
::testing::ElementsAre("x"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("t"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("t"),
::testing::ElementsAre("t"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("d"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("d"),
::testing::ElementsAre("d"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("h"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("h"),
::testing::ElementsAre("h"));
// test arrays
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ai"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("ai"),
::testing::ElementsAre("ai"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ax"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("ax"),
::testing::ElementsAre("ax"));
// test tuples
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("(sss)"),
::testing::ElementsAre("(sss)"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)b"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("(sss)b"),
::testing::ElementsAre("(sss)", "b"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b(sss)"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("b(sss)"),
::testing::ElementsAre("b", "(sss)"));
// Test nested types
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a{si}b"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("a{si}b"),
::testing::ElementsAre("a{si}", "b"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a(sss)b"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("a(sss)b"),
::testing::ElementsAre("a(sss)", "b"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("aa{si}b"),
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("aa{si}b"),
::testing::ElementsAre("aa{si}", "b"));
- EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i{si}b"),
- ::testing::ElementsAre("b", "aa{si}"));
+ EXPECT_THAT(crow::openbmc_mapper::dbusArgSplit("i{si}b"),
+ ::testing::ElementsAre("i", "{si}", "b"));
}