aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/unistd/lseek_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/src/unistd/lseek_test.cpp')
-rw-r--r--libc/test/src/unistd/lseek_test.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/libc/test/src/unistd/lseek_test.cpp b/libc/test/src/unistd/lseek_test.cpp
index cb04db4..1a13d54 100644
--- a/libc/test/src/unistd/lseek_test.cpp
+++ b/libc/test/src/unistd/lseek_test.cpp
@@ -17,44 +17,45 @@
#include <unistd.h>
TEST(LlvmLibcUniStd, LseekTest) {
- using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
+ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
constexpr const char *TEST_FILE = "testdata/lseek.test";
- int fd = __llvm_libc::open(TEST_FILE, O_RDONLY);
+ int fd = LIBC_NAMESPACE::open(TEST_FILE, O_RDONLY);
ASSERT_EQ(libc_errno, 0);
ASSERT_GT(fd, 0);
constexpr const char LSEEK_TEST[] = "lseek test";
constexpr int LSEEK_TEST_SIZE = sizeof(LSEEK_TEST) - 1;
char read_buf[20];
- ASSERT_THAT(__llvm_libc::read(fd, read_buf, LSEEK_TEST_SIZE),
+ ASSERT_THAT(LIBC_NAMESPACE::read(fd, read_buf, LSEEK_TEST_SIZE),
Succeeds(LSEEK_TEST_SIZE));
read_buf[LSEEK_TEST_SIZE] = '\0';
EXPECT_STREQ(read_buf, LSEEK_TEST);
// Seek to the beginning of the file and re-read.
- ASSERT_THAT(__llvm_libc::lseek(fd, 0, SEEK_SET), Succeeds(0));
- ASSERT_THAT(__llvm_libc::read(fd, read_buf, LSEEK_TEST_SIZE),
+ ASSERT_THAT(LIBC_NAMESPACE::lseek(fd, 0, SEEK_SET), Succeeds(0));
+ ASSERT_THAT(LIBC_NAMESPACE::read(fd, read_buf, LSEEK_TEST_SIZE),
Succeeds(LSEEK_TEST_SIZE));
read_buf[LSEEK_TEST_SIZE] = '\0';
EXPECT_STREQ(read_buf, LSEEK_TEST);
// Seek to the beginning of the file from the end and re-read.
- ASSERT_THAT(__llvm_libc::lseek(fd, -LSEEK_TEST_SIZE, SEEK_END), Succeeds(0));
- ASSERT_THAT(__llvm_libc::read(fd, read_buf, LSEEK_TEST_SIZE),
+ ASSERT_THAT(LIBC_NAMESPACE::lseek(fd, -LSEEK_TEST_SIZE, SEEK_END),
+ Succeeds(0));
+ ASSERT_THAT(LIBC_NAMESPACE::read(fd, read_buf, LSEEK_TEST_SIZE),
Succeeds(LSEEK_TEST_SIZE));
read_buf[LSEEK_TEST_SIZE] = '\0';
EXPECT_STREQ(read_buf, LSEEK_TEST);
- ASSERT_THAT(__llvm_libc::close(fd), Succeeds(0));
+ ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds(0));
}
TEST(LlvmLibcUniStd, LseekFailsTest) {
- using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
- using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
+ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
+ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
constexpr const char *TEST_FILE = "testdata/lseek.test";
- int fd = __llvm_libc::open(TEST_FILE, O_RDONLY);
+ int fd = LIBC_NAMESPACE::open(TEST_FILE, O_RDONLY);
ASSERT_EQ(libc_errno, 0);
ASSERT_GT(fd, 0);
- EXPECT_THAT(__llvm_libc::lseek(fd, -1, SEEK_CUR), Fails(EINVAL));
- ASSERT_THAT(__llvm_libc::close(fd), Succeeds(0));
+ EXPECT_THAT(LIBC_NAMESPACE::lseek(fd, -1, SEEK_CUR), Fails(EINVAL));
+ ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds(0));
}