Skip to content

Commit a1ed97b

Browse files
committed
[libc][minor] Fix assertion in LlvmLibcFILETest.SimpleFileOperations
The file descriptor of the first opened file is not necessarily 3, so we change the assertion so that it's >= 3 (i.e. not 0, 1, 2, or -1 which correspond to stdin, stdout, stderr, or error respectively.) Fixes llvm#126106
1 parent ff94b03 commit a1ed97b

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), 3);
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)