diff options
author | Chris <chrisjohnsonmail@gmail.com> | 2019-01-03 21:15:19 -0600 |
---|---|---|
committer | Chris <chrisjohnsonmail@gmail.com> | 2019-01-03 21:15:19 -0600 |
commit | fd1c7976aee83718db9934d0f5063a52e10f5db6 (patch) | |
tree | 81403e3fcf0190773dc3e7dbb42bb7c51795c74e /googlemock/test/gmock-function-mocker_test.cc | |
parent | 23533009b872e4cb6ae93471ff4e9280a2d51f62 (diff) | |
parent | 0ffa5f9779fc3a1b18d4931484b46825d952821d (diff) | |
download | googletest-fd1c7976aee83718db9934d0f5063a52e10f5db6.tar.gz googletest-fd1c7976aee83718db9934d0f5063a52e10f5db6.tar.bz2 googletest-fd1c7976aee83718db9934d0f5063a52e10f5db6.zip |
Merge branch 'chore/fix_library_json' of https://github.com/ciband/googletest into chore/fix_library_json
Diffstat (limited to 'googlemock/test/gmock-function-mocker_test.cc')
-rw-r--r-- | googlemock/test/gmock-function-mocker_test.cc | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/googlemock/test/gmock-function-mocker_test.cc b/googlemock/test/gmock-function-mocker_test.cc index 007e86c2..f29433f5 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) { @@ -598,7 +584,6 @@ TEST(MockMethodMockFunctionTest, WorksFor10Arguments) { EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false)); } -#if GTEST_HAS_STD_FUNCTION_ TEST(MockMethodMockFunctionTest, AsStdFunction) { MockFunction<int(int)> foo; auto call = [](const std::function<int(int)> &f, int i) { @@ -630,7 +615,6 @@ TEST(MockMethodMockFunctionTest, AsStdFunctionWithReferenceParameter) { EXPECT_EQ(-1, call(foo.AsStdFunction(), i)); } -#endif // GTEST_HAS_STD_FUNCTION_ struct MockMethodSizes0 { MOCK_METHOD(void, func, ()); |