summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-30 13:01:08 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-04-02 09:03:42 +0200
commit71fddde83652d8048034532474e3b1cb32b33077 (patch)
tree99ac91a66510d89040103dde133bb01c96f2eb34 /lib
parente301d1b9606d9323f0a1776d3a0dbce4b6db83a5 (diff)
downloadsamba-71fddde83652d8048034532474e3b1cb32b33077.tar.gz
tdb/test: always call fflush() after [f]printf() in tap-interface.h
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/test/tap-interface.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/tdb/test/tap-interface.h b/lib/tdb/test/tap-interface.h
index d9ed6e84ea5..b8ce7df6099 100644
--- a/lib/tdb/test/tap-interface.h
+++ b/lib/tdb/test/tap-interface.h
@@ -31,9 +31,27 @@
#endif
#define plan_tests(num)
-#define ok(e, ...) do { if (e) { (void)printf("."); } else { fprintf(stderr, __VA_ARGS__); exit(1); } } while(0)
+#define fail(...) do { \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stdout, "\n"); \
+ fflush(stderr); \
+ exit(1); \
+} while(0)
+#define diag(...) do { \
+ fprintf(stdout, __VA_ARGS__); \
+ fprintf(stdout, "\n"); \
+ fflush(stdout); \
+} while(0)
+#define pass(...) do { \
+ fprintf(stdout, "."); \
+ fflush(stdout); \
+} while(0)
+#define ok(e, ...) do { \
+ if (e) { \
+ pass(); \
+ } else { \
+ fail(__VA_ARGS__); \
+ } \
+} while(0)
#define ok1(e) ok((e), "%s:%s", __location__, #e)
-#define pass(...) printf(".")
-#define fail(...) do { fprintf(stderr, __VA_ARGS__); exit(1); } while(0)
-#define diag printf
#define exit_status() 0