summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-05-16 13:36:42 -0700
committerEd Tanous <ed.tanous@intel.com>2018-06-29 12:37:16 -0700
commitd4bb9bbd855e19b4b0032217db7b62489adafd9d (patch)
treeddaab525168727350c8b836069251913bf624dd7 /src
parentd425c6f6e1d99a5856169f12043feecdd0efc190 (diff)
downloadbmcweb-d4bb9bbd855e19b4b0032217db7b62489adafd9d.tar.gz
bmcweb-d4bb9bbd855e19b4b0032217db7b62489adafd9d.zip
Implement actions interface
This commit implements the actions interface, and cleans up some compatibility issues between phosphor rest and bmcweb. This should be considered WIP, as it requires patches to some of the dependent libraries to build (mostly sdbuspplus). Change-Id: Ida91461b0a0aff5d2d962e9e4053f056f4732af6 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/openbmc_jtag_rest_test.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/openbmc_jtag_rest_test.cpp b/src/openbmc_jtag_rest_test.cpp
new file mode 100644
index 0000000..7e40d6d
--- /dev/null
+++ b/src/openbmc_jtag_rest_test.cpp
@@ -0,0 +1,51 @@
+#include "openbmc_dbus_rest.hpp"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+TEST(OpenBmcDbusTest, TestArgSplit) {
+ // test the basic types
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
+ ::testing::ElementsAre("x"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("y"),
+ ::testing::ElementsAre("y"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b"),
+ ::testing::ElementsAre("b"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("n"),
+ ::testing::ElementsAre("n"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("q"),
+ ::testing::ElementsAre("q"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i"),
+ ::testing::ElementsAre("i"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("u"),
+ ::testing::ElementsAre("u"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
+ ::testing::ElementsAre("x"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("t"),
+ ::testing::ElementsAre("t"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("d"),
+ ::testing::ElementsAre("d"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("h"),
+ ::testing::ElementsAre("h"));
+ // test arrays
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ai"),
+ ::testing::ElementsAre("ai"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ax"),
+ ::testing::ElementsAre("ax"));
+ // test tuples
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)"),
+ ::testing::ElementsAre("(sss)"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)b"),
+ ::testing::ElementsAre("(sss)", "b"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b(sss)"),
+ ::testing::ElementsAre("b", "(sss)"));
+
+ // Test nested types
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a{si}b"),
+ ::testing::ElementsAre("a{si}", "b"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a(sss)b"),
+ ::testing::ElementsAre("a(sss)", "b"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("aa{si}b"),
+ ::testing::ElementsAre("aa{si}", "b"));
+ EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i{si}b"),
+ ::testing::ElementsAre("b", "aa{si}"));
+}
OpenPOWER on IntegriCloud