@@ -60,23 +60,20 @@ class Canary : public std::string {
60
60
61
61
class RouteTests : public StrictMock <Test> {
62
62
public:
63
- RouteSink<RouteTests> sink0{this , &RouteTests::handleSink0};
64
- RouteSink<RouteTests, int > sink1{this , &RouteTests::handleSink1};
65
- RoutePassThrough<RouteTests, int > passThrough1a{this , &RouteTests::handlePassThrough1a};
66
- RoutePassThrough<RouteTests, int > passThrough1b{this , &RouteTests::handlePassThrough1b};
67
- RouteSink<RouteTests, int , bool &, NonCopyableThing const &, Canary, std::vector<int >&& > sink5{this , &RouteTests::handleSink5x};
63
+ RouteSink<RouteTests> sink0{this , &RouteTests::handleSink0};
64
+ RouteSink<RouteTests, int > sink1{this , &RouteTests::handleSink1};
65
+ RoutePassThrough<RouteTests, int > passThrough1a{this , &RouteTests::handlePassThrough1a};
66
+ RoutePassThrough<RouteTests, int > passThrough1b{this , &RouteTests::handlePassThrough1b};
67
+ RouteSink<RouteTests, int , bool &, NonCopyableThing const &, Canary, std::vector<int >&> sink5{this , &RouteTests::handleSink5x};
68
68
69
69
MOCK_METHOD0 (handleSink0, void ());
70
70
MOCK_METHOD1 (handleSink1, void (int ));
71
71
MOCK_METHOD1 (handlePassThrough1a, bool (int ));
72
72
MOCK_METHOD1 (handlePassThrough1b, bool (int ));
73
73
MOCK_METHOD4 (handleSink5, void (int , bool &, NonCopyableThing const &, Canary));
74
74
75
- void handleSink5x (int a, bool & b, NonCopyableThing const & c, Canary d, std::vector<int >&& e )
75
+ void handleSink5x (int a, bool & b, NonCopyableThing const & c, Canary d, std::vector<int >&)
76
76
{
77
- // This extra function exists just to handle the r-value reference.
78
- // The move cannot be done properly in a mocked method.
79
- std::vector<int > x = std::move (e);
80
77
handleSink5 (a, b, c, d);
81
78
}
82
79
};
@@ -99,11 +96,11 @@ TEST_F(RouteTests, SinkPassesArgsAsDefined)
99
96
SetArgReferee<1 >(true ),
100
97
InvokeArgument<3 >()
101
98
));
102
- sink5 (123 , flag, thing, canary, std::move ( data) );
99
+ sink5 (123 , flag, thing, canary, data);
103
100
104
101
EXPECT_THAT (flag, true );
105
102
EXPECT_THAT (canary, Eq (" alive" ));
106
- EXPECT_THAT (data, IsEmpty ());
103
+ EXPECT_THAT (data, Not ( IsEmpty () ));
107
104
}
108
105
109
106
TEST_F (RouteTests, SourceIsNoopWhenUnbound)
0 commit comments