From 5a2f2088a19bf89945aec9f466080eb22eb6b62b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 14 Nov 2013 17:50:17 +0100 Subject: tests: Add simple ioctl test. --- tests/testsuite.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/testsuite.c b/tests/testsuite.c index 5bb0adb..2223226 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -62,6 +63,20 @@ static void test_socket_wrapper_dir(void **state) } #endif +static void test_swrap_ioctl(void **state) +{ + int fd; + int rc; + + (void) state; /* unused */ + + fd = socket(AF_INET, SOCK_DGRAM, 0); + assert_int_not_equal(fd, -1); + + rc = ioctl(fd, FIONBIO); + assert_int_equal(rc, 0); +} + static void test_swrap_socket(void **state) { int rc; @@ -102,6 +117,7 @@ int main(void) { const UnitTest tests[] = { unit_test_setup_teardown(test_swrap_socket, setup, teardown), + unit_test_setup_teardown(test_swrap_ioctl, setup, teardown), }; rc = run_tests(tests); -- cgit