-/* $OpenBSD: atf-c.h,v 1.3 2021/09/02 12:40:44 mbuhl Exp $ */
+/* $OpenBSD: atf-c.h,v 1.4 2022/05/28 18:39:39 mbuhl Exp $ */
/*
* Copyright (c) 2019 Moritz Buhl <openbsd@moritzbuhl.de>
*
#define ATF_CHECK_STREQ ATF_REQUIRE_STREQ
#define atf_req(exp, err, msg, ...) \
- atf_require(exp, err, #exp, __FILE__, __LINE__, NULL)
+ atf_require(exp, err, #exp, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define ATF_REQUIRE(exp) atf_req(exp, -1, NULL)
#define ATF_REQUIRE_ERRNO(no, exp) atf_req(exp, no, NULL)
#define ATF_REQUIRE_MSG(exp, fmt, ...) atf_req(exp, -1, fmt, ##__VA_ARGS__)
-/* $OpenBSD: t_poll.c,v 1.2 2020/11/09 23:18:51 bluhm Exp $ */
+/* $OpenBSD: t_poll.c,v 1.3 2022/05/28 18:39:39 mbuhl Exp $ */
/* $NetBSD: t_poll.c,v 1.4 2020/07/17 15:34:16 kamil Exp $ */
/*-
*/
pfds[0].revents = -1;
pfds[1].revents = -1;
- ATF_REQUIRE_EQ_MSG(ret = poll(&pfds[0], 1, 1), 0,
- "got: %d", ret);
+ ret = poll(&pfds[0], 1, 1);
+ ATF_REQUIRE_EQ_MSG(ret, 0, "got: %d", ret);
ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
ATF_REQUIRE_EQ_MSG(pfds[1].revents, -1, "got: %d", pfds[1].revents);
/* Check that the write end of the pipe as reported as ready. */
pfds[0].revents = -1;
pfds[1].revents = -1;
- ATF_REQUIRE_EQ_MSG(ret = poll(&pfds[1], 1, 1), 1,
- "got: %d", ret);
+ ret = poll(&pfds[1], 1, 1);
+ ATF_REQUIRE_EQ_MSG(ret, 1, "got: %d", ret);
ATF_REQUIRE_EQ_MSG(pfds[0].revents, -1, "got: %d", pfds[0].revents);
ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",\
pfds[1].revents);
/* Check that only the write end of the pipe as reported as ready. */
pfds[0].revents = -1;
pfds[1].revents = -1;
- ATF_REQUIRE_EQ_MSG(ret = poll(pfds, 2, 1), 1,
- "got: %d", ret);
+ ret = poll(pfds, 2, 1);
+ ATF_REQUIRE_EQ_MSG(ret, 1, "got: %d", ret);
ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents);
ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
pfds[1].revents);
/* Check that both ends of our pipe are reported as ready. */
pfds[0].revents = -1;
pfds[1].revents = -1;
- ATF_REQUIRE_EQ_MSG(ret = poll(pfds, 2, 1), 2,
- "got: %d", ret);
+ ret = poll(pfds, 2, 1);
+ ATF_REQUIRE_EQ_MSG(ret, 2, "got: %d", ret);
ATF_REQUIRE_EQ_MSG(pfds[0].revents, POLLIN, "got: %d",
pfds[0].revents);
ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",
-/* $OpenBSD: atf-c.h,v 1.1 2021/10/22 18:00:22 mbuhl Exp $ */
+/* $OpenBSD: atf-c.h,v 1.2 2022/05/28 18:39:39 mbuhl Exp $ */
/*
* Copyright (c) 2019-2021 Moritz Buhl <mbuhl@openbsd.org>
*
#define ATF_CHECK_STREQ ATF_REQUIRE_STREQ
#define atf_req(exp, err, msg, ...) \
- atf_require(exp, err, #exp, __FILE__, __LINE__, NULL)
+ atf_require(exp, err, #exp, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define ATF_REQUIRE(exp) atf_req(exp, -1, NULL)
#define ATF_REQUIRE_ERRNO(no, exp) atf_req(exp, no, NULL)
#define ATF_REQUIRE_MSG(exp, fmt, ...) atf_req(exp, -1, fmt, ##__VA_ARGS__)