1 #include "data_types.hpp" 2 3 #include <array> 4 #include <string> 5 6 #include <gtest/gtest.h> 7 8 using namespace phosphor::dbus::monitoring; 9 10 #include "conditiongentest.hpp" 11 12 const std::array<std::vector<size_t>, 2> expectedGroups = {{ 13 {0}, 14 {1}, 15 }}; 16 17 const std::array<size_t, 4> expectedCallbacks = { 18 0, 19 0, 20 1, 21 1, 22 }; 23 24 TEST(ConditionGenTest, GroupsSameSize) 25 { 26 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups)); 27 } 28 29 TEST(ConditionGenTest, CallbacksSameSize) 30 { 31 ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks)); 32 } 33 34 TEST(ConditionGenTest, GroupsSameContent) 35 { 36 size_t i; 37 for (i = 0; i < expectedGroups.size(); ++i) 38 { 39 ASSERT_EQ(groups[i], expectedGroups[i]); 40 } 41 } 42 43 TEST(ConditionGenTest, CallbacksSameContent) 44 { 45 size_t i; 46 for (i = 0; i < expectedCallbacks.size(); ++i) 47 { 48 ASSERT_EQ(callbacks[i], expectedCallbacks[i]); 49 } 50 } 51