From 20788aec002ab3f6dea4e01665a439933161d11c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 9 Jun 2016 15:16:32 -0700 Subject: Add ctermid. Change-Id: I7c7c815c2725df222932db923632c8b6419741ab --- tests/stdio_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/stdio_test.cpp') 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); +} -- cgit v1.2.3