1 #include <ccan/tap/tap.h>
8 #define CCAN_RFC822_DEBUG
10 #include <ccan/rfc822/rfc822.h>
12 #include <ccan/rfc822/rfc822.c>
16 static void *failing_malloc(size_t size)
21 static void abort_handler(int signum)
27 int main(int argc, char *argv[])
31 struct rfc822_msg *msg;
32 struct sigaction sa = {
33 .sa_handler = abort_handler,
39 ret = sigaction(SIGABRT, &sa, NULL);
40 ok(ret, "Couldn't install signal handler: %s", strerror(errno));
42 buf = assemble_msg(&test_msg_1, &len, 0);
44 msg = rfc822_start(NULL, buf, len);
46 talloc_set_allocator(failing_malloc, free, realloc);
48 (void) rfc822_next_header(msg, NULL);
50 ok(0, "Didn't get SIGABRT");