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 "conditiongentest.hpp" 9 10 const std::array<std::vector<size_t>, 2> expectedGroups = {{ 11 {0}, 12 {1}, 13 }}; 14 15 const std::array<size_t, 4> expectedCallbacks = { 16 0, 17 0, 18 1, 19 1, 20 }; 21 22 TEST(ConditionGenTest, GroupsSameSize) 23 { 24 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups)); 25 } 26 27 TEST(ConditionGenTest, CallbacksSameSize) 28 { 29 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups)); 30 } 31 32 TEST(ConditionGenTest, GroupsSameContent) 33 { 34 size_t i; 35 for (i = 0; i < expectedGroups.size(); ++i) 36 { 37 ASSERT_EQ(groups[i], expectedGroups[i]); 38 } 39 } 40 41 TEST(ConditionGenTest, CallbacksSameContent) 42 { 43 size_t i; 44 for (i = 0; i < expectedCallbacks.size(); ++i) 45 { 46 ASSERT_EQ(callbacks[i], expectedCallbacks[i]); 47 } 48 } 49