]> git.ipfire.org Git - pakfire.git/commitdiff
testsuite: Translate negative return values
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 12:22:22 +0000 (12:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 Oct 2024 11:37:24 +0000 (11:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.h

index 746190cc3968c3903d9fd4c223e88ae2d1e9db42..6cfbc1794c0cb119d7aeb650f41bce34bfc6e401 100644 (file)
@@ -138,8 +138,8 @@ ERROR:
        do { \
                int __r = expr; \
                if (__r) { \
-                       LOG_ERROR("Failed assertion: %s (r = %d, errno = %s) at %s:%d %s\n", \
-                               #expr, __r, strerror(errno), __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+                       LOG_ERROR("Failed assertion: %s (r = %d - %s, errno = %s) at %s:%d %s\n", \
+                               #expr, __r, (__r < 0) ? strerror(-__r) : "UNKNOWN", strerror(errno), __FILE__, __LINE__, __PRETTY_FUNCTION__); \
                        goto FAIL; \
                } \
        } while (0)