diff options
Diffstat (limited to '3rdparty/googletest/googlemock/test')
4 files changed, 31 insertions, 29 deletions
diff --git a/3rdparty/googletest/googlemock/test/gmock-actions_test.cc b/3rdparty/googletest/googlemock/test/gmock-actions_test.cc index a665fc5fdb0..f470de4c55c 100644 --- a/3rdparty/googletest/googlemock/test/gmock-actions_test.cc +++ b/3rdparty/googletest/googlemock/test/gmock-actions_test.cc @@ -214,7 +214,7 @@ class MyNonDefaultConstructible { int value_; }; -#if GTEST_LANG_CXX11 +#if GTEST_HAS_STD_TYPE_TRAITS_ TEST(BuiltInDefaultValueTest, ExistsForDefaultConstructibleType) { EXPECT_TRUE(BuiltInDefaultValue<MyDefaultConstructible>::Exists()); @@ -224,7 +224,7 @@ TEST(BuiltInDefaultValueTest, IsDefaultConstructedForDefaultConstructibleType) { EXPECT_EQ(42, BuiltInDefaultValue<MyDefaultConstructible>::Get().value()); } -#endif // GTEST_LANG_CXX11 +#endif // GTEST_HAS_STD_TYPE_TRAITS_ TEST(BuiltInDefaultValueTest, DoesNotExistForNonDefaultConstructibleType) { EXPECT_FALSE(BuiltInDefaultValue<MyNonDefaultConstructible>::Exists()); diff --git a/3rdparty/googletest/googlemock/test/gmock-matchers_test.cc b/3rdparty/googletest/googlemock/test/gmock-matchers_test.cc index b09acba9d77..78c4c901bf5 100644 --- a/3rdparty/googletest/googlemock/test/gmock-matchers_test.cc +++ b/3rdparty/googletest/googlemock/test/gmock-matchers_test.cc @@ -1042,14 +1042,14 @@ TEST(IsNullTest, ReferenceToConstLinkedPtr) { EXPECT_FALSE(m.Matches(non_null_p)); } -#if GTEST_LANG_CXX11 +#if GTEST_HAS_STD_FUNCTION_ TEST(IsNullTest, StdFunction) { const Matcher<std::function<void()>> m = IsNull(); EXPECT_TRUE(m.Matches(std::function<void()>())); EXPECT_FALSE(m.Matches([]{})); } -#endif // GTEST_LANG_CXX11 +#endif // GTEST_HAS_STD_FUNCTION_ // Tests that IsNull() describes itself properly. TEST(IsNullTest, CanDescribeSelf) { @@ -1090,14 +1090,14 @@ TEST(NotNullTest, ReferenceToConstLinkedPtr) { EXPECT_TRUE(m.Matches(non_null_p)); } -#if GTEST_LANG_CXX11 +#if GTEST_HAS_STD_FUNCTION_ TEST(NotNullTest, StdFunction) { const Matcher<std::function<void()>> m = NotNull(); EXPECT_TRUE(m.Matches([]{})); EXPECT_FALSE(m.Matches(std::function<void()>())); } -#endif // GTEST_LANG_CXX11 +#endif // GTEST_HAS_STD_FUNCTION_ // Tests that NotNull() describes itself properly. TEST(NotNullTest, CanDescribeSelf) { @@ -2708,22 +2708,18 @@ class FloatingPointTest : public testing::Test { zero_bits_(Floating(0).bits()), one_bits_(Floating(1).bits()), infinity_bits_(Floating(Floating::Infinity()).bits()), - close_to_positive_zero_( - Floating::ReinterpretBits(zero_bits_ + max_ulps_/2)), - close_to_negative_zero_( - -Floating::ReinterpretBits(zero_bits_ + max_ulps_ - max_ulps_/2)), - further_from_negative_zero_(-Floating::ReinterpretBits( + close_to_positive_zero_(AsBits(zero_bits_ + max_ulps_/2)), + close_to_negative_zero_(AsBits(zero_bits_ + max_ulps_ - max_ulps_/2)), + further_from_negative_zero_(-AsBits( zero_bits_ + max_ulps_ + 1 - max_ulps_/2)), - close_to_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_)), - further_from_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_ + 1)), + close_to_one_(AsBits(one_bits_ + max_ulps_)), + further_from_one_(AsBits(one_bits_ + max_ulps_ + 1)), infinity_(Floating::Infinity()), - close_to_infinity_( - Floating::ReinterpretBits(infinity_bits_ - max_ulps_)), - further_from_infinity_( - Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)), + close_to_infinity_(AsBits(infinity_bits_ - max_ulps_)), + further_from_infinity_(AsBits(infinity_bits_ - max_ulps_ - 1)), max_(Floating::Max()), - nan1_(Floating::ReinterpretBits(Floating::kExponentBitMask | 1)), - nan2_(Floating::ReinterpretBits(Floating::kExponentBitMask | 200)) { + nan1_(AsBits(Floating::kExponentBitMask | 1)), + nan2_(AsBits(Floating::kExponentBitMask | 200)) { } void TestSize() { @@ -2804,6 +2800,12 @@ class FloatingPointTest : public testing::Test { // Some NaNs. const RawType nan1_; const RawType nan2_; + + private: + template <typename T> + static RawType AsBits(T value) { + return Floating::ReinterpretBits(static_cast<Bits>(value)); + } }; // Tests floating-point matchers with fixed epsilons. @@ -3179,6 +3181,8 @@ MATCHER_P(FieldIIs, inner_matcher, "") { return ExplainMatchResult(inner_matcher, arg.i, result_listener); } +#if GTEST_HAS_RTTI + TEST(WhenDynamicCastToTest, SameType) { Derived derived; derived.i = 4; @@ -3236,12 +3240,8 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) { TEST(WhenDynamicCastToTest, Describe) { Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_)); -#if GTEST_HAS_RTTI const string prefix = "when dynamic_cast to " + internal::GetTypeName<Derived*>() + ", "; -#else // GTEST_HAS_RTTI - const string prefix = "when dynamic_cast, "; -#endif // GTEST_HAS_RTTI EXPECT_EQ(prefix + "points to a value that is anything", Describe(matcher)); EXPECT_EQ(prefix + "does not point to a value that is anything", DescribeNegation(matcher)); @@ -3275,6 +3275,8 @@ TEST(WhenDynamicCastToTest, BadReference) { EXPECT_THAT(as_base_ref, Not(WhenDynamicCastTo<const OtherDerived&>(_))); } +#endif // GTEST_HAS_RTTI + // Minimal const-propagating pointer. template <typename T> class ConstPropagatingPtr { diff --git a/3rdparty/googletest/googlemock/test/gmock-spec-builders_test.cc b/3rdparty/googletest/googlemock/test/gmock-spec-builders_test.cc index 342c22f5de2..59ea87c894e 100644 --- a/3rdparty/googletest/googlemock/test/gmock-spec-builders_test.cc +++ b/3rdparty/googletest/googlemock/test/gmock-spec-builders_test.cc @@ -2117,8 +2117,8 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture { "NOTE: You can safely ignore the above warning unless this " "call should not happen. Do not suppress it by blindly adding " "an EXPECT_CALL() if you don't mean to enforce the call. " - "See http://code.google.com/p/googlemock/wiki/CookBook#" - "Knowing_When_to_Expect for details."; + "See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#" + "knowing-when-to-expect for details."; // A void-returning function. CaptureStdout(); diff --git a/3rdparty/googletest/googlemock/test/gmock_output_test_golden.txt b/3rdparty/googletest/googlemock/test/gmock_output_test_golden.txt index 650a8f07c71..689d5eeb037 100644 --- a/3rdparty/googletest/googlemock/test/gmock_output_test_golden.txt +++ b/3rdparty/googletest/googlemock/test/gmock_output_test_golden.txt @@ -75,14 +75,14 @@ GMOCK WARNING: Uninteresting mock function call - returning default value. Function call: Bar2(0, 1) Returns: false -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCall [ RUN ] GMockOutputTest.UninterestingCallToVoidFunction GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: Bar3(0, 1) -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCallToVoidFunction [ RUN ] GMockOutputTest.RetiredExpectation unknown file: Failure @@ -266,14 +266,14 @@ Uninteresting mock function call - taking default action specified at: FILE:#: Function call: Bar2(2, 2) Returns: true -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. GMOCK WARNING: Uninteresting mock function call - taking default action specified at: FILE:#: Function call: Bar2(1, 1) Returns: false -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCallWithDefaultAction [ RUN ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction |