Patrick Venture | 3d6d318 | 2018-08-31 09:33:09 -0700 | [diff] [blame] | 1 | #include "data_types.hpp" |
| 2 | |
Brad Bishop | 3ce5c48 | 2017-05-25 21:31:58 -0400 | [diff] [blame] | 3 | #include <array> |
| 4 | #include <string> |
Patrick Venture | 3d6d318 | 2018-08-31 09:33:09 -0700 | [diff] [blame] | 5 | |
Brad Bishop | 3ce5c48 | 2017-05-25 21:31:58 -0400 | [diff] [blame] | 6 | #include <gtest/gtest.h> |
Brad Bishop | 3ce5c48 | 2017-05-25 21:31:58 -0400 | [diff] [blame] | 7 | |
| 8 | using namespace phosphor::dbus::monitoring; |
| 9 | |
| 10 | using Index = std::map<std::tuple<size_t, size_t, size_t>, size_t>; |
| 11 | |
| 12 | #include "callbackgentest.hpp" |
| 13 | |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 14 | const std::array<std::tuple<std::string, size_t>, 4> expectedCallbacks = {{ |
| 15 | std::tuple<std::string, size_t>{"int32_t", 0}, |
| 16 | std::tuple<std::string, size_t>{"int32_t", 0}, |
| 17 | std::tuple<std::string, size_t>{"std::string", 1}, |
| 18 | std::tuple<std::string, size_t>{"std::string", 2}, |
| 19 | }}; |
Brad Bishop | 3ce5c48 | 2017-05-25 21:31:58 -0400 | [diff] [blame] | 20 | |
| 21 | TEST(CallbackGenTest, CallbacksSameSize) |
| 22 | { |
| 23 | ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks)); |
| 24 | } |
| 25 | |
| 26 | TEST(CallbackGenTest, CallbacksSameContent) |
| 27 | { |
| 28 | size_t i; |
| 29 | for (i = 0; i < expectedCallbacks.size(); ++i) |
| 30 | { |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 31 | ASSERT_EQ(callbacks[i], expectedCallbacks[i]); |
Brad Bishop | 3ce5c48 | 2017-05-25 21:31:58 -0400 | [diff] [blame] | 32 | } |
| 33 | } |