diff --git a/libc-test/src/functionalext/fortify/fcntl_ext.c b/libc-test/src/functionalext/fortify/fcntl_ext.c index 3a7320aa876aea10e4632092043b50e6e145ba6a..38090e301e8c5b10ec787874746dd5d7a84880e7 100644 --- a/libc-test/src/functionalext/fortify/fcntl_ext.c +++ b/libc-test/src/functionalext/fortify/fcntl_ext.c @@ -18,6 +18,7 @@ #include #include #include "fortify_test.h" +#include "functionalext.h" #include "test.h" #define FILE_MODE_ALL (0777) @@ -120,7 +121,7 @@ static void open_0030(void) static void open_0040(void) { int fd = open("/proc/version", O_RDWR); - TEST(fd != -1); + EXPECT_NE(open_0040, fd, -1); close(fd); return; @@ -216,7 +217,7 @@ static void openat_0030(void) static void openat_0040(void) { int fd = openat(AT_FDCWD, "/proc/version", O_RDWR); - TEST(fd != -1); + EXPECT_NE(openat_0040, fd, -1); close(fd); return; @@ -313,7 +314,7 @@ static void open64_0030(void) static void open64_0040(void) { int fd = open64("/proc/version", O_RDWR); - TEST(fd != -1); + EXPECT_NE(open64_0040, fd, -1); close(fd); return; @@ -409,7 +410,7 @@ static void openat64_0030(void) static void openat64_0040(void) { int fd = openat64(AT_FDCWD, "/proc/version", O_RDWR); - TEST(fd != -1); + EXPECT_NE(openat64_0040, fd, -1); close(fd); return; diff --git a/libc-test/src/functionalext/fortify/poll.c b/libc-test/src/functionalext/fortify/poll.c index 730846c17295eb2c8b3aaa4df7ce5080dbf89ab4..d3a0b615ac437d614736c168b2fe7f0d6c36ac2e 100644 --- a/libc-test/src/functionalext/fortify/poll.c +++ b/libc-test/src/functionalext/fortify/poll.c @@ -19,6 +19,7 @@ #include #include #include "fortify_test.h" +#include "functionalext.h" #include "test.h" #define PPOLL_TIMESPEC_NSEC (100) @@ -82,7 +83,7 @@ static void poll_0030(void) { nfds_t fd_count = atoi("1"); struct pollfd buf[2] = {{0, POLLIN, 0}, {1, POLLIN, 0}}; - TEST(poll(buf, fd_count, 1) == 1); + EXPECT_EQ(poll_0030, poll(buf, fd_count, 1), 1); return; } @@ -151,7 +152,7 @@ static void ppoll_0030(void) nfds_t fd_count = atoi("1"); struct pollfd buf[2] = {{0, POLLIN, 0}, {1, POLLIN, 0}}; struct timespec ts = { .tv_nsec = PPOLL_TIMESPEC_NSEC }; - TEST(ppoll(buf, fd_count, &ts, NULL) == 1); + EXPECT_EQ(ppoll_0030, ppoll(buf, fd_count, &ts, NULL), 1); return; } diff --git a/libc-test/src/functionalext/fortify/string_ext.c b/libc-test/src/functionalext/fortify/string_ext.c index cfade06fb55969685392ce4952fdd0404fa88c0f..d01083744cd840f97bd4d86f032229917249e49e 100644 --- a/libc-test/src/functionalext/fortify/string_ext.c +++ b/libc-test/src/functionalext/fortify/string_ext.c @@ -20,6 +20,7 @@ #include #include #include "fortify_test.h" +#include "functionalext.h" #include "test.h" #include "../../../../porting/linux/user/include/fortify/fortify.h" @@ -909,7 +910,7 @@ static void test_strlen_0020() exit(0); default: waitpid(pid, &status, WUNTRACED); - TEST(WIFEXITED(status) == 0); + EXPECT_EQ(test_strlen_0020, WIFEXITED(status), 0); kill(pid, SIGCONT); break; } diff --git a/libc-test/src/functionalext/supplement/passwd/getspnam_r.c b/libc-test/src/functionalext/supplement/passwd/getspnam_r.c index d8d77ade952d064fe9dcc5211b5faa383fc962eb..38d3b0cce328c7fec74db7f2b5f5d67dc21a4b8a 100644 --- a/libc-test/src/functionalext/supplement/passwd/getspnam_r.c +++ b/libc-test/src/functionalext/supplement/passwd/getspnam_r.c @@ -16,6 +16,7 @@ #include #include #include +#include "functionalext.h" #include "test.h" /** @@ -34,15 +35,9 @@ void getspnam_r_0100(void) const char *spwd_name = "root"; int result = getspnam_r(spwd_name, &spwd_storage, buf, sizeof(buf), &spwd); - if (result != 0) { - t_error("%s getgrnam_r failed\n", __func__); - } - if (!spwd) { - t_error("%s failed, spwd is NULL\n", __func__); - } - if (strcmp(spwd_name, spwd->sp_namp)) { - t_error("%s spwd->sp_namp is %s\n", __func__, spwd->sp_namp); - } + EXPECT_EQ(getspnam_r_0100, result, 0); + EXPECT_PTRNE(getspnam_r_0100, spwd, NULL); + EXPECT_EQ(getspnam_r_0100, strcmp(spwd_name, spwd->sp_namp), 0); } int main(int argc, char *argv[]) diff --git a/libc-test/src/functionalext/thread/pthread_mutex_ext.c b/libc-test/src/functionalext/thread/pthread_mutex_ext.c index 44ce2ad77acd2769984e6b22b2ee9eb04a5018a9..9cf05314d9e5d8f1efabf9b0727c01e76519f2c6 100644 --- a/libc-test/src/functionalext/thread/pthread_mutex_ext.c +++ b/libc-test/src/functionalext/thread/pthread_mutex_ext.c @@ -310,7 +310,7 @@ static void pthread_mutex_timedlock_monotonic_np_0030(void) { pthread_mutex_t *mtx = (pthread_mutex_t *)NULL; struct timespec ts = {0}; - TEST(pthread_mutex_timedlock_monotonic_np(mtx, &ts) == EINVAL); + EXPECT_EQ(pthread_mutex_timedlock_monotonic_np(mtx, &ts), EINVAL); } /********************************************* Test case dividing line ***********************************************/ diff --git a/libc-test/src/functionalext/thread/pthread_rwlock_rdlock.c b/libc-test/src/functionalext/thread/pthread_rwlock_rdlock.c index 01823c6bb7117be58cfd87bff77eb9dda9f97b63..45a900e7ad3132c7ee16f56fe870ad832ce48585 100644 --- a/libc-test/src/functionalext/thread/pthread_rwlock_rdlock.c +++ b/libc-test/src/functionalext/thread/pthread_rwlock_rdlock.c @@ -277,7 +277,7 @@ static void pthread_rwlock_timedrdlock_monotonic_np_0020(void) static void pthread_rwlock_timedrdlock_monotonic_np_0030(void) { struct timespec ts = {0}; - TEST(pthread_rwlock_timedrdlock_monotonic_np((pthread_rwlock_t *)NULL, &ts) == EINVAL); + EXPECT_EQ(pthread_rwlock_timedrdlock_monotonic_np((pthread_rwlock_t *)NULL, &ts), EINVAL); } int main(void)