/* Now configure a nameserver port. */
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock<=0) {
- tt_fail_perror("socket");
+ tt_abort_perror("socket");
}
evutil_make_socket_nonblocking(sock);
my_addr.sin_port = htons(35353);
my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
- tt_fail_perror("bind");
+ tt_abort_perror("bind");
}
port = evdns_add_server_port(sock, 0, dns_server_request_cb, NULL);
= errorcb_invoked = 0;
if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
- tt_fail_perror("socketpair");
+ tt_abort_perror("socketpair");
}
evutil_make_socket_nonblocking(pair[0]);
TT_STMT_END
/* Fail and abort the current test for the reason in msg */
-#define tt_abort_msg(msg) TT_DIE((msg))
-#define tt_abort() tt_fail_msg("(Failed.)")
+#define tt_abort_printf(msg) TT_DIE(msg)
+#define tt_abort_perror(op) TT_DIE(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_abort_msg(msg) TT_DIE(("%s", msg))
+#define tt_abort() TT_DIE(("%s", "(Failed.)"))
/* Fail but do not abort the current test for the reason in msg. */
-#define tt_fail_msg(msg) TT_FAIL((msg))
-#define tt_fail() tt_fail_msg("(Failed.)")
+#define tt_fail_printf(msg) TT_FAIL(msg)
+#define tt_fail_perror(op) TT_FAIL(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_fail_msg(msg) TT_FAIL(("%s", msg))
+#define tt_fail() TT_FAIL(("%s", "(Failed.)"))
/* End the current test, and indicate we are skipping it. */
#define tt_skip() \
tt_assert_test_type(a,b,#a" "#op" "#b,const char *, \
(strcmp(_val1,_val2) op 0),"<%s>")
-/** Fail and log the errno as with perror. */
-#define tt_fail_perror(op) \
- TT_STMT_BEGIN \
- TT_DIE(("%s: %s [%d]",(op),strerror(errno),errno)); \
- TT_STMT_END
-
#endif