[libc] Fix stdio tests after #143802 (#143810)

In #143802 the stdio test cleanup missed a few places where errno was
being set to a failing value, and one where the framework needed to
included.
This commit is contained in:
Michael Jones
2025-06-11 16:52:21 -07:00
committed by GitHub
parent 1ecd108cb7
commit 3c7af175e5
5 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ public:
// This is an error and not a real EOF.
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
ASSERT_ERRNO_FAILURE();
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));

View File

@@ -36,6 +36,7 @@ public:
// This is an error and not a real EOF.
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
ASSERT_ERRNO_FAILURE();
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));

View File

@@ -36,6 +36,7 @@ TEST_F(LlvmLibcFgetsTest, WriteAndReadCharacters) {
// This is an error and not a real EOF.
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
ASSERT_ERRNO_FAILURE();
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));

View File

@@ -11,6 +11,7 @@
#include "src/stdio/fread.h"
#include "src/stdio/fwrite.h"
#include "src/stdio/setvbuf.h"
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/Test.h"
#include "hdr/stdio_macros.h"