diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2024-01-26 15:18:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 15:18:22 +0100 |
| commit | 73874f7a39df74eacf1682b3961da2d8cb675f33 (patch) | |
| tree | 275fdfa7b0f4e03dbe36a9c4451ad658ad2d9b2e /libc/test/src/unistd/link_test.cpp | |
| parent | 035f33bf4138ac7b7360a83438988ce80bda5098 (diff) | |
[libc][NFC] Use specific ASSERT macros to test errno (#79573)
This patch provides specific test macros to deal with `errno`.
This will help abstract away the differences between unit test and integration/hermetic tests in #79319.
In one case we use `libc_errno` which is a struct, in the other case we deal directly with `errno`.
Diffstat (limited to 'libc/test/src/unistd/link_test.cpp')
| -rw-r--r-- | libc/test/src/unistd/link_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/test/src/unistd/link_test.cpp b/libc/test/src/unistd/link_test.cpp index 2d5aa7588b08..bf6962b397b2 100644 --- a/libc/test/src/unistd/link_test.cpp +++ b/libc/test/src/unistd/link_test.cpp @@ -28,14 +28,14 @@ TEST(LlvmLibcLinkTest, CreateAndUnlink) { // 4. Cleanup the file and its link. libc_errno = 0; int write_fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU); - ASSERT_EQ(libc_errno, 0); + ASSERT_ERRNO_SUCCESS(); ASSERT_GT(write_fd, 0); ASSERT_THAT(LIBC_NAMESPACE::close(write_fd), Succeeds(0)); ASSERT_THAT(LIBC_NAMESPACE::link(TEST_FILE, TEST_FILE_LINK), Succeeds(0)); int link_fd = LIBC_NAMESPACE::open(TEST_FILE_LINK, O_PATH); ASSERT_GT(link_fd, 0); - ASSERT_EQ(libc_errno, 0); + ASSERT_ERRNO_SUCCESS(); ASSERT_THAT(LIBC_NAMESPACE::close(link_fd), Succeeds(0)); ASSERT_THAT(LIBC_NAMESPACE::unlink(TEST_FILE), Succeeds(0)); |
