blob: a3dbe416b973868c79f8aabda949f0e71e740599 [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
Brad Bishopd1eac882018-03-29 10:34:05 -040017const std::array<size_t, 4> expectedCallbacks = {
Brad Bishopb97bfff2017-05-25 22:14:54 -040018 0,
19 0,
20 1,
21 1,
22};
23
24TEST(ConditionGenTest, GroupsSameSize)
25{
26 ASSERT_EQ(sizeof(expectedGroups), sizeof(groups));
27}
28
29TEST(ConditionGenTest, CallbacksSameSize)
30{
Matthew Barthbd31f392019-10-21 09:57:22 -050031 ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks));
Brad Bishopb97bfff2017-05-25 22:14:54 -040032}
33
34TEST(ConditionGenTest, GroupsSameContent)
35{
36 size_t i;
37 for (i = 0; i < expectedGroups.size(); ++i)
38 {
Brad Bishopd1eac882018-03-29 10:34:05 -040039 ASSERT_EQ(groups[i], expectedGroups[i]);
Brad Bishopb97bfff2017-05-25 22:14:54 -040040 }
41}
42
43TEST(ConditionGenTest, CallbacksSameContent)
44{
45 size_t i;
46 for (i = 0; i < expectedCallbacks.size(); ++i)
47 {
Brad Bishopd1eac882018-03-29 10:34:05 -040048 ASSERT_EQ(callbacks[i], expectedCallbacks[i]);
Brad Bishopb97bfff2017-05-25 22:14:54 -040049 }
50}