summaryrefslogtreecommitdiff
path: root/libc/test/src/stdio/fprintf_test.cpp
diff options
context:
space:
mode:
authorMichael Jones <michaelrj@google.com>2022-06-14 12:00:36 -0700
committerMichael Jones <michaelrj@google.com>2022-06-15 11:45:36 -0700
commit2e6eccfe34c1ff005352ca78f87bbcc4884f7371 (patch)
tree647c888cd3e55b9ad1ada8c7d1a7e0b3c1113120 /libc/test/src/stdio/fprintf_test.cpp
parent02e32708bd4dd5d3cd71a787dffc459eaafb8e9f (diff)
[libc] refactor printf file writing
Add return values to converter functions to allow for better error handling when writing files. Also move the file writing code around to be easier to read. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D127773
Diffstat (limited to 'libc/test/src/stdio/fprintf_test.cpp')
-rw-r--r--libc/test/src/stdio/fprintf_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/test/src/stdio/fprintf_test.cpp b/libc/test/src/stdio/fprintf_test.cpp
index c7bf2cc1525d..84f1c316af82 100644
--- a/libc/test/src/stdio/fprintf_test.cpp
+++ b/libc/test/src/stdio/fprintf_test.cpp
@@ -62,7 +62,7 @@ TEST(LlvmLibcFPrintfTest, WriteToFile) {
written =
__llvm_libc::fprintf(file, "Writing to a read only file should fail.");
- EXPECT_EQ(written, -1);
+ EXPECT_LT(written, 0);
ASSERT_EQ(__llvm_libc::fclose(file), 0);
}