diff options
| author | Alan Zhao <ayzhao@google.com> | 2025-02-06 12:57:22 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-06 12:57:22 -0800 |
| commit | 4c8acbded152326ad138e1af340c0dbd5e31bbb7 (patch) | |
| tree | 56c5872f8c01d9b78ee30295e2e349fc73d006a4 /libc/test/src/stdio | |
| parent | 02fa340711d9b990b50a0daf65eb850404884137 (diff) | |
[libc][minor] Fix assertion in LlvmLibcFILETest.SimpleFileOperations (#126109)
The file descriptor of the first opened file is not necessarily 3, so we
change the assertion so that it's >= 0 (i.e. not an error.)
Fixes #126106
Diffstat (limited to 'libc/test/src/stdio')
| -rw-r--r-- | libc/test/src/stdio/fileop_test.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/test/src/stdio/fileop_test.cpp b/libc/test/src/stdio/fileop_test.cpp index 98ead6edd38b..c662a9fbd086 100644 --- a/libc/test/src/stdio/fileop_test.cpp +++ b/libc/test/src/stdio/fileop_test.cpp @@ -31,7 +31,7 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) { constexpr char FILENAME[] = "testdata/simple_operations.test"; ::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w"); ASSERT_FALSE(file == nullptr); - ASSERT_EQ(LIBC_NAMESPACE::fileno(file), 3); + ASSERT_GE(LIBC_NAMESPACE::fileno(file), 0); constexpr char CONTENT[] = "1234567890987654321"; ASSERT_EQ(sizeof(CONTENT) - 1, LIBC_NAMESPACE::fwrite(CONTENT, 1, sizeof(CONTENT) - 1, file)); |
