test/type_traits: Convert to gtest

This is a fairly minimal and non-invasive change. This test doesn't
really require the googletest framework since it is just using
static_asserts. However, this moves us toward uniform testing.

Change-Id: I35d507cf6c97384146120d4f8f1b5a2e52834a6d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index 442d084..b7b6a03 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -52,8 +52,7 @@
 
 check_PROGRAMS += utility_type_traits
 utility_type_traits_SOURCES = utility/type_traits.cpp
-utility_type_traits_CXXFLAGS = $(legacy_test_cxxflags)
-utility_type_traits_LDADD = $(legacy_test_ldadd)
+utility_type_traits_LDADD = $(gtest_ldadd)
 
 check_PROGRAMS += vtable_vtable
 vtable_vtable_SOURCES = vtable/vtable.cpp vtable/vtable_c.c
diff --git a/test/utility/type_traits.cpp b/test/utility/type_traits.cpp
index f2beed7..1a411f7 100644
--- a/test/utility/type_traits.cpp
+++ b/test/utility/type_traits.cpp
@@ -1,21 +1,27 @@
+#include <gtest/gtest.h>
 #include <sdbusplus/utility/type_traits.hpp>
+#include <type_traits>
 
-int main()
+namespace
 {
-    using sdbusplus::utility::array_to_ptr_t;
 
-    static_assert(std::is_same<char, array_to_ptr_t<char, char>>::value,
+using sdbusplus::utility::array_to_ptr_t;
+using std::is_same;
+
+TEST(TypeTraits, Basic)
+{
+
+    static_assert(is_same<char, array_to_ptr_t<char, char>>::value,
                   "array_to_ptr_t<char, char> != char");
 
-    static_assert(std::is_same<char*, array_to_ptr_t<char, char*>>::value,
+    static_assert(is_same<char*, array_to_ptr_t<char, char*>>::value,
                   "array_to_ptr_t<char, char*> != char*");
 
-    static_assert(std::is_same<char*, array_to_ptr_t<char, char[100]>>::value,
+    static_assert(is_same<char*, array_to_ptr_t<char, char[100]>>::value,
                   "array_to_ptr_t<char, char[100]> != char*");
 
-    static_assert(
-        std::is_same<char[100], array_to_ptr_t<int, char[100]>>::value,
-        "array_to_ptr_t<int, char[100]> != char[100]");
-
-    return 0;
+    static_assert(is_same<char[100], array_to_ptr_t<int, char[100]>>::value,
+                  "array_to_ptr_t<int, char[100]> != char[100]");
 }
+
+} // namespace