diff --git a/xpcom/tests/TestXPIDLString.cpp b/xpcom/tests/gtest/TestXPIDLString.cpp similarity index 73% rename from xpcom/tests/TestXPIDLString.cpp rename to xpcom/tests/gtest/TestXPIDLString.cpp index d85cdd56fe6d..94e794d5716d 100644 --- a/xpcom/tests/TestXPIDLString.cpp +++ b/xpcom/tests/gtest/TestXPIDLString.cpp @@ -1,6 +1,7 @@ #include "nsString.h" #include "nsReadableUtils.h" #include "nsXPIDLString.h" +#include "gtest/gtest.h" static void nsXPIDLStringTest_Value(char16_t** aResult) @@ -8,11 +9,10 @@ nsXPIDLStringTest_Value(char16_t** aResult) *aResult = ToNewUnicode(NS_LITERAL_STRING("Hello, World")); } -int -main(int argc, char* argv[]) +TEST(XPIDLString, Main) { nsXPIDLString s1; nsXPIDLStringTest_Value(getter_Copies(s1)); - return 0; + EXPECT_TRUE(s1.EqualsLiteral("Hello, World")); } diff --git a/xpcom/tests/gtest/moz.build b/xpcom/tests/gtest/moz.build index 4a04a2be0c16..54bf5ab3ea54 100644 --- a/xpcom/tests/gtest/moz.build +++ b/xpcom/tests/gtest/moz.build @@ -20,6 +20,7 @@ UNIFIED_SOURCES += [ 'TestThreadPool.cpp', 'TestTimeStamp.cpp', 'TestUTF.cpp', + 'TestXPIDLString.cpp', ] FINAL_LIBRARY = 'xul-gtest' diff --git a/xpcom/tests/moz.build b/xpcom/tests/moz.build index 6d97acccccf8..28dff1b61cf5 100644 --- a/xpcom/tests/moz.build +++ b/xpcom/tests/moz.build @@ -81,7 +81,6 @@ if CONFIG['MOZ_MEMORY']: # XXX Make these tests work in libxul builds. #CPP_UNIT_TESTS += [ # 'TestThreads', -# 'TestXPIDLString', # 'TestAtoms', #]