summaryrefslogtreecommitdiff
path: root/tests/stdlib_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib_test.cpp')
-rw-r--r--tests/stdlib_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 27495d88f..0c403807d 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -508,6 +508,16 @@ TEST(stdlib, ptsname_r_ERANGE) {
close(fd);
}
+TEST(stdlib, ttyname) {
+ int fd = getpt();
+ ASSERT_NE(-1, fd);
+
+ // ttyname returns "/dev/ptmx" for a pty.
+ ASSERT_STREQ("/dev/ptmx", ttyname(fd));
+
+ close(fd);
+}
+
TEST(stdlib, ttyname_r) {
int fd = getpt();
ASSERT_NE(-1, fd);