diff options
author | Scott Graham <scottmg@chromium.org> | 2018-02-23 12:28:09 -0800 |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2018-02-23 12:28:09 -0800 |
commit | 567b40eeb15338402a204fc15362e553549aadea (patch) | |
tree | 4db0cd5c2083817db38aff755d70b479f1eb2e3b | |
parent | 3a4cf1a02ef4adc28fccb7eef2b573b14cd59009 (diff) | |
download | googletest-567b40eeb15338402a204fc15362e553549aadea.tar.gz googletest-567b40eeb15338402a204fc15362e553549aadea.tar.bz2 googletest-567b40eeb15338402a204fc15362e553549aadea.zip |
Try to handle unsigned wchar_t (arm) a bit better
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 2 | ||||
-rw-r--r-- | googlemock/test/gmock-actions_test.cc | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 319b389b..37ceb549 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 f7218391..9447c22b 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<signed wchar_t>::Get()); #endif #if GMOCK_WCHAR_T_IS_NATIVE_ +#if !defined(__WCHAR_UNSIGNED__) EXPECT_EQ(0, BuiltInDefaultValue<wchar_t>::Get()); +#else + EXPECT_EQ(0U, BuiltInDefaultValue<wchar_t>::Get()); +#endif #endif EXPECT_EQ(0U, BuiltInDefaultValue<unsigned short>::Get()); // NOLINT EXPECT_EQ(0, BuiltInDefaultValue<signed short>::Get()); // NOLINT |