From 567b40eeb15338402a204fc15362e553549aadea Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Fri, 23 Feb 2018 12:28:09 -0800 Subject: Try to handle unsigned wchar_t (arm) a bit better --- googlemock/include/gmock/internal/gmock-internal-utils.h | 2 ++ googlemock/test/gmock-actions_test.cc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 319b389..37ceb54 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -117,9 +117,11 @@ struct LinkedPtrLessThan { // To gcc, // wchar_t == signed wchar_t != unsigned wchar_t == unsigned int #ifdef __GNUC__ +#if !defined(__WCHAR_UNSIGNED__) // signed/unsigned wchar_t are valid types. # define GMOCK_HAS_SIGNED_WCHAR_T_ 1 #endif +#endif // In what follows, we use the term "kind" to indicate whether a type // is bool, an integer type (excluding bool), a floating-point type, diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index f721839..9447c22 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -107,7 +107,11 @@ TEST(BuiltInDefaultValueTest, IsZeroForNumericTypes) { EXPECT_EQ(0, BuiltInDefaultValue::Get()); #endif #if GMOCK_WCHAR_T_IS_NATIVE_ +#if !defined(__WCHAR_UNSIGNED__) EXPECT_EQ(0, BuiltInDefaultValue::Get()); +#else + EXPECT_EQ(0U, BuiltInDefaultValue::Get()); +#endif #endif EXPECT_EQ(0U, BuiltInDefaultValue::Get()); // NOLINT EXPECT_EQ(0, BuiltInDefaultValue::Get()); // NOLINT -- cgit v0.12 From 7a2050d4d7eea672716a7d85c2fee2607879862a Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 1 Mar 2018 13:19:34 -0800 Subject: Use a full message in the JSON output for failures The full message unlike summary also includes stack trace. --- googletest/src/gtest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 15cc907..74c43a4 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -4012,9 +4012,9 @@ void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream, const std::string location = internal::FormatCompilerIndependentFileLocation(part.file_name(), part.line_number()); - const std::string summary = EscapeJson(location + "\n" + part.summary()); + const std::string message = EscapeJson(location + "\n" + part.message()); *stream << kIndent << " {\n" - << kIndent << " \"failure\": \"" << summary << "\",\n" + << kIndent << " \"failure\": \"" << message << "\",\n" << kIndent << " \"type\": \"\"\n" << kIndent << " }"; } -- cgit v0.12