connect test

This commit is contained in:
tezc 2021-02-08 23:10:45 +03:00
parent 488f63265a
commit 3a211cce08

View File

@ -1040,6 +1040,13 @@ void sock_fail_test()
fail_fcntl = INT32_MAX;
sc_sock_term(&sock);
sc_sock_init(&sock, 0, true, SC_SOCK_INET);
fail_fcntl = 1;
assert(sc_sock_connect(&sock, "127.0.0.1", "8080", NULL, NULL) == -1);
assert(sc_sock_set_blocking(&sock, true) == -1);
fail_fcntl = INT32_MAX;
sc_sock_term(&sock);
sc_sock_init(&sock, 0, true, SC_SOCK_INET);
fail_fcntl = 1;
assert(sc_sock_listen(&sock, "127.0.0.1", "8080") == -1);