[LTP] [PATCH v4 3/9] lib/tst_test: define TEST_VOID() macro

Sumit Garg
2019-02-21T09:00:10Z

Define TEST_VOID() macro for syscalls whose return type is void like
sync() etc.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
include/tst_test.h | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/include/tst_test.h b/include/tst_test.h
index 12dda2e..03c88e3 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -216,6 +216,13 @@ void tst_reinit(void);
TST_ERR = errno; \
} while (0)

+#define TEST_VOID(SCALL) \
+ do { \
+ errno = 0; \
+ SCALL; \
+ TST_ERR = errno; \
+ } while (0)
+
extern long TST_RET;
extern int TST_ERR;

--
2.7.4