test: convert vtable to gtest

Change-Id: Ic54957df1c8d08c5461b262628fd1cc5c27217d7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/Makefile.am b/test/Makefile.am
index bc1ede9..500f7c5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,6 @@
 if WANT_LIBSDBUSPLUS
 
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) $(GTEST_CPPFLAGS)
 check_PROGRAMS =
 
 TESTS = $(check_PROGRAMS)
@@ -33,5 +33,6 @@
 
 check_PROGRAMS += vtable_vtable
 vtable_vtable_SOURCES = vtable/vtable.cpp vtable/vtable_c.c
+vtable_vtable_LDFLAGS = -lgtest -lgtest_main
 
 endif
diff --git a/test/vtable/vtable.cpp b/test/vtable/vtable.cpp
index 8b11366..ab1e34a 100644
--- a/test/vtable/vtable.cpp
+++ b/test/vtable/vtable.cpp
@@ -1,5 +1,5 @@
 #include <sdbusplus/vtable.hpp>
-#include <cassert>
+#include <gtest/gtest.h>
 
 static const sdbusplus::vtable::vtable_t example[] =
     {
@@ -21,10 +21,12 @@
 extern const sd_bus_vtable example2[];
 extern const size_t example2_size;
 
-int main(int argc, char** argv)
+TEST(VtableTest, SameSize)
 {
-    assert(sizeof(example) == example2_size);
-    assert(0 == memcmp(example, example2, example2_size));
+    ASSERT_EQ(sizeof(example), example2_size);
+}
 
-    return 0;
-};
+TEST(VtableTest, SameContent)
+{
+    ASSERT_EQ(0, memcmp(example, example2, example2_size));
+}