Skip to content

Commit 3c7af17

Browse files
[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.
1 parent 1ecd108 commit 3c7af17

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

libc/docs/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
2929
- ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable -fstack-protector-strong to defend against stack smashing attack.
3030
- ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for better debugging experience.
3131
* **"errno" options**
32-
- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
32+
- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, LIBC_ERRNO_MODE_SYSTEM, and LIBC_ERRNO_MODE_SYSTEM_INLINE.
3333
* **"general" options**
3434
- ``LIBC_ADD_NULL_CHECKS``: Add nullptr checks in the library's implementations to some functions for which passing nullptr is undefined behavior.
3535
* **"math" options**

libc/test/src/stdio/fgetc_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
3333
// This is an error and not a real EOF.
3434
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
3535
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
36+
ASSERT_ERRNO_FAILURE();
3637

3738
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
3839

libc/test/src/stdio/fgetc_unlocked_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class LlvmLibcGetcTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
3636
// This is an error and not a real EOF.
3737
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
3838
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
39+
ASSERT_ERRNO_FAILURE();
3940

4041
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
4142

libc/test/src/stdio/fgets_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ TEST_F(LlvmLibcFgetsTest, WriteAndReadCharacters) {
3636
// This is an error and not a real EOF.
3737
ASSERT_EQ(LIBC_NAMESPACE::feof(file), 0);
3838
ASSERT_NE(LIBC_NAMESPACE::ferror(file), 0);
39+
ASSERT_ERRNO_FAILURE();
3940

4041
ASSERT_EQ(0, LIBC_NAMESPACE::fclose(file));
4142

libc/test/src/stdio/setvbuf_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "src/stdio/fread.h"
1212
#include "src/stdio/fwrite.h"
1313
#include "src/stdio/setvbuf.h"
14+
#include "test/UnitTest/ErrnoCheckingTest.h"
1415
#include "test/UnitTest/Test.h"
1516

1617
#include "hdr/stdio_macros.h"

0 commit comments

Comments
 (0)