From: Aki Tuomi Date: Sun, 17 Nov 2024 11:09:46 +0000 (+0200) Subject: var-expand-crypt: Initialize/deinitialize with test runner X-Git-Tag: 2.4.1~530 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b83b726ca60da3b514590c6c8699ef7473c605c1;p=thirdparty%2Fdovecot%2Fcore.git var-expand-crypt: Initialize/deinitialize with test runner --- diff --git a/src/plugins/var-expand-crypt/test-var-expand-crypt.c b/src/plugins/var-expand-crypt/test-var-expand-crypt.c index 9a7b31e6c1..bac1505928 100644 --- a/src/plugins/var-expand-crypt/test-var-expand-crypt.c +++ b/src/plugins/var-expand-crypt/test-var-expand-crypt.c @@ -12,6 +12,11 @@ struct module; extern void var_expand_crypt_init(struct module *module); extern void var_expand_crypt_deinit(void); +static void test_var_expand_crypt_init(void) +{ + var_expand_crypt_init(NULL); +} + static void test_var_expand_crypt(void) { struct var_expand_table table[] = { @@ -66,7 +71,6 @@ static void test_var_expand_crypt(void) unsigned int i; test_begin("var_expand_crypt"); - var_expand_crypt_init(NULL); for(i=0; i < N_ELEMENTS(test_cases); i++) T_BEGIN { const char *error; @@ -107,15 +111,21 @@ static void test_var_expand_crypt(void) test_assert_strcmp_idx(str_c(output), table[4].value, i); }; - var_expand_crypt_deinit(); test_end(); } +static void test_var_expand_crypt_deinit(void) +{ + var_expand_crypt_deinit(); +} + int main(void) { int ret = 0; static void (*const test_functions[])(void) = { + test_var_expand_crypt_init, test_var_expand_crypt, + test_var_expand_crypt_deinit, NULL }; struct dcrypt_settings set = {