]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests/name-constraints-ip: turn check_for_error into a macro
authorAlexander Sosedkin <asosedkin@redhat.com>
Sun, 1 Mar 2026 23:51:05 +0000 (00:51 +0100)
committerAlexander Sosedkin <asosedkin@redhat.com>
Tue, 3 Mar 2026 16:01:50 +0000 (17:01 +0100)
This way we can get more meaningful diagnostics
with the use of the __LINE__ macro and tell the failures apart.

Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
tests/name-constraints-ip.c

index a0cf172b7f4bb87478be6d8e3d7377d2585a05fe..11e508aa79b0dfb5d6e5d6bd68320f0f65ed896f 100644 (file)
@@ -51,11 +51,12 @@ extern int
 _gnutls_x509_name_constraints_merge(gnutls_x509_name_constraints_t nc,
                                    gnutls_x509_name_constraints_t nc2);
 
-static void check_for_error(int ret)
-{
-       if (ret != GNUTLS_E_SUCCESS)
-               fail_msg("error in %d: %s\n", __LINE__, gnutls_strerror(ret));
-}
+#define check_for_error(ret)                                    \
+       do {                                                    \
+               if (ret != GNUTLS_E_SUCCESS)                    \
+                       fail_msg("error in %d: %s\n", __LINE__, \
+                                gnutls_strerror(ret));         \
+       } while (0)
 
 #define IP_ACCEPTED 1
 #define IP_REJECTED 0