X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon_test.c;h=21602d558b824edec19593530fc5bc463352b468;hb=872126c9a7e0a8f8ae2b28217c12c27c35af5237;hp=b1701bcf50688b325813b4ec880e0b0a5b95ac77;hpb=b720b5a6214ab1b9c058c7bd1fb4aad2f90e7889;p=collectd.git diff --git a/src/daemon/common_test.c b/src/daemon/common_test.c index b1701bcf..21602d55 100644 --- a/src/daemon/common_test.c +++ b/src/daemon/common_test.c @@ -354,22 +354,23 @@ DEF_TEST(value_to_rate) { 0, 10, DS_TYPE_COUNTER, {.counter = 0}, {.counter = 1000}, NAN}, {10, 20, DS_TYPE_COUNTER, {.counter = 1000}, {.counter = 5000}, 400.0}, /* 32bit wrap-around. */ - {20, 30, DS_TYPE_COUNTER, {.counter = 4294967238}, {.counter = 42}, 10.0}, + {20, 30, DS_TYPE_COUNTER, {.counter = 4294967238ULL}, {.counter = 42}, 10.0}, + /* 64bit wrap-around. */ {30, 40, DS_TYPE_COUNTER, {.counter = 18446744073709551558ULL}, {.counter = 42}, 10.0}, }; size_t i; for (i = 0; i < STATIC_ARRAY_SIZE (cases); i++) { value_to_rate_state_t state = { cases[i].v0, TIME_T_TO_CDTIME_T (cases[i].t0) }; - value_t got; + gauge_t got; if (cases[i].t0 == 0) { - OK(value_to_rate (&got, cases[i].v1.derive, &state, cases[i].ds_type, TIME_T_TO_CDTIME_T (cases[i].t1)) == EAGAIN); + OK(value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state) == EAGAIN); continue; } - OK(value_to_rate (&got, cases[i].v1.derive, &state, cases[i].ds_type, TIME_T_TO_CDTIME_T (cases[i].t1)) == 0); - DBLEQ(cases[i].want, got.gauge); + OK(value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state) == 0); + DBLEQ(cases[i].want, got); } return 0;