diff options
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r-- | tests/stdio_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 7e826124f..4db1f72dd 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -1297,3 +1297,11 @@ TEST(STDIO_TEST, fseek_fseeko_EINVAL) { fclose(fp); } + +TEST(STDIO_TEST, ctermid) { + ASSERT_STREQ("/dev/tty", ctermid(nullptr)); + + char buf[L_ctermid] = {}; + ASSERT_EQ(buf, ctermid(buf)); + ASSERT_STREQ("/dev/tty", buf); +} |