Module Name: src Committed By: pooka Date: Tue Aug 31 17:21:14 UTC 2010
Modified Files: src/tests: h_macros.h Log Message: Add RZ(), which is like RL() except that it checks against 0 and uses the return value as the error number instead of errno. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/h_macros.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/h_macros.h diff -u src/tests/h_macros.h:1.5 src/tests/h_macros.h:1.6 --- src/tests/h_macros.h:1.5 Mon Aug 16 17:01:43 2010 +++ src/tests/h_macros.h Tue Aug 31 17:21:14 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: h_macros.h,v 1.5 2010/08/16 17:01:43 pooka Exp $ */ +/* $NetBSD: h_macros.h,v 1.6 2010/08/31 17:21:14 pooka Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -44,6 +44,11 @@ ATF_CHECK_MSG((x) != (v), "%s: %s", #x, strerror(errno)) #define RL(x) REQUIRE_LIBC(x, -1) +#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 void atf_tc_fail_errno(const char *fmt, ...)