From: Florian Forster Date: Mon, 18 Dec 2023 23:15:45 +0000 (+0100) Subject: ./contrib/format.sh src/utils/common/*.[ch] X-Git-Tag: 6.0.0-rc0~32^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db073ce58794b9c8ff65fd57fb59930591682d68;p=thirdparty%2Fcollectd.git ./contrib/format.sh src/utils/common/*.[ch] --- diff --git a/src/utils/common/common.h b/src/utils/common/common.h index dd8007aef..1f2194906 100644 --- a/src/utils/common/common.h +++ b/src/utils/common/common.h @@ -179,7 +179,6 @@ int strsplit(char *string, char **fields, size_t size); int strjoin(char *dst, size_t dst_len, char **fields, size_t fields_num, const char *sep); - /* string_has_suffix returns true if s ends with suffix. If either s or suffix * are NULL, false is returned. */ bool string_has_suffix(char const *s, char const *suffix); diff --git a/src/utils/common/common_test.c b/src/utils/common/common_test.c index 76ff77d51..fabbf2fb8 100644 --- a/src/utils/common/common_test.c +++ b/src/utils/common/common_test.c @@ -367,16 +367,14 @@ DEF_TEST(string_has_suffix) { char const *suffix; bool want; } cases[] = { - {"foo.bar", "bar", true}, - {"foo.qux", "bar", false}, - {"foo.Bar", "bar", false}, - {"foo", "foo", true}, - {"foo", "foo.bar", false}, - {"foo", NULL, false}, - {NULL, "foo", false}, + {"foo.bar", "bar", true}, {"foo.qux", "bar", false}, + {"foo.Bar", "bar", false}, {"foo", "foo", true}, + {"foo", "foo.bar", false}, {"foo", NULL, false}, + {NULL, "foo", false}, }; for (size_t i = 0; i < STATIC_ARRAY_SIZE(cases); i++) { - EXPECT_EQ_INT(cases[i].want, string_has_suffix(cases[i].s, cases[i].suffix)); + EXPECT_EQ_INT(cases[i].want, + string_has_suffix(cases[i].s, cases[i].suffix)); } return 0;