From 5598f1d5da1940ca2f8597b464f331d4cea2cdc0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 13 May 2026 21:37:08 +0200 Subject: Tests and fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 6c44769..1c41d21 100644 --- a/common.h +++ b/common.h @@ -525,9 +525,11 @@ int librecrypt_check_settings_(const char *settings, size_t len, const char *fmt # define EXPECT(EXPR)\ do {\ if (!(EXPR)) {\ + int test_expect_saved_errno__ = errno;\ libtest_expect_zeroed_on_free(0);\ libtest_stop_tracking();\ - fprintf(stderr, "Failure at %s:%i: %s\n", __FILE__, __LINE__, #EXPR);\ + fprintf(stderr, "Failure at %s:%i: %s (errno = %i)\n",\ + __FILE__, __LINE__, #EXPR, test_expect_saved_errno__);\ libtest_dump_stack(NULL, "\t");\ exit(1);\ }\ @@ -538,7 +540,8 @@ int librecrypt_check_settings_(const char *settings, size_t len, const char *fmt if (!(EXPR)) {\ libtest_expect_zeroed_on_free(0);\ libtest_stop_tracking();\ - fprintf(stderr, "Assertion failure at %s:%i: %s\n", __FILE__, __LINE__, #EXPR);\ + fprintf(stderr, "Assertion failure at %s:%i: %s\n",\ + __FILE__, __LINE__, #EXPR);\ libtest_dump_stack(NULL, "\t");\ exit(2);\ }\ -- cgit v1.2.3-70-g09d2