diff options
author | Abseil Team <absl-team@google.com> | 2018-12-28 11:03:51 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-01-02 21:51:33 (GMT) |
commit | f8b1c1af17750189b83c58f360c85268c0d95105 (patch) | |
tree | 5785da224e6e5f05ecd044721e87138b681932a1 /googlemock/test/gmock-function-mocker_test.cc | |
parent | 933e5df283727911161f8fb56cc4773b08c12d3d (diff) | |
download | googletest-f8b1c1af17750189b83c58f360c85268c0d95105.zip googletest-f8b1c1af17750189b83c58f360c85268c0d95105.tar.gz googletest-f8b1c1af17750189b83c58f360c85268c0d95105.tar.bz2 |
Googletest export
Remove the #ifs for old, unsupported and buggy compilers:
* old versions of GCC & MSVC
* Symbian
PiperOrigin-RevId: 227116941
Diffstat (limited to 'googlemock/test/gmock-function-mocker_test.cc')
-rw-r--r-- | googlemock/test/gmock-function-mocker_test.cc | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/googlemock/test/gmock-function-mocker_test.cc b/googlemock/test/gmock-function-mocker_test.cc index 294b21d..f29433f 100644 --- a/googlemock/test/gmock-function-mocker_test.cc +++ b/googlemock/test/gmock-function-mocker_test.cc @@ -45,13 +45,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_function_mocker_test { @@ -84,9 +77,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; @@ -137,10 +128,7 @@ class MockFoo : public FooInterface { MOCK_METHOD(bool, TakesNonConstReference, (int&)); // NOLINT MOCK_METHOD(std::string, TakesConstReference, (const int&)); - -#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS MOCK_METHOD(bool, TakesConst, (const int)); // NOLINT -#endif // Tests that the function return type can contain unprotected comma. MOCK_METHOD((std::map<int, std::string>), ReturnTypeWithComma, (), ()); @@ -248,7 +236,6 @@ TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstReferenceArgument) { EXPECT_EQ("Hello", foo_->TakesConstReference(a)); } -#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS // Tests mocking a function that takes a const variable. TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstArgument) { EXPECT_CALL(mock_foo_, TakesConst(Lt(10))) @@ -256,7 +243,6 @@ TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstArgument) { EXPECT_FALSE(foo_->TakesConst(5)); } -#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS // Tests mocking functions overloaded on the number of arguments. TEST_F(MockMethodFunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) { |