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, 6> expectedCallbacks = {
18 0, 0, 1, 1, 0, 1,
19 };
20
TEST(ConditionGenTest,GroupsSameSize)21 TEST(ConditionGenTest, GroupsSameSize)
22 {
23 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups));
24 }
25
TEST(ConditionGenTest,CallbacksSameSize)26 TEST(ConditionGenTest, CallbacksSameSize)
27 {
28 ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks));
29 }
30
TEST(ConditionGenTest,GroupsSameContent)31 TEST(ConditionGenTest, GroupsSameContent)
32 {
33 size_t i;
34 for (i = 0; i < expectedGroups.size(); ++i)
35 {
36 ASSERT_EQ(groups[i], expectedGroups[i]);
37 }
38 }
39
TEST(ConditionGenTest,CallbacksSameContent)40 TEST(ConditionGenTest, CallbacksSameContent)
41 {
42 size_t i;
43 for (i = 0; i < expectedCallbacks.size(); ++i)
44 {
45 ASSERT_EQ(callbacks[i], expectedCallbacks[i]);
46 }
47 }
48