[libc-commits] [libc] 15b19c7 - [libc] Fix fprintf_test assuming specific errnos. (#166479)
via libc-commits
libc-commits at lists.llvm.org
Tue Nov 4 16:56:04 PST 2025
Author: Michael Jones
Date: 2025-11-05T00:56:00Z
New Revision: 15b19c732172d2d3cfbc108a268cbba03eed734f
URL: https://github.com/llvm/llvm-project/commit/15b19c732172d2d3cfbc108a268cbba03eed734f
DIFF: https://github.com/llvm/llvm-project/commit/15b19c732172d2d3cfbc108a268cbba03eed734f.diff
LOG: [libc] Fix fprintf_test assuming specific errnos. (#166479)
The patch #166382 fixed most of these, but missed the fprintf_test ones.
Added:
Modified:
libc/test/src/stdio/fprintf_test.cpp
Removed:
################################################################################
diff --git a/libc/test/src/stdio/fprintf_test.cpp b/libc/test/src/stdio/fprintf_test.cpp
index 1b35a09645939..2cea7f554ce38 100644
--- a/libc/test/src/stdio/fprintf_test.cpp
+++ b/libc/test/src/stdio/fprintf_test.cpp
@@ -83,7 +83,7 @@ TEST(LlvmLibcFPrintfTest, WriteToFile) {
written =
LIBC_NAMESPACE::fprintf(file, "Writing to a read only file should fail.");
EXPECT_LT(written, 0);
- ASSERT_ERRNO_EQ(EBADF);
+ ASSERT_ERRNO_FAILURE();
ASSERT_EQ(printf_test::fclose(file), 0);
}
@@ -100,7 +100,7 @@ TEST(LlvmLibcFPrintfTest, NullPtrCheck) {
int ret =
LIBC_NAMESPACE::fprintf(file, "hello %n", static_cast<int *>(nullptr));
EXPECT_LT(ret, 0);
- ASSERT_ERRNO_EQ(EINVAL);
+ ASSERT_ERRNO_FAILURE();
ASSERT_EQ(printf_test::fclose(file), 0);
}
More information about the libc-commits
mailing list