[libc-commits] [libc] [libc][minor] Fix assertion in LlvmLibcFILETest.SimpleFileOperations (PR #126109)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Feb 6 10:55:05 PST 2025


================
@@ -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), 3);
----------------
nickdesaulniers wrote:

Maybe this should just be `>= 0`. IIRC file descriptors get reused if you close stdin, stdout, stderr then open a new file.

https://github.com/llvm/llvm-project/pull/126109


More information about the libc-commits mailing list