From f370c324ecc6ab29400b4e02c848b42ec90f3d97 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 28 Jul 2018 22:03:38 +0100 Subject: [PATCH] test: tidy/clang-format --- test/config/account.c | 25 +++++++++++------------ test/config/address.c | 11 ++++------ test/config/bool.c | 17 ++++++++-------- test/config/command.c | 11 ++++------ test/config/common.c | 22 +++++++++----------- test/config/common.h | 2 +- test/config/initial.c | 8 ++------ test/config/long.c | 47 ++++++++++++++++++++----------------------- test/config/magic.c | 19 ++++++++--------- test/config/main.c | 2 +- test/config/mbtable.c | 13 +++++------- test/config/number.c | 11 ++++------ test/config/path.c | 11 ++++------ test/config/quad.c | 22 +++++++++++--------- test/config/regex.c | 12 ++++------- test/config/set.c | 23 +++++++++++---------- test/config/sort.c | 17 ++++++++-------- test/config/string.c | 11 ++++------ test/config/synonym.c | 8 ++------ 19 files changed, 127 insertions(+), 165 deletions(-) diff --git a/test/config/account.c b/test/config/account.c index c562458d7..24ca064a5 100644 --- a/test/config/account.c +++ b/test/config/account.c @@ -25,17 +25,10 @@ #include "config.h" #include #include -#include "mutt/buffer.h" -#include "mutt/hash.h" -#include "mutt/logging.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/inheritance.h" -#include "config/number.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static short VarApple; static short VarBanana; @@ -57,7 +50,8 @@ static struct ConfigDef Vars[] = { * @param var_names List of config items (NULL terminated) * @retval ptr New Account object */ -struct Account *ac_create(const struct ConfigSet *cs, const char *name, const char *var_names[]) +struct Account *ac_create(const struct ConfigSet *cs, const char *name, + const char *var_names[]) { if (!cs || !name || !var_names) return NULL; /* LCOV_EXCL_LINE */ @@ -201,7 +195,8 @@ void config_account(void) const char *account = "damaged"; const char *BrokenVarStr[] = { - "Pineapple", NULL, + "Pineapple", + NULL, }; struct Account *ac = ac_create(cs, account, BrokenVarStr); @@ -217,7 +212,9 @@ void config_account(void) } const char *AccountVarStr2[] = { - "Apple", "Apple", NULL, + "Apple", + "Apple", + NULL, }; TEST_MSG("Expect error for next test\n"); @@ -231,7 +228,9 @@ void config_account(void) account = "fruit"; const char *AccountVarStr[] = { - "Apple", "Cherry", NULL, + "Apple", + "Cherry", + NULL, }; ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/address.c b/test/config/address.c index 195ff0c16..51175e383 100644 --- a/test/config/address.c +++ b/test/config/address.c @@ -27,14 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" -#include "config/address.h" #include "config/common.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" #include "email/address.h" static struct Address *VarApple; @@ -547,7 +543,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarAddr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarAddr); diff --git a/test/config/bool.c b/test/config/bool.c index 54ae348f5..ed051a951 100644 --- a/test/config/bool.c +++ b/test/config/bool.c @@ -27,15 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" -#include "config/bool.h" #include "config/common.h" -#include "config/quad.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static bool VarApple; static bool VarBanana; @@ -172,7 +167,10 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err) "no", "yes", "n", "y", "false", "true", "0", "1", "off", "on", }; const char *invalid[] = { - "nope", "ye", "", NULL, + "nope", + "ye", + "", + NULL, }; char *name = "Damson"; @@ -524,7 +522,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/command.c b/test/config/command.c index 4e480504a..45431c37d 100644 --- a/test/config/command.c +++ b/test/config/command.c @@ -26,14 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" -#include "config/command.h" #include "config/common.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static char *VarApple; static char *VarBanana; @@ -574,7 +570,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/common.c b/test/config/common.c index 9131b19e7..9aa5617e2 100644 --- a/test/config/common.c +++ b/test/config/common.c @@ -28,13 +28,8 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/hash.h" -#include "mutt/memory.h" -#include "mutt/string2.h" -#include "config/inheritance.h" -#include "config/set.h" -#include "config/types.h" +#include "mutt/mutt.h" +#include "config/lib.h" #include "common.h" const char *line = "----------------------------------------" @@ -42,7 +37,8 @@ const char *line = "----------------------------------------" bool dont_fail = false; -int validator_fail(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *result) +int validator_fail(const struct ConfigSet *cs, const struct ConfigDef *cdef, + intptr_t value, struct Buffer *result) { if (dont_fail) return CSR_SUCCESS; @@ -54,7 +50,8 @@ int validator_fail(const struct ConfigSet *cs, const struct ConfigDef *cdef, int return CSR_ERR_INVALID; } -int validator_warn(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *result) +int validator_warn(const struct ConfigSet *cs, const struct ConfigDef *cdef, + intptr_t value, struct Buffer *result) { if (value > 1000000) mutt_buffer_printf(result, "%s: %s, (ptr)", __func__, cdef->name); @@ -63,7 +60,8 @@ int validator_warn(const struct ConfigSet *cs, const struct ConfigDef *cdef, int return CSR_SUCCESS | CSR_SUC_WARNING; } -int validator_succeed(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *result) +int validator_succeed(const struct ConfigSet *cs, const struct ConfigDef *cdef, + intptr_t value, struct Buffer *result) { if (value > 1000000) mutt_buffer_printf(result, "%s: %s, (ptr)", __func__, cdef->name); @@ -83,7 +81,8 @@ void short_line(void) TEST_MSG("%s\n", line + 40); } -bool log_listener(const struct ConfigSet *cs, struct HashElem *he, const char *name, enum ConfigEvent ev) +bool log_listener(const struct ConfigSet *cs, struct HashElem *he, + const char *name, enum ConfigEvent ev) { struct Buffer result; mutt_buffer_init(&result); @@ -186,4 +185,3 @@ void cs_dump_set(const struct ConfigSet *cs) FREE(&result.data); } - diff --git a/test/config/common.h b/test/config/common.h index 827a7a769..21029e93b 100644 --- a/test/config/common.h +++ b/test/config/common.h @@ -25,7 +25,7 @@ #include #include -#include "config/set.h" +#include "config/lib.h" struct Buffer; struct Hash; diff --git a/test/config/initial.c b/test/config/initial.c index dc0949def..f43cbf1f7 100644 --- a/test/config/initial.c +++ b/test/config/initial.c @@ -25,13 +25,9 @@ #include "config.h" #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/common.h" -#include "config/set.h" -#include "config/string3.h" -#include "config/types.h" +#include "config/lib.h" static char *VarApple; static char *VarBanana; diff --git a/test/config/long.c b/test/config/long.c index 460675bb9..a859f18a5 100644 --- a/test/config/long.c +++ b/test/config/long.c @@ -27,14 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/long.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static long VarApple; static long VarBanana; @@ -76,8 +72,8 @@ static struct ConfigDef Vars[] = { static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err) { log_line(__func__); - TEST_MSG("Apple = %d\n", VarApple); - TEST_MSG("Banana = %d\n", VarBanana); + TEST_MSG("Apple = %ld\n", VarApple); + TEST_MSG("Banana = %ld\n", VarBanana); if (!TEST_CHECK(VarApple == -42)) { @@ -116,7 +112,7 @@ static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err) FREE(&value.data); return false; } - TEST_MSG("Apple = %d\n", VarApple); + TEST_MSG("Apple = %ld\n", VarApple); TEST_MSG("Apple's initial value is '%s'\n", value.data); mutt_buffer_reset(&value); @@ -134,7 +130,7 @@ static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err) FREE(&value.data); return false; } - TEST_MSG("Banana = %d\n", VarBanana); + TEST_MSG("Banana = %ld\n", VarBanana); TEST_MSG("Banana's initial value is '%s'\n", NONULL(value.data)); mutt_buffer_reset(&value); @@ -155,7 +151,7 @@ static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err) return false; } - TEST_MSG("Cherry = %d\n", VarCherry); + TEST_MSG("Cherry = %ld\n", VarCherry); TEST_MSG("Cherry's initial value is %s\n", value.data); FREE(&value.data); @@ -198,7 +194,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("Value of %s wasn't changed\n", name); return false; } - TEST_MSG("%s = %d, set by '%s'\n", name, VarDamson, valid[i]); + TEST_MSG("%s = %ld, set by '%s'\n", name, VarDamson, valid[i]); short_line(); } @@ -251,7 +247,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("Get failed: %s\n", err->data); return false; } - TEST_MSG("%s = %d, %s\n", name, VarFig, err->data); + TEST_MSG("%s = %ld, %s\n", name, VarFig, err->data); VarFig = -789; mutt_buffer_reset(err); @@ -261,7 +257,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("Get failed: %s\n", err->data); return false; } - TEST_MSG("%s = %d, %s\n", name, VarFig, err->data); + TEST_MSG("%s = %ld, %s\n", name, VarFig, err->data); log_line(__func__); return true; @@ -289,7 +285,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err) return false; } - TEST_MSG("%s = %d, set to '%d'\n", name, VarGuava, value); + TEST_MSG("%s = %ld, set to '%ld'\n", name, VarGuava, value); short_line(); TEST_MSG("Setting %s to %d\n", name, value); @@ -364,7 +360,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err) return false; } - TEST_MSG("Reset: %s = %d\n", name, VarJackfruit); + TEST_MSG("Reset: %s = %ld\n", name, VarJackfruit); short_line(); name = "Kumquat"; @@ -375,7 +371,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err) rc = cs_str_string_set(cs, name, "99", err); if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS)) return false; - TEST_MSG("Set: %s = %d\n", name, VarKumquat); + TEST_MSG("Set: %s = %ld\n", name, VarKumquat); dont_fail = false; rc = cs_str_reset(cs, name, err); @@ -395,7 +391,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err) return false; } - TEST_MSG("Reset: %s = %d\n", name, VarKumquat); + TEST_MSG("Reset: %s = %ld\n", name, VarKumquat); log_line(__func__); return true; @@ -418,7 +414,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("String: %s = %d\n", name, VarLemon); + TEST_MSG("String: %s = %ld\n", name, VarLemon); short_line(); VarLemon = 456; @@ -433,7 +429,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("Native: %s = %d\n", name, VarLemon); + TEST_MSG("Native: %s = %ld\n", name, VarLemon); short_line(); name = "Mango"; @@ -449,7 +445,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("String: %s = %d\n", name, VarMango); + TEST_MSG("String: %s = %ld\n", name, VarMango); short_line(); VarMango = 456; @@ -464,7 +460,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("Native: %s = %d\n", name, VarMango); + TEST_MSG("Native: %s = %ld\n", name, VarMango); short_line(); name = "Nectarine"; @@ -480,7 +476,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("String: %s = %d\n", name, VarNectarine); + TEST_MSG("String: %s = %ld\n", name, VarNectarine); short_line(); VarNectarine = 456; @@ -495,7 +491,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err) TEST_MSG("%s\n", err->data); return false; } - TEST_MSG("Native: %s = %d\n", name, VarNectarine); + TEST_MSG("Native: %s = %ld\n", name, VarNectarine); log_line(__func__); return true; @@ -521,7 +517,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/magic.c b/test/config/magic.c index 99657020d..0f5a45b19 100644 --- a/test/config/magic.c +++ b/test/config/magic.c @@ -27,14 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/magic.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static short VarApple; static short VarBanana; @@ -197,8 +193,8 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err) } else { - TEST_MSG("This test should have failed\n"); - return false; + TEST_MSG("This test should have failed\n"); + return false; } for (unsigned int i = 0; i < mutt_array_size(invalid); i++) @@ -287,8 +283,8 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err) } else { - TEST_MSG("This test should have failed\n"); - return false; + TEST_MSG("This test should have failed\n"); + return false; } int invalid[] = { 0, 5 }; @@ -512,7 +508,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/main.c b/test/config/main.c index 008f1daf5..49676336d 100644 --- a/test/config/main.c +++ b/test/config/main.c @@ -27,7 +27,7 @@ #include #include #include -#include "mutt/logging.h" +#include "mutt/mutt.h" #include "test/config/account2.h" #include "test/config/address.h" #include "test/config/bool.h" diff --git a/test/config/mbtable.c b/test/config/mbtable.c index c33224bb6..e1bd84804 100644 --- a/test/config/mbtable.c +++ b/test/config/mbtable.c @@ -26,14 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/mbtable.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static struct MbTable *VarApple; static struct MbTable *VarBanana; @@ -563,7 +559,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarMb[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarMb); @@ -608,10 +605,10 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) } dump_native(cs, parent, child); + log_line(__func__); result = true; ti_out: ac_free(cs, &ac); - log_line(__func__); return result; } diff --git a/test/config/number.c b/test/config/number.c index fdc8e7edc..d593f17c7 100644 --- a/test/config/number.c +++ b/test/config/number.c @@ -27,14 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/number.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static short VarApple; static short VarBanana; @@ -540,7 +536,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/path.c b/test/config/path.c index 42403291b..8c3313c29 100644 --- a/test/config/path.c +++ b/test/config/path.c @@ -26,14 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/path.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static char *VarApple; static char *VarBanana; @@ -574,7 +570,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/quad.c b/test/config/quad.c index 8b0b6942a..3f6a41e37 100644 --- a/test/config/quad.c +++ b/test/config/quad.c @@ -27,15 +27,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" -#include "config/bool.h" #include "config/common.h" -#include "config/quad.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static char VarApple; static char VarBanana; @@ -170,7 +165,10 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err) const char *valid[] = { "no", "yes", "ask-no", "ask-yes" }; const char *invalid[] = { - "nope", "ye", "", NULL, + "nope", + "ye", + "", + NULL, }; char *name = "Damson"; @@ -531,7 +529,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); @@ -601,7 +600,10 @@ static bool test_toggle(struct ConfigSet *cs, struct Buffer *err) }; struct ToggleTest tests[] = { - { MUTT_NO, MUTT_YES }, { MUTT_YES, MUTT_NO }, { MUTT_ASKNO, MUTT_ASKYES }, { MUTT_ASKYES, MUTT_ASKNO }, + { MUTT_NO, MUTT_YES }, + { MUTT_YES, MUTT_NO }, + { MUTT_ASKNO, MUTT_ASKYES }, + { MUTT_ASKYES, MUTT_ASKNO }, }; char *name = "Nectarine"; diff --git a/test/config/regex.c b/test/config/regex.c index 80fec2f16..4c147d94c 100644 --- a/test/config/regex.c +++ b/test/config/regex.c @@ -26,15 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/regex3.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/regex2.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static struct Regex *VarApple; static struct Regex *VarBanana; @@ -614,7 +609,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarRegex[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarRegex); diff --git a/test/config/set.c b/test/config/set.c index 655b3e39b..91f123a1d 100644 --- a/test/config/set.c +++ b/test/config/set.c @@ -27,13 +27,9 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" -#include "config/bool.h" +#include "mutt/mutt.h" #include "config/common.h" -#include "config/set.h" -#include "config/types.h" +#include "config/lib.h" static short VarApple; static bool VarBanana; @@ -46,27 +42,32 @@ static struct ConfigDef Vars[] = { }; // clang-format on -static int dummy_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) +static int dummy_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, + const char *value, struct Buffer *err) { return CSR_ERR_CODE; } -static int dummy_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) +static int dummy_string_get(const struct ConfigSet *cs, void *var, + const struct ConfigDef *cdef, struct Buffer *result) { return CSR_ERR_CODE; } -static int dummy_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) +static int dummy_native_set(const struct ConfigSet *cs, void *var, + const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) { return CSR_ERR_CODE; } -static intptr_t dummy_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) +static intptr_t dummy_native_get(const struct ConfigSet *cs, void *var, + const struct ConfigDef *cdef, struct Buffer *err) { return INT_MIN; } -static int dummy_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) +static int dummy_reset(const struct ConfigSet *cs, void *var, + const struct ConfigDef *cdef, struct Buffer *err) { return CSR_ERR_CODE; } diff --git a/test/config/sort.c b/test/config/sort.c index ba0844b33..ea40e852e 100644 --- a/test/config/sort.c +++ b/test/config/sort.c @@ -26,15 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/mapping.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/set.h" -#include "config/sort.h" -#include "config/types.h" +#include "config/lib.h" static short VarApple; static short VarBanana; @@ -227,7 +222,10 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err) } const char *invalid[] = { - "-1", "999", "junk", NULL, + "-1", + "999", + "junk", + NULL, }; for (unsigned int j = 0; j < mutt_array_size(invalid); j++) @@ -635,7 +633,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/string.c b/test/config/string.c index c975923ab..98a6512ff 100644 --- a/test/config/string.c +++ b/test/config/string.c @@ -26,14 +26,10 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/account.h" #include "config/common.h" -#include "config/set.h" -#include "config/string3.h" -#include "config/types.h" +#include "config/lib.h" static char *VarApple; static char *VarBanana; @@ -574,7 +570,8 @@ static bool test_inherit(struct ConfigSet *cs, struct Buffer *err) snprintf(child, sizeof(child), "%s:%s", account, parent); const char *AccountVarStr[] = { - parent, NULL, + parent, + NULL, }; struct Account *ac = ac_create(cs, account, AccountVarStr); diff --git a/test/config/synonym.c b/test/config/synonym.c index ea833edde..8a7eb42f1 100644 --- a/test/config/synonym.c +++ b/test/config/synonym.c @@ -26,13 +26,9 @@ #include #include #include -#include "mutt/buffer.h" -#include "mutt/memory.h" -#include "mutt/string2.h" +#include "mutt/mutt.h" #include "config/common.h" -#include "config/set.h" -#include "config/string3.h" -#include "config/types.h" +#include "config/lib.h" static char *VarApple; static char *VarCherry; -- 2.40.0