X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_subst_test.c;h=953ccc4c3b18505073eb134f31d77e0bf9614197;hb=2ce1db8202b1eba6da45b347c0c81a508f8c088a;hp=c12aa1057fe3d91022c67983d6a4e338c3b7f6ea;hpb=9b39918bdadabb12ec040f0f191c0d21cb6ddd53;p=collectd.git diff --git a/src/daemon/utils_subst_test.c b/src/daemon/utils_subst_test.c index c12aa105..953ccc4c 100644 --- a/src/daemon/utils_subst_test.c +++ b/src/daemon/utils_subst_test.c @@ -24,9 +24,9 @@ * Florian octo Forster */ -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "utils_subst.h" #if HAVE_LIBKSTAT @@ -36,11 +36,11 @@ kstat_ctl_t *kc; DEF_TEST(subst) { struct { - char *str; + const char *str; int off1; int off2; - char *rplmt; - char *want; + const char *rplmt; + const char *want; } cases[] = { {"foo_____bar", 3, 8, " - ", "foo - bar"}, /* documentation example */ {"foo bar", 0, 2, "m", "mo bar"}, /* beginning, shorten */ @@ -95,7 +95,10 @@ DEF_TEST(subst) DEF_TEST(subst_string) { struct { - char *str; char *srch; char *rplmt; char *want; + const char *str; + const char *srch; + const char *rplmt; + const char *want; } cases[] = { {"Hello %{name}", "%{name}", "world", "Hello world"}, {"abcccccc", "abc", "cab", "ccccccab"},