Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ws2_32/tests/sock.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 01c14382e84..e7b91aab5bd 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2856,6 +2856,18 @@ static void test_listen(void) ok (!ret, "getsockopt failed\n"); ok (acceptc == 0, "SO_ACCEPTCONN should be 0, received %d\n", acceptc);
+ acceptc = 1; + WSASetLastError(0xdeadbeef); + ret = setsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char *)&acceptc, sizeof(acceptc)); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAENOPROTOOPT, "got error %u\n", WSAGetLastError()); + + acceptc = 0; + WSASetLastError(0xdeadbeef); + ret = setsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char *)&acceptc, sizeof(acceptc)); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAENOPROTOOPT, "got error %u\n", WSAGetLastError()); + ok (!listen(fdA, 0), "listen failed\n"); ok (!listen(fdA, SOMAXCONN), "double listen failed\n");
@@ -2864,6 +2876,18 @@ static void test_listen(void) ok (!ret, "getsockopt failed\n"); ok (acceptc == 1, "SO_ACCEPTCONN should be 1, received %d\n", acceptc);
+ acceptc = 1; + WSASetLastError(0xdeadbeef); + ret = setsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char *)&acceptc, sizeof(acceptc)); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAENOPROTOOPT, "got error %u\n", WSAGetLastError()); + + acceptc = 0; + WSASetLastError(0xdeadbeef); + ret = setsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char *)&acceptc, sizeof(acceptc)); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAENOPROTOOPT, "got error %u\n", WSAGetLastError()); + SetLastError(0xdeadbeef); ok ((listen(fdB, SOMAXCONN) == SOCKET_ERROR), "listen did not fail\n"); ret = WSAGetLastError();