Skip to content

Commit 4c8acbd

Browse files
authored
[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
1 parent 02fa340 commit 4c8acbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/test/src/stdio/fileop_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ TEST(LlvmLibcFILETest, SimpleFileOperations) {
3131
constexpr char FILENAME[] = "testdata/simple_operations.test";
3232
::FILE *file = LIBC_NAMESPACE::fopen(FILENAME, "w");
3333
ASSERT_FALSE(file == nullptr);
34-
ASSERT_EQ(LIBC_NAMESPACE::fileno(file), 3);
34+
ASSERT_GE(LIBC_NAMESPACE::fileno(file), 0);
3535
constexpr char CONTENT[] = "1234567890987654321";
3636
ASSERT_EQ(sizeof(CONTENT) - 1,
3737
LIBC_NAMESPACE::fwrite(CONTENT, 1, sizeof(CONTENT) - 1, file));

0 commit comments

Comments
 (0)