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