aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/stdio/vfprintf_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/src/stdio/vfprintf_test.cpp')
-rw-r--r--libc/test/src/stdio/vfprintf_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/test/src/stdio/vfprintf_test.cpp b/libc/test/src/stdio/vfprintf_test.cpp
index f50565a..0e003f5 100644
--- a/libc/test/src/stdio/vfprintf_test.cpp
+++ b/libc/test/src/stdio/vfprintf_test.cpp
@@ -19,6 +19,8 @@
#include "src/stdio/vfprintf.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
namespace printf_test {
@@ -44,6 +46,8 @@ int call_vfprintf(::FILE *__restrict stream, const char *__restrict format,
return ret;
}
+using LlvmLibcVFPrintfTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
TEST(LlvmLibcVFPrintfTest, WriteToFile) {
const char *FILENAME = APPEND_LIBC_TEST("vfprintf_output.test");
auto FILE_PATH = libc_make_test_file_path(FILENAME);
@@ -90,6 +94,7 @@ TEST(LlvmLibcVFPrintfTest, WriteToFile) {
written = call_vfprintf(file, "Writing to a read only file should fail.");
EXPECT_LT(written, 0);
+ ASSERT_ERRNO_FAILURE();
ASSERT_EQ(printf_test::fclose(file), 0);
}