From: Aki Tuomi Date: Mon, 10 Nov 2025 08:35:00 +0000 (+0200) Subject: lib-var-expand: test-var-expand - Print more useful error if test->out is empty X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5b4dd98b25f4554b8eeda585b3df0efba191c57;p=thirdparty%2Fdovecot%2Fcore.git lib-var-expand: test-var-expand - Print more useful error if test->out is empty --- diff --git a/src/lib-var-expand/test-var-expand.c b/src/lib-var-expand/test-var-expand.c index 750ed65c49..e2c4b5a0e6 100644 --- a/src/lib-var-expand/test-var-expand.c +++ b/src/lib-var-expand/test-var-expand.c @@ -44,10 +44,12 @@ static void run_var_expand_tests(const struct var_expand_params *params, test_assert_idx(error != NULL, i); test_assert_idx(dest->used == 0,i ); if (test->ret < 0) { - i_assert(test->out != NULL && *test->out != '\0'); + i_assert(test->out != NULL); const char *match = strstr(error, test->out); test_assert_idx(match != NULL, i); - if (match == NULL) { + if (*test->out == '\0') + i_debug("unexpected error '%s'", error); + else if (match == NULL) { i_debug("error '%s' does not contain '%s'", error, test->out); }