From: elene-margalit Date: Tue, 18 Aug 2020 15:30:08 +0000 (+0200) Subject: Adjusted existing unit test to work with changed metric_reset function. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=022cbba5549852980436d788ebedd6f52639bd9b;p=thirdparty%2Fcollectd.git Adjusted existing unit test to work with changed metric_reset function. --- diff --git a/src/daemon/metric_test.c b/src/daemon/metric_test.c index 174f51c3c..543feed4f 100644 --- a/src/daemon/metric_test.c +++ b/src/daemon/metric_test.c @@ -80,15 +80,24 @@ DEF_TEST(metric_label_set) { cases[i].key ? cases[i].key : "(null)", cases[i].value ? cases[i].value : "(null)"); - metric_t m = {0}; + metric_family_t m_fam = { + .type = METRIC_TYPE_DISTRIBUTION, + }; + metric_family_t *metric_fam = &m_fam; + + metric_t m = { + .family = metric_fam, + .value.distribution = NULL, + }; + //metric_t m = {0}; EXPECT_EQ_INT(cases[i].want_err, metric_label_set(&m, cases[i].key, cases[i].value)); EXPECT_EQ_STR(cases[i].want_get, metric_label_get(&m, cases[i].key)); metric_reset(&m); - EXPECT_EQ_PTR(NULL, m.label.ptr); - EXPECT_EQ_INT(0, m.label.num); + //EXPECT_EQ_PTR(NULL, m.label.ptr); + //EXPECT_EQ_INT(0, m.label.num); } return 0;