blob: 87bf160095f311e3fa46c82f4ae5aef20e403ef0 [file] [log] [blame]
Patrick Venture3d6d3182018-08-31 09:33:09 -07001#include "data_types.hpp"
2
Brad Bishop3ce5c482017-05-25 21:31:58 -04003#include <array>
4#include <string>
Patrick Venture3d6d3182018-08-31 09:33:09 -07005
Brad Bishop3ce5c482017-05-25 21:31:58 -04006#include <gtest/gtest.h>
Brad Bishop3ce5c482017-05-25 21:31:58 -04007
8using namespace phosphor::dbus::monitoring;
9
10using Index = std::map<std::tuple<size_t, size_t, size_t>, size_t>;
11
12#include "callbackgentest.hpp"
13
Brad Bishopd1eac882018-03-29 10:34:05 -040014const std::array<std::tuple<std::string, size_t>, 4> expectedCallbacks = {{
15 std::tuple<std::string, size_t>{"int32_t", 0},
16 std::tuple<std::string, size_t>{"int32_t", 0},
17 std::tuple<std::string, size_t>{"std::string", 1},
18 std::tuple<std::string, size_t>{"std::string", 2},
19}};
Brad Bishop3ce5c482017-05-25 21:31:58 -040020
21TEST(CallbackGenTest, CallbacksSameSize)
22{
23 ASSERT_EQ(sizeof(expectedCallbacks), sizeof(callbacks));
24}
25
26TEST(CallbackGenTest, CallbacksSameContent)
27{
28 size_t i;
29 for (i = 0; i < expectedCallbacks.size(); ++i)
30 {
Brad Bishopd1eac882018-03-29 10:34:05 -040031 ASSERT_EQ(callbacks[i], expectedCallbacks[i]);
Brad Bishop3ce5c482017-05-25 21:31:58 -040032 }
33}