Remove support for BOOST_IDENTITY_TYPE

MOCK_PROTECT_FUNCTION_SIG should be used instead which even requires less parentheses.
Closes #109
This commit is contained in:
Alexander Grund 2022-01-25 17:32:22 +01:00
parent c910d1db8c
commit 3d5ac2b94a
No known key found for this signature in database
GPG key ID: AA48A0760367A42B
4 changed files with 38 additions and 41 deletions

View file

@ -14,6 +14,7 @@ Released -
* Replaced Boost facilities with std:: equivalents where existing in C++14
* Removed MOCK_*_TPL as they are no longer required, use the non _TPL variant even for templates
* Added MOCK_PROTECT_FUNCTION_SIG to pass function signatures with commas in the return type
* Remove support for protecting function signatures via BOOST_IDENTITY_TYPE, use MOCK_PROTECT_FUNCTION_SIG instead
[endsect]

View file

@ -229,15 +229,9 @@ MOCK_CLASS(mock_class)
MOCK_METHOD(method, 0, MOCK_PROTECT_FUNCTION_SIG(std::map<int, int>()))
};
//]
MOCK_CLASS(legacy_mock_class)
{
MOCK_METHOD(method, 0, BOOST_IDENTITY_TYPE((std::map<int, int>())))
};
static_assert(std::is_same<decltype(std::declval<mock_class>().method()), std::map<int, int>>::value,
"Wrong return value");
static_assert(std::is_same<decltype(std::declval<legacy_mock_class>().method()), std::map<int, int>>::value,
"Wrong return value");
} // namespace member_function_example_8