blob: ab1e34aa2c37c4b6491a88681a407c21d74ad471 [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
4static const sdbusplus::vtable::vtable_t example[] =
5 {
6 sdbusplus::vtable::start(),
7 sdbusplus::vtable::method((const char*)1, (const char*)2,
8 (const char*)3,
9 (sd_bus_message_handler_t)4),
10 sdbusplus::vtable::signal((const char*)5, (const char*)6),
11 sdbusplus::vtable::property((const char*)7, (const char*)8,
12 (sd_bus_property_get_t)9,
13 sdbusplus::vtable::property_::const_),
14 sdbusplus::vtable::property((const char*)10, (const char*)11,
15 (sd_bus_property_get_t)12,
16 (sd_bus_property_set_t)13),
17 sdbusplus::vtable::property_o((const char*)14, (const char*)15, 16),
18 sdbusplus::vtable::end()
19 };
20
21extern const sd_bus_vtable example2[];
22extern const size_t example2_size;
23
Patrick Williamsa14167b2017-04-28 15:54:39 -050024TEST(VtableTest, SameSize)
Patrick Williams9d3ec7f2016-09-27 20:30:58 -050025{
Patrick Williamsa14167b2017-04-28 15:54:39 -050026 ASSERT_EQ(sizeof(example), example2_size);
27}
Patrick Williams9d3ec7f2016-09-27 20:30:58 -050028
Patrick Williamsa14167b2017-04-28 15:54:39 -050029TEST(VtableTest, SameContent)
30{
31 ASSERT_EQ(0, memcmp(example, example2, example2_size));
32}