mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:00:56 +00:00
ws2_32/tests: Test setting SO_ACCEPTCONN.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2fb11821bf
commit
2f0e8c084e
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue