Skip to content

Commit 4305caf

Browse files
committed
Merge remote-tracking branch 'origin/main' into lv-find-min-max-index-tmp
2 parents ae18690 + d5e7c27 commit 4305caf

File tree

24 files changed

+178
-80
lines changed

24 files changed

+178
-80
lines changed

libc/test/src/__support/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ add_libc_test(
123123
str_to_float_test.cpp
124124
str_to_double_test.cpp
125125
str_to_long_double_test.cpp
126+
HDRS
127+
str_to_fp_test.h
126128
DEPENDS
127129
libc.src.__support.integer_literals
128130
libc.src.__support.str_to_float

libc/test/src/__support/str_to_fp_test.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/__support/FPUtil/FPBits.h"
10-
#include "src/__support/libc_errno.h"
1110
#include "src/__support/macros/config.h"
1211
#include "src/__support/str_to_float.h"
1312
#include "src/__support/uint128.h"

libc/test/src/__support/str_to_integer_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/libc_errno.h"
109
#include "src/__support/str_to_integer.h"
1110
#include <stddef.h>
1211

libc/test/src/__support/wcs_to_integer_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/libc_errno.h"
109
#include "src/__support/wcs_to_integer.h"
1110
#include <stddef.h>
1211

libc/test/src/poll/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ add_libc_unittest(
1010
libc.hdr.limits_macros
1111
libc.src.errno.errno
1212
libc.src.poll.poll
13-
libc.test.UnitTest.ErrnoSetterMatcher
13+
libc.test.UnitTest.ErrnoCheckingTest
1414
)

libc/test/src/poll/poll_test.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "hdr/limits_macros.h" // UINT_MAX
10-
#include "src/__support/libc_errno.h"
1110
#include "src/poll/poll.h"
11+
#include "test/UnitTest/ErrnoCheckingTest.h"
1212
#include "test/UnitTest/Test.h"
1313

14-
TEST(LlvmLibcPollTest, SmokeTest) {
15-
libc_errno = 0;
14+
using LlvmLibcPollTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
15+
16+
TEST_F(LlvmLibcPollTest, SmokeTest) {
1617
int ret = LIBC_NAMESPACE::poll(nullptr, 0, 0);
1718
ASSERT_ERRNO_SUCCESS();
1819
ASSERT_EQ(0, ret);
1920
}
20-
TEST(LlvmLibcPollTest, SmokeFailureTest) {
21-
libc_errno = 0;
21+
22+
TEST_F(LlvmLibcPollTest, SmokeFailureTest) {
2223
int ret = LIBC_NAMESPACE::poll(nullptr, UINT_MAX, 0);
2324
ASSERT_ERRNO_EQ(EINVAL);
2425
ASSERT_EQ(-1, ret);

libc/test/src/spawn/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ add_libc_unittest(
77
SRCS
88
posix_spawn_file_actions_test.cpp
99
DEPENDS
10+
libc.hdr.errno_macros
1011
libc.hdr.stdint_proxy
1112
libc.include.spawn
1213
libc.src.spawn.file_actions
@@ -15,5 +16,4 @@ add_libc_unittest(
1516
libc.src.spawn.posix_spawn_file_actions_addopen
1617
libc.src.spawn.posix_spawn_file_actions_destroy
1718
libc.src.spawn.posix_spawn_file_actions_init
18-
libc.src.errno.errno
1919
)

libc/test/src/spawn/posix_spawn_file_actions_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "hdr/errno_macros.h"
910
#include "hdr/stdint_proxy.h"
10-
#include "src/__support/libc_errno.h"
1111
#include "src/spawn/file_actions.h"
1212
#include "src/spawn/posix_spawn_file_actions_addclose.h"
1313
#include "src/spawn/posix_spawn_file_actions_adddup2.h"

libc/test/src/sys/ioctl/linux/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ add_libc_unittest(
1414
libc.src.unistd.close
1515
libc.src.unistd.read
1616
libc.src.unistd.write
17+
libc.test.UnitTest.ErrnoCheckingTest
18+
libc.test.UnitTest.ErrnoSetterMatcher
1719
)
1820

libc/test/src/sys/ioctl/linux/ioctl_test.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/libc_errno.h"
109
#include "src/fcntl/open.h"
1110
#include "src/sys/ioctl/ioctl.h"
1211
#include "src/unistd/close.h"
1312
#include "src/unistd/read.h"
1413
#include "src/unistd/write.h"
15-
14+
#include "test/UnitTest/ErrnoCheckingTest.h"
1615
#include "test/UnitTest/ErrnoSetterMatcher.h"
1716
#include "test/UnitTest/Test.h"
1817

1918
#include "hdr/sys_stat_macros.h"
2019

2120
#include "hdr/sys_ioctl_macros.h"
2221

22+
using LlvmLibcSysIoctlTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
2323
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
2424

25-
TEST(LlvmLibcSysIoctlTest, InvalidCommandAndFIONREAD) {
26-
LIBC_NAMESPACE::libc_errno = 0;
27-
25+
TEST_F(LlvmLibcSysIoctlTest, InvalidCommandAndFIONREAD) {
2826
// Setup the test file
2927
constexpr const char *TEST_FILE_NAME = "ioctl.test";
3028
constexpr const char TEST_MSG[] = "ioctl test";

0 commit comments

Comments
 (0)