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