diff options
author | Gennadiy Civil <misterg@google.com> | 2018-11-14 02:10:41 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-11-14 02:10:42 (GMT) |
commit | 7a0680dc223088211807f1b19598dfe01b3bab8b (patch) | |
tree | 8cc0e01ea848a037e681143cb521bc08e4132c5b /googlemock/test/gmock-generated-function-mockers_test.cc | |
parent | b18d39bd2ea2d2b508228a9a1d8ae9f7fba32f78 (diff) | |
parent | 48021336904c12e129e372a46b0995647a345b1e (diff) | |
download | googletest-7a0680dc223088211807f1b19598dfe01b3bab8b.zip googletest-7a0680dc223088211807f1b19598dfe01b3bab8b.tar.gz googletest-7a0680dc223088211807f1b19598dfe01b3bab8b.tar.bz2 |
Merge pull request #1959 from robinlinden:remove-msvc-workarounds
PiperOrigin-RevId: 221356626
Diffstat (limited to 'googlemock/test/gmock-generated-function-mockers_test.cc')
-rw-r--r-- | googlemock/test/gmock-generated-function-mockers_test.cc | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/googlemock/test/gmock-generated-function-mockers_test.cc b/googlemock/test/gmock-generated-function-mockers_test.cc index 02c4203..79130bc 100644 --- a/googlemock/test/gmock-generated-function-mockers_test.cc +++ b/googlemock/test/gmock-generated-function-mockers_test.cc @@ -46,13 +46,6 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -// There is a bug in MSVC (fixed in VS 2008) that prevents creating a -// mock for a function with const arguments, so we don't test such -// cases for MSVC versions older than 2008. -#if !GTEST_OS_WINDOWS || (_MSC_VER >= 1500) -# define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS -#endif // !GTEST_OS_WINDOWS || (_MSC_VER >= 1500) - namespace testing { namespace gmock_generated_function_mockers_test { @@ -85,9 +78,7 @@ class FooInterface { virtual bool TakesNonConstReference(int& n) = 0; // NOLINT virtual std::string TakesConstReference(const int& n) = 0; -#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS virtual bool TakesConst(const int x) = 0; -#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS virtual int OverloadedOnArgumentNumber() = 0; virtual int OverloadedOnArgumentNumber(int n) = 0; @@ -136,10 +127,7 @@ class MockFoo : public FooInterface { MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT MOCK_METHOD1(TakesConstReference, std::string(const int&)); - -#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT -#endif // Tests that the function return type can contain unprotected comma. MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>()); @@ -249,7 +237,6 @@ TEST_F(FunctionMockerTest, MocksFunctionWithConstReferenceArgument) { EXPECT_EQ("Hello", foo_->TakesConstReference(a)); } -#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS // Tests mocking a function that takes a const variable. TEST_F(FunctionMockerTest, MocksFunctionWithConstArgument) { EXPECT_CALL(mock_foo_, TakesConst(Lt(10))) @@ -257,7 +244,6 @@ TEST_F(FunctionMockerTest, MocksFunctionWithConstArgument) { EXPECT_FALSE(foo_->TakesConst(5)); } -#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS // Tests mocking functions overloaded on the number of arguments. TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) { |