diff options
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r-- | tests/stdio_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 844a9c099..d93c63f42 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -2506,3 +2506,14 @@ TEST(STDIO_TEST, fseek_overflow_32bit) { fclose(fp); } + +TEST(STDIO_TEST, dev_std_files) { + // POSIX only mentions /dev/stdout, but we should have all three (http://b/31824379). + char path[PATH_MAX]; + ASSERT_GT(readlink("/dev/stdin", path, sizeof(path)), 0); + ASSERT_STREQ("/proc/self/fd/0", path); + ASSERT_GT(readlink("/dev/stdout", path, sizeof(path)), 0); + ASSERT_STREQ("/proc/self/fd/1", path); + ASSERT_GT(readlink("/dev/stderr", path, sizeof(path)), 0); + ASSERT_STREQ("/proc/self/fd/2", path); +} |