diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-11-14 18:05:08 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-11-14 18:05:08 +0100 |
commit | 4d0bcdbbf212c8f0ceee167db42100b8183515f4 (patch) | |
tree | fa35711dfc18638c6b30c76653b8cec45f13f322 | |
parent | ef926563aec364912b7cf4332399e446af6c3082 (diff) | |
download | socket_wrapper-4d0bcdbbf212c8f0ceee167db42100b8183515f4.tar.gz socket_wrapper-4d0bcdbbf212c8f0ceee167db42100b8183515f4.tar.xz socket_wrapper-4d0bcdbbf212c8f0ceee167db42100b8183515f4.zip |
tests: Add a ioctl tty test.
-rw-r--r-- | tests/testsuite.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/testsuite.c b/tests/testsuite.c index 2223226..487d6fb 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -63,7 +63,7 @@ static void test_socket_wrapper_dir(void **state) } #endif -static void test_swrap_ioctl(void **state) +static void test_swrap_ioctl_sock(void **state) { int fd; int rc; @@ -77,6 +77,20 @@ static void test_swrap_ioctl(void **state) assert_int_equal(rc, 0); } +static void test_swrap_ioctl_tty(void **state) +{ + struct winsize ws; + int rc; + + (void) state; /* unused */ + + rc = ioctl(0, TIOCGWINSZ, &ws); + assert_int_equal(rc, 0); + + assert_true(ws.ws_col > 1); + assert_true(ws.ws_row > 1); +} + static void test_swrap_socket(void **state) { int rc; @@ -117,7 +131,8 @@ int main(void) { const UnitTest tests[] = { unit_test_setup_teardown(test_swrap_socket, setup, teardown), - unit_test_setup_teardown(test_swrap_ioctl, setup, teardown), + unit_test_setup_teardown(test_swrap_ioctl_sock, setup, teardown), + unit_test_setup_teardown(test_swrap_ioctl_tty, setup, teardown), }; rc = run_tests(tests); |