X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_subst_test.c;h=953ccc4c3b18505073eb134f31d77e0bf9614197;hb=b599cc64d3ba270fb9fb7116631a01b7404f1a9b;hp=2a7080261ee366c86907cd8bc269cc4f67a96f8b;hpb=8eb05d21637cd1eb3b6c4c4d3ed519cc2fd3ebf6;p=collectd.git diff --git a/src/daemon/utils_subst_test.c b/src/daemon/utils_subst_test.c index 2a708026..953ccc4c 100644 --- a/src/daemon/utils_subst_test.c +++ b/src/daemon/utils_subst_test.c @@ -24,19 +24,23 @@ * 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 +kstat_ctl_t *kc; +#endif /* HAVE_LIBKSTAT */ + 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 */ @@ -91,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"},