From: elene-margalit Date: Tue, 1 Sep 2020 10:43:44 +0000 (+0200) Subject: Remove test for deleted distribution_marshal_text function. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46b95b5ae1e562f95b3c1977e7dc714c82faf5e4;p=thirdparty%2Fcollectd.git Remove test for deleted distribution_marshal_text function. --- diff --git a/src/daemon/metric_test.c b/src/daemon/metric_test.c index 57bcbd090..638303f82 100644 --- a/src/daemon/metric_test.c +++ b/src/daemon/metric_test.c @@ -302,59 +302,11 @@ DEF_TEST(metric_reset) { return 0; } -DEF_TEST(distribution_marshal_text) { - struct { - value_t value; - char const *want; - } cases[] = { - {.value.distribution = distribution_new_linear(2, 20), - .want = "bucket{l=\"20.00\"} 0\n" - "bucket{l=\"+inf\"} 0\n" - "sum 0.00\n" - "count 0\n"}, - {.value.distribution = distribution_new_exponential(10, 2, 3), - .want = "bucket{l=\"3.00\"} 0\n" - "bucket{l=\"6.00\"} 0\n" - "bucket{l=\"12.00\"} 0\n" - "bucket{l=\"24.00\"} 0\n" - "bucket{l=\"48.00\"} 0\n" - "bucket{l=\"96.00\"} 0\n" - "bucket{l=\"192.00\"} 0\n" - "bucket{l=\"384.00\"} 0\n" - "bucket{l=\"768.00\"} 0\n" - "bucket{l=\"+inf\"} 0\n" - "sum 0.00\n" - "count 0\n"}, - {.value.distribution = - distribution_new_custom(4, (double[]){3, 10, 50, 100}), - .want = "bucket{l=\"3.00\"} 0\n" - "bucket{l=\"10.00\"} 0\n" - "bucket{l=\"50.00\"} 0\n" - "bucket{l=\"100.00\"} 0\n" - "bucket{l=\"+inf\"} 0\n" - "sum 0.00\n" - "count 0\n"}, - }; - - for (size_t i = 0; i < (sizeof(cases) / sizeof(cases[0])); i++) { - printf("## Case %zu: \n", i); - - distribution_t *dist = cases[i].value.distribution; - strbuf_t buf = STRBUF_CREATE; - - CHECK_ZERO(distribution_marshal_text(&buf, dist)); - EXPECT_EQ_STR(cases[i].want, buf.ptr); - distribution_destroy(dist); - STRBUF_DESTROY(buf); - } - return 0; -} int main(void) { RUN_TEST(metric_label_set); RUN_TEST(metric_identity); RUN_TEST(metric_family_append); RUN_TEST(metric_reset); - RUN_TEST(distribution_marshal_text); END_TEST; }