Brad Bishop | 731171a | 2017-05-25 21:49:32 -0400 | [diff] [blame] | 1 | #include <array> |
| 2 | #include <string> |
| 3 | #include <gtest/gtest.h> |
| 4 | #include "data_types.hpp" |
| 5 | |
| 6 | using namespace phosphor::dbus::monitoring; |
| 7 | |
| 8 | #include "callbackgroupgentest.hpp" |
| 9 | |
| 10 | const std::array<std::vector<size_t>, 4> expectedGroups = {{ |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 11 | {0, 1, 2, 3}, |
| 12 | {0, 1, 4}, |
| 13 | {2, 6, 7}, |
| 14 | {7}, |
| 15 | }}; |
Brad Bishop | 731171a | 2017-05-25 21:49:32 -0400 | [diff] [blame] | 16 | |
| 17 | TEST(CallbackGroupGenTest, GroupsSameSize) |
| 18 | { |
| 19 | ASSERT_EQ(sizeof(expectedGroups), sizeof(groups)); |
| 20 | } |
| 21 | |
| 22 | TEST(CallbackGroupGenTest, GroupsSameContent) |
| 23 | { |
| 24 | size_t i; |
| 25 | for (i = 0; i < expectedGroups.size(); ++i) |
| 26 | { |
Brad Bishop | d1eac88 | 2018-03-29 10:34:05 -0400 | [diff] [blame] | 27 | ASSERT_EQ(groups[i], expectedGroups[i]); |
Brad Bishop | 731171a | 2017-05-25 21:49:32 -0400 | [diff] [blame] | 28 | } |
| 29 | } |