diff --git a/tests/c/testsuite/sock_shutdown-invalid_fd.c b/tests/c/testsuite/sock_shutdown-invalid_fd.c new file mode 100644 index 00000000..8680f86f --- /dev/null +++ b/tests/c/testsuite/sock_shutdown-invalid_fd.c @@ -0,0 +1,13 @@ +#include +#include +#include +#include +#include + +int main() { + int fd = 3; + assert(shutdown(fd, SHUT_RD) != 0); + assert(errno == EBADF); + + return EXIT_SUCCESS; +} diff --git a/tests/c/testsuite/sock_shutdown-not_sock.c b/tests/c/testsuite/sock_shutdown-not_sock.c new file mode 100644 index 00000000..e3a3e873 --- /dev/null +++ b/tests/c/testsuite/sock_shutdown-not_sock.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include +#include + +int main() { + assert(shutdown(STDOUT_FILENO, SHUT_RD) != 0); + assert(errno == ENOTSOCK); + + return EXIT_SUCCESS; +}