summaryrefslogtreecommitdiffstats
path: root/src/test/callbackgentest.cpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-05-25 21:31:58 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-19 16:26:47 -0400
commit3ce5c484aa9d25927b106f9bd3f819ec861176ad (patch)
treeaa8f818fd9456129035fdca375b5b7cba3e80bfa /src/test/callbackgentest.cpp
parentc1283ae8472dbd4e2c3593b76b7600ac72640b80 (diff)
downloadphosphor-dbus-monitor-3ce5c484aa9d25927b106f9bd3f819ec861176ad.tar.gz
phosphor-dbus-monitor-3ce5c484aa9d25927b106f9bd3f819ec861176ad.zip
Add testcase for callbacks
Change-Id: Iff1ddb9c18b5384d05a4d2dbfba95ade8cc1783c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'src/test/callbackgentest.cpp')
-rw-r--r--src/test/callbackgentest.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/callbackgentest.cpp b/src/test/callbackgentest.cpp
new file mode 100644
index 0000000..77fe60a
--- /dev/null
+++ b/src/test/callbackgentest.cpp
@@ -0,0 +1,35 @@
+#include <array>
+#include <string>
+#include <gtest/gtest.h>
+#include "data_types.hpp"
+
+using namespace phosphor::dbus::monitoring;
+
+using Index = std::map<std::tuple<size_t, size_t, size_t>, size_t>;
+
+#include "callbackgentest.hpp"
+
+const std::array<std::tuple<std::string, size_t>, 4> expectedCallbacks =
+{
+ {
+ std::tuple<std::string, size_t>{"int32_t", 0},
+ std::tuple<std::string, size_t>{"int32_t", 0},
+ std::tuple<std::string, size_t>{"std::string", 1},
+ std::tuple<std::string, size_t>{"std::string", 2},
+ }
+};
+
+TEST(CallbackGenTest, CallbacksSameSize)
+{
+ ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks));
+}
+
+TEST(CallbackGenTest, CallbacksSameContent)
+{
+ size_t i;
+ for (i = 0; i < expectedCallbacks.size(); ++i)
+ {
+ ASSERT_EQ(callbacks[i],
+ expectedCallbacks[i]);
+ }
+}
OpenPOWER on IntegriCloud