From: Michael Tremer Date: Tue, 5 Oct 2021 16:19:42 +0000 (+0000) Subject: testsuite: Safety check if value is suddenly NULL X-Git-Tag: 0.9.28~892 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bcbc1cf4881a034383e13574197b7fcc8305959;p=pakfire.git testsuite: Safety check if value is suddenly NULL Signed-off-by: Michael Tremer --- diff --git a/tests/testsuite.h b/tests/testsuite.h index d2c06c00a..ee108563f 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -126,6 +126,11 @@ int testsuite_run(); #define ASSERT_STRING_EQUALS(value, string) \ do { \ + if (!value) { \ + LOG_ERROR("Failed assertion: " #value " is NULL, expected " #string " at %s:%d\n", \ + __FILE__, __LINE__, __PRETTY_FUNCTION__); \ + goto FAIL; \ + } \ if (strcmp(string, value) != 0) { \ LOG_ERROR("Failed assertion: " #value " (%s) != " #string " %s:%d %s\n", \ value, __FILE__, __LINE__, __PRETTY_FUNCTION__); \