From fe2a3150c0244759154c4cc472af12eca79df8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 15 Apr 2013 21:03:05 +0200 Subject: [PATCH] test: add error logging to tty unit test --- test/test-tty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test-tty.c b/test/test-tty.c index eb5d5df5..f3003efa 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -30,6 +30,9 @@ # include #endif +#include +#include + TEST_IMPL(tty) { int r, width, height; @@ -62,7 +65,12 @@ TEST_IMPL(tty) { #else /* unix */ ttyin_fd = open("/dev/tty", O_RDONLY, 0); + if (ttyin_fd < 0) + LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno)); + ttyout_fd = open("/dev/tty", O_WRONLY, 0); + if (ttyout_fd < 0) + LOGF("Cannot open /dev/tty as write-only: %s\n", strerror(errno)); #endif ASSERT(ttyin_fd >= 0);