diff options
Diffstat (limited to 'contrib/netbsd-tests/h_macros.h')
-rw-r--r-- | contrib/netbsd-tests/h_macros.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/netbsd-tests/h_macros.h b/contrib/netbsd-tests/h_macros.h index 5dd56de..dd730c9 100644 --- a/contrib/netbsd-tests/h_macros.h +++ b/contrib/netbsd-tests/h_macros.h @@ -1,4 +1,4 @@ -/* $NetBSD: h_macros.h,v 1.9 2013/05/17 15:42:09 christos Exp $ */ +/* $NetBSD: h_macros.h,v 1.13 2016/08/20 15:49:08 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -45,13 +45,15 @@ ATF_CHECK_MSG((x) != (v), "%s: %s", #x, strerror(errno)) #define RL(x) REQUIRE_LIBC(x, -1) +#define RLF(x, fmt, arg) \ + ATF_CHECK_MSG((x) != -1, "%s [" fmt "]: %s", #x, arg, strerror(errno)) #define RZ(x) \ do { \ int RZ_rv = x; \ ATF_REQUIRE_MSG(RZ_rv == 0, "%s: %s", #x, strerror(RZ_rv)); \ } while (/*CONSTCOND*/0) -static __inline __printflike(1, 2) void +__dead static __inline __printflike(1, 2) void atf_tc_fail_errno(const char *fmt, ...) { va_list ap; @@ -75,7 +77,7 @@ tests_makegarbage(void *space, size_t len) uint16_t randval; while (len >= sizeof(randval)) { - *sb++ = (random() & 0xffff); + *sb++ = (uint16_t)random(); len -= sizeof(*sb); } randval = (uint16_t)random(); |