mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Remove usage of BOOST_IDENTITY_TYPE from official docs
Replaced by MOCK_PROTECT_FUNCTION_SIG
This commit is contained in:
parent
374482367f
commit
51fcd4f4b9
1 changed files with 12 additions and 3 deletions
|
|
@ -225,11 +225,20 @@ namespace member_function_example_8 {
|
||||||
//[ member_function_example_8
|
//[ member_function_example_8
|
||||||
MOCK_CLASS(mock_class)
|
MOCK_CLASS(mock_class)
|
||||||
{
|
{
|
||||||
MOCK_METHOD(
|
// the signature must be wrapped in MOCK_PROTECT_FUNCTION_SIG if the return type contains a comma
|
||||||
method, 0, BOOST_IDENTITY_TYPE((std::map<int, int>()))) // the signature must be wrapped in BOOST_IDENTITY_TYPE if
|
MOCK_METHOD(method, 0, MOCK_PROTECT_FUNCTION_SIG(std::map<int, int>()))
|
||||||
// the return type contains a comma
|
|
||||||
};
|
};
|
||||||
//]
|
//]
|
||||||
|
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
|
} // namespace member_function_example_8
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue