diff mbox series

[v4,1/2] support: Add FAIL test failure helper

Message ID alpine.DEB.2.21.2407041321030.38148@angie.orcam.me.uk
State New
Headers show
Series stdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650] | expand

Commit Message

Maciej W. Rozycki July 4, 2024, 12:59 p.m. UTC
From: Maciej W. Rozycki <macro@redhat.com>

Add a FAIL test failure helper analogous to FAIL_RET, that does not 
cause the current function to return, providing a standardized way to 
report a test failure with a message supplied while permitting the 
caller to continue executing, for further reporting, cleaning up, etc.
---
No change from v3.

New change in v3.
---
 support/check.h |    5 +++++
 1 file changed, 5 insertions(+)

glibc-support-check-fail.diff
diff mbox series

Patch

Index: glibc/support/check.h
===================================================================
--- glibc.orig/support/check.h
+++ glibc/support/check.h
@@ -25,6 +25,11 @@ 
 __BEGIN_DECLS
 
 /* Record a test failure, print the failure message to standard output
+   and pass the result of 1 through.  */
+#define FAIL(...) \
+  support_print_failure_impl (__FILE__, __LINE__, __VA_ARGS__)
+
+/* Record a test failure, print the failure message to standard output
    and return 1.  */
 #define FAIL_RET(...) \
   return support_print_failure_impl (__FILE__, __LINE__, __VA_ARGS__)