Commit 2ec914c9 authored by Jelte Jansen's avatar Jelte Jansen

[master] Change unavailableAddress test

It tried to bind to 255.255.0.0, which should fail, but doesn't on some
systems (CentOS for example). As a possible way forward, I've changed it
to 192.0.2.0, which does fail on CentOS. If this does not fail on other
systems, we should probably go for the proposed solution from #437, or
remove the test completely.
parent 7c42c6d3
......@@ -154,14 +154,14 @@ TEST(IOServiceTest, unavailableAddress) {
IOService io_service;
// These addresses should generally be unavailable as a valid local
// address, although there's no guarantee in theory.
EXPECT_THROW(DNSService(io_service, *TEST_SERVER_PORT, *"255.255.0.0", NULL, NULL, NULL), IOError);
EXPECT_THROW(DNSService(io_service, *TEST_SERVER_PORT, *"192.0.2.0", NULL, NULL, NULL), IOError);
// Some OSes would simply reject binding attempt for an AF_INET6 socket
// to an IPv4-mapped IPv6 address. Even if those that allow it, since
// the corresponding IPv4 address is the same as the one used in the
// AF_INET socket case above, it should at least show the same result
// as the previous one.
EXPECT_THROW(DNSService(io_service, *TEST_SERVER_PORT, *"::ffff:255.255.0.0", NULL, NULL, NULL), IOError);
EXPECT_THROW(DNSService(io_service, *TEST_SERVER_PORT, *"::ffff:192.0.2.0", NULL, NULL, NULL), IOError);
}
TEST(IOServiceTest, duplicateBind_v6) {
......
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