From: Florian Forster Date: Wed, 31 Jan 2024 12:53:14 +0000 (+0100) Subject: src/daemon/utils_cache_test.c: Add a test case for decreasing gauges. X-Git-Tag: collectd-6.0.0.rc2~9^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4265%2Fhead;p=thirdparty%2Fcollectd.git src/daemon/utils_cache_test.c: Add a test case for decreasing gauges. --- diff --git a/src/daemon/utils_cache_test.c b/src/daemon/utils_cache_test.c index 6792c3250..29d640b8d 100644 --- a/src/daemon/utils_cache_test.c +++ b/src/daemon/utils_cache_test.c @@ -50,6 +50,15 @@ DEF_TEST(uc_get_rate) { .type = METRIC_TYPE_GAUGE, .want = 2.0, }, + { + .name = "decreasing gauge", + .first_value = (value_t){.gauge = 100.0}, + .second_value = (value_t){.gauge = 21.5}, + .first_time = TIME_T_TO_CDTIME_T(100), + .second_time = TIME_T_TO_CDTIME_T(110), + .type = METRIC_TYPE_GAUGE, + .want = 21.5, + }, { .name = "counter", .first_value = (value_t){.counter = 42},