blob: bc6738233736bc6fb62ca3408b690f91b22a7c3a [file] [log] [blame]
Patrick Williams9d3ec7f2016-09-27 20:30:58 -05001#include <sdbusplus/vtable.hpp>
Patrick Williamsa14167b2017-04-28 15:54:39 -05002#include <gtest/gtest.h>
Patrick Williams9d3ec7f2016-09-27 20:30:58 -05003
Andrew Geissler072da3e2018-01-18 07:21:42 -08004static const sdbusplus::vtable::vtable_t example[] = {
5 sdbusplus::vtable::start(),
6 sdbusplus::vtable::method((const char*)1, (const char*)2, (const char*)3,
7 (sd_bus_message_handler_t)4),
8 sdbusplus::vtable::signal((const char*)5, (const char*)6),
9 sdbusplus::vtable::property((const char*)7, (const char*)8,
10 (sd_bus_property_get_t)9,
11 sdbusplus::vtable::property_::const_),
12 sdbusplus::vtable::property((const char*)10, (const char*)11,
13 (sd_bus_property_get_t)12,
14 (sd_bus_property_set_t)13),
15 sdbusplus::vtable::property_o((const char*)14, (const char*)15, 16),
16 sdbusplus::vtable::end()};
Patrick Williams9d3ec7f2016-09-27 20:30:58 -050017
18extern const sd_bus_vtable example2[];
19extern const size_t example2_size;
20
Patrick Williamsa14167b2017-04-28 15:54:39 -050021TEST(VtableTest, SameSize)
Patrick Williams9d3ec7f2016-09-27 20:30:58 -050022{
Patrick Williamsa14167b2017-04-28 15:54:39 -050023 ASSERT_EQ(sizeof(example), example2_size);
24}
Patrick Williams9d3ec7f2016-09-27 20:30:58 -050025
Patrick Williamsa14167b2017-04-28 15:54:39 -050026TEST(VtableTest, SameContent)
27{
28 ASSERT_EQ(0, memcmp(example, example2, example2_size));
29}