From 51eeae5a5520166a385ce457b410d6309ac20968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Gawro=C5=84ski?= Date: Tue, 25 Apr 2023 01:45:26 +0200 Subject: [PATCH] gmock: fix issue #4222 Rename 'Result' struct to 'NonMoveableStruct' in gmock-spec-builders_test.cc in ExpectCallTest.NonMoveableType test --- googlemock/test/gmock-spec-builders_test.cc | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc index 7ba591a1..d07cb5cb 100644 --- a/googlemock/test/gmock-spec-builders_test.cc +++ b/googlemock/test/gmock-spec-builders_test.cc @@ -811,32 +811,32 @@ TEST(ExpectCallTest, InfersCardinality1WhenThereIsWillRepeatedly) { // from a prvalue returned from a function. TEST(ExpectCallTest, NonMoveableType) { // Define a non-moveable result type. - struct Result { - explicit Result(int x_in) : x(x_in) {} - Result(Result&&) = delete; + struct NonMoveableStruct { + explicit NonMoveableStruct(int x_in) : x(x_in) {} + NonMoveableStruct(NonMoveableStruct&&) = delete; int x; }; - static_assert(!std::is_move_constructible_v); - static_assert(!std::is_copy_constructible_v); + static_assert(!std::is_move_constructible_v); + static_assert(!std::is_copy_constructible_v); - static_assert(!std::is_move_assignable_v); - static_assert(!std::is_copy_assignable_v); + static_assert(!std::is_move_assignable_v); + static_assert(!std::is_copy_assignable_v); // We should be able to use a callable that returns that result as both a // OnceAction and an Action, whether the callable ignores arguments or not. - const auto return_17 = [] { return Result(17); }; + const auto return_17 = [] { return NonMoveableStruct(17); }; - static_cast(OnceAction{return_17}); - static_cast(Action{return_17}); + static_cast(OnceAction{return_17}); + static_cast(Action{return_17}); - static_cast(OnceAction{return_17}); - static_cast(Action{return_17}); + static_cast(OnceAction{return_17}); + static_cast(Action{return_17}); // It should be possible to return the result end to end through an // EXPECT_CALL statement, with both WillOnce and WillRepeatedly. - MockFunction mock; + MockFunction mock; EXPECT_CALL(mock, Call) // .WillOnce(return_17) // .WillRepeatedly(return_17);