diff options
author | Mikhail R. Gadelha <mikhail@igalia.com> | 2024-07-05 20:32:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 15:32:20 -0300 |
commit | fc665436626fa265ebb8d62b9f8a4cfab9b959d0 (patch) | |
tree | 2b8134b8dfa21bf0b28240a4cdd21e84766bc1fc | |
parent | 788731cdbd732180639988c9589adbe63bb28afa (diff) | |
download | llvm-fc665436626fa265ebb8d62b9f8a4cfab9b959d0.zip llvm-fc665436626fa265ebb8d62b9f8a4cfab9b959d0.tar.gz llvm-fc665436626fa265ebb8d62b9f8a4cfab9b959d0.tar.bz2 |
Revert "[libc] Fix readlink tests on 32-bit systems" (#97852)
Reverts #97850 while I investigate the buildbot issue
-rw-r--r-- | libc/test/src/unistd/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libc/test/src/unistd/readlink_test.cpp | 11 | ||||
-rw-r--r-- | libc/test/src/unistd/readlinkat_test.cpp | 15 |
3 files changed, 10 insertions, 18 deletions
diff --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt index f4f78b8..de3e8d9c 100644 --- a/libc/test/src/unistd/CMakeLists.txt +++ b/libc/test/src/unistd/CMakeLists.txt @@ -262,7 +262,6 @@ add_libc_unittest( libc.include.unistd libc.src.errno.errno libc.src.unistd.readlink - libc.src.string.string_utils libc.src.unistd.symlink libc.src.unistd.unlink libc.src.__support.CPP.string_view @@ -279,7 +278,6 @@ add_libc_unittest( libc.include.fcntl libc.include.unistd libc.src.errno.errno - libc.src.string.string_utils libc.src.unistd.readlinkat libc.src.unistd.symlink libc.src.unistd.unlink diff --git a/libc/test/src/unistd/readlink_test.cpp b/libc/test/src/unistd/readlink_test.cpp index 0760850..20f3951 100644 --- a/libc/test/src/unistd/readlink_test.cpp +++ b/libc/test/src/unistd/readlink_test.cpp @@ -9,7 +9,6 @@ #include "src/__support/CPP/string_view.h" #include "src/errno/libc_errno.h" #include "src/unistd/readlink.h" -#include "src/string/string_utils.h" #include "src/unistd/symlink.h" #include "src/unistd/unlink.h" #include "test/UnitTest/ErrnoSetterMatcher.h" @@ -31,9 +30,8 @@ TEST(LlvmLibcReadlinkTest, CreateAndUnlink) { // 3. Cleanup the symlink created in step #1. ASSERT_THAT(LIBC_NAMESPACE::symlink(LINK_VAL, LINK), Succeeds(0)); - char buf[sizeof(FILENAME)]; - ssize_t len = LIBC_NAMESPACE::readlink( - LINK, buf, LIBC_NAMESPACE::internal::string_length(FILENAME)); + char buf[sizeof(LINK_VAL)]; + ssize_t len = LIBC_NAMESPACE::readlink(LINK, buf, sizeof(buf)); ASSERT_ERRNO_SUCCESS(); ASSERT_EQ(cpp::string_view(buf, len), cpp::string_view(LINK_VAL)); @@ -42,8 +40,7 @@ TEST(LlvmLibcReadlinkTest, CreateAndUnlink) { TEST(LlvmLibcReadlinkTest, ReadlinkInNonExistentPath) { using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails; - constexpr auto len = 8; - char buf[len]; - ASSERT_THAT(LIBC_NAMESPACE::readlink("non-existent-link", buf, len), + char buf[8]; + ASSERT_THAT(LIBC_NAMESPACE::readlink("non-existent-link", buf, sizeof(buf)), Fails(ENOENT)); } diff --git a/libc/test/src/unistd/readlinkat_test.cpp b/libc/test/src/unistd/readlinkat_test.cpp index 61e8773..39d81d9 100644 --- a/libc/test/src/unistd/readlinkat_test.cpp +++ b/libc/test/src/unistd/readlinkat_test.cpp @@ -9,7 +9,6 @@ #include "src/__support/CPP/string_view.h" #include "src/errno/libc_errno.h" #include "src/unistd/readlinkat.h" -#include "src/string/string_utils.h" #include "src/unistd/symlink.h" #include "src/unistd/unlink.h" #include "test/UnitTest/ErrnoSetterMatcher.h" @@ -33,9 +32,8 @@ TEST(LlvmLibcReadlinkatTest, CreateAndUnlink) { // 3. Cleanup the symlink created in step #1. ASSERT_THAT(LIBC_NAMESPACE::symlink(LINK_VAL, LINK), Succeeds(0)); - char buf[sizeof(FILENAME)]; - ssize_t len = LIBC_NAMESPACE::readlinkat( - AT_FDCWD, LINK, buf, LIBC_NAMESPACE::internal::string_length(FILENAME)); + char buf[sizeof(LINK_VAL)]; + ssize_t len = LIBC_NAMESPACE::readlinkat(AT_FDCWD, LINK, buf, sizeof(buf)); ASSERT_ERRNO_SUCCESS(); ASSERT_EQ(cpp::string_view(buf, len), cpp::string_view(LINK_VAL)); @@ -44,9 +42,8 @@ TEST(LlvmLibcReadlinkatTest, CreateAndUnlink) { TEST(LlvmLibcReadlinkatTest, ReadlinkInNonExistentPath) { using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails; - constexpr auto len = 8; - char buf[len]; - ASSERT_THAT( - LIBC_NAMESPACE::readlinkat(AT_FDCWD, "non-existent-link", buf, len), - Fails(ENOENT)); + char buf[8]; + ASSERT_THAT(LIBC_NAMESPACE::readlinkat(AT_FDCWD, "non-existent-link", buf, + sizeof(buf)), + Fails(ENOENT)); } |