fix test_tracker sim

This commit is contained in:
arvidn 2016-04-08 08:41:19 -04:00
parent 867b83ccda
commit db4d46b492
1 changed files with 6 additions and 4 deletions

View File

@ -732,9 +732,11 @@ TORRENT_TEST(tracker_ipv6_argument)
, std::map<std::string, std::string>& headers)
{
got_announce = true;
bool const stop_event = req.find("&event=stopped") != std::string::npos;
// stop events don't need to advertise the IPv6 address
int pos = req.find("&ipv6=");
TEST_CHECK(pos != std::string::npos);
got_ipv6 = pos != std::string::npos;
TEST_CHECK(pos != std::string::npos || stop_event);
got_ipv6 |= pos != std::string::npos;
return sim::send_response(200, "OK", 11) + "d5:peers0:e";
}
, [](torrent_handle h) {}
@ -764,7 +766,7 @@ TORRENT_TEST(tracker_ipv6_argument_non_private)
got_announce = true;
int pos = req.find("&ipv6=");
TEST_CHECK(pos == std::string::npos);
got_ipv6 = pos != std::string::npos;
got_ipv6 |= pos != std::string::npos;
return sim::send_response(200, "OK", 11) + "d5:peers0:e";
}
, [](torrent_handle h) {}
@ -792,7 +794,7 @@ TORRENT_TEST(tracker_ipv6_argument_privacy_mode)
got_announce = true;
int pos = req.find("&ipv6=");
TEST_CHECK(pos == std::string::npos);
got_ipv6 = pos != std::string::npos;
got_ipv6 |= pos != std::string::npos;
return sim::send_response(200, "OK", 11) + "d5:peers0:e";
}
, [](torrent_handle h) {}