Skip to content
Snippets Groups Projects
Commit dccfa25c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change socket creation failure test

Since Gitlab's runners possess the root privileges, it is more tricky
to get a "Permission denied".

Instead, we try to create two servers listening to the same port which
leads to an "Address already in use"
parent 91728237
No related branches found
No related tags found
1 merge request!126Begin socket handling: core functionalities are available
......@@ -75,7 +75,10 @@ TEST_CASE("Socket", "[utils]")
{
SECTION("connection")
{
REQUIRE_THROWS_WITH(createServerSocket(1), "error: Permission denied");
{
auto server = createServerSocket(0);
REQUIRE_THROWS_WITH(createServerSocket(server.portNumber()), "error: Address already in use");
}
REQUIRE_THROWS_WITH(connectServerSocket("localhost", 1), "error: Connection refused");
// The error message is not checked since it can depend on the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment