X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon_test.c;h=93a19d1b0db8b5af795f491d5cf4b69cbfd8ed04;hb=2d85b65c6906dfd63e6c28c2cda8053ce0600c43;hp=4d2ccaa338d22b31a76d599a94c610b267f5263f;hpb=f10aace6ef2632df58636d965bc43fdd2730243c;p=collectd.git diff --git a/src/daemon/common_test.c b/src/daemon/common_test.c index 4d2ccaa3..93a19d1b 100644 --- a/src/daemon/common_test.c +++ b/src/daemon/common_test.c @@ -27,6 +27,10 @@ #include "common.h" #include "testing.h" +#if HAVE_KSTAT_H +#include +#endif + #if HAVE_LIBKSTAT kstat_ctl_t *kc; #endif /* HAVE_LIBKSTAT */ @@ -164,10 +168,12 @@ DEF_TEST(strjoin) { cases[i].fields_num, cases[i].separator); EXPECT_EQ_INT(cases[i].want_return, status); EXPECT_EQ_STR(cases[i].want_buffer, buffer); - } - /* use (NULL, 0) to determine required buffer size. */ - EXPECT_EQ_INT(3, strjoin(NULL, 0, (char *[]){"a", "b"}, 2, "-")); + /* use (NULL, 0) to determine required buffer size. */ + EXPECT_EQ_INT(cases[i].want_return, + strjoin(NULL, 0, cases[i].fields, cases[i].fields_num, + cases[i].separator)); + } return 0; }