Skip to content

Commit 8b0db87

Browse files
committed
Fix test
1 parent 7ff3234 commit 8b0db87

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

tests/unittests/RouteTests.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,20 @@ class Canary : public std::string {
6060

6161
class RouteTests : public StrictMock<Test> {
6262
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};
6868

6969
MOCK_METHOD0(handleSink0, void());
7070
MOCK_METHOD1(handleSink1, void(int));
7171
MOCK_METHOD1(handlePassThrough1a, bool(int));
7272
MOCK_METHOD1(handlePassThrough1b, bool(int));
7373
MOCK_METHOD4(handleSink5, void(int, bool&, NonCopyableThing const &, Canary));
7474

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>&)
7676
{
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);
8077
handleSink5(a, b, c, d);
8178
}
8279
};
@@ -99,11 +96,11 @@ TEST_F(RouteTests, SinkPassesArgsAsDefined)
9996
SetArgReferee<1>(true),
10097
InvokeArgument<3>()
10198
));
102-
sink5(123, flag, thing, canary, std::move(data));
99+
sink5(123, flag, thing, canary, data);
103100

104101
EXPECT_THAT(flag, true);
105102
EXPECT_THAT(canary, Eq("alive"));
106-
EXPECT_THAT(data, IsEmpty());
103+
EXPECT_THAT(data, Not(IsEmpty()));
107104
}
108105

109106
TEST_F(RouteTests, SourceIsNoopWhenUnbound)

0 commit comments

Comments
 (0)