blob: 87f2b3526290e1ab58dee15c05c155ed7de51e3c [file] [log] [blame]
Patrick Venture3d6d3182018-08-31 09:33:09 -07001#include "data_types.hpp"
2
Brad Bishopb97bfff2017-05-25 22:14:54 -04003#include <array>
4#include <string>
Patrick Venture3d6d3182018-08-31 09:33:09 -07005
Brad Bishopb97bfff2017-05-25 22:14:54 -04006#include <gtest/gtest.h>
Brad Bishopb97bfff2017-05-25 22:14:54 -04007
8using namespace phosphor::dbus::monitoring;
9
10#include "conditiongentest.hpp"
11
Brad Bishopd1eac882018-03-29 10:34:05 -040012const std::array<std::vector<size_t>, 2> expectedGroups = {{
13 {0},
14 {1},
15}};
Brad Bishopb97bfff2017-05-25 22:14:54 -040016
Matthew Barth07c35132019-10-21 10:02:33 -050017const std::array<size_t, 6> expectedCallbacks = {
18 0, 0, 1, 1, 0, 1,
Brad Bishopb97bfff2017-05-25 22:14:54 -040019};
20
21TEST(ConditionGenTest, GroupsSameSize)
22{
23 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups));
24}
25
26TEST(ConditionGenTest, CallbacksSameSize)
27{
Matthew Barthbd31f392019-10-21 09:57:22 -050028 ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks));
Brad Bishopb97bfff2017-05-25 22:14:54 -040029}
30
31TEST(ConditionGenTest, GroupsSameContent)
32{
33 size_t i;
34 for (i = 0; i < expectedGroups.size(); ++i)
35 {
Brad Bishopd1eac882018-03-29 10:34:05 -040036 ASSERT_EQ(groups[i], expectedGroups[i]);
Brad Bishopb97bfff2017-05-25 22:14:54 -040037 }
38}
39
40TEST(ConditionGenTest, CallbacksSameContent)
41{
42 size_t i;
43 for (i = 0; i < expectedCallbacks.size(); ++i)
44 {
Brad Bishopd1eac882018-03-29 10:34:05 -040045 ASSERT_EQ(callbacks[i], expectedCallbacks[i]);
Brad Bishopb97bfff2017-05-25 22:14:54 -040046 }
47}