Commit 79d41cbe authored by Michal Vaner's avatar Michal Vaner
Browse files

Fix test

It passed the data as value, not reference, therefore there was old
(default) endpoint. Stupid boost::bind.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-timeouts@3405 e5f2f494-b856-4b98-b285-d166d9295462
parent a73eb2ba
......@@ -54,9 +54,10 @@ class UDPQuery : public ::testing::Test, public asiolink::UDPQuery::Callback {
EXPECT_EQ(expected, result);
run = true;
}
void respond(udp::endpoint& remote, udp::socket* socket) {
void respond(udp::endpoint* remote, udp::socket* socket) {
// Some data came, just send something back.
socket->send_to(asio::buffer(TEST_DATA, sizeof TEST_DATA), remote);
socket->send_to(asio::buffer(TEST_DATA, sizeof TEST_DATA),
*remote);
socket->close();
}
};
......@@ -96,7 +97,7 @@ TEST_F(UDPQuery, receive) {
char inbuff[512];
udp::endpoint remote;
socket.async_receive_from(asio::buffer(inbuff, 512), remote, boost::bind(
&UDPQuery::respond, this, remote, &socket));
&UDPQuery::respond, this, &remote, &socket));
service.post(query);
service.run();
EXPECT_TRUE(run);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment