summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 661bf77)
raw | patch | inline | side by side (parent: 661bf77)
author | Florian Forster <octo@collectd.org> | |
Thu, 27 Oct 2016 20:13:37 +0000 (22:13 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 27 Oct 2016 20:13:37 +0000 (22:13 +0200) |
This crashed GCC 4.6 on Precise.
src/daemon/common_test.c | patch | blob | history |
index 44e198ddfafd97ccbcc0abf0b2cffa088b3cb9f8..61435959bc4fe82e7faf7ebf34362e2859cc17b9 100644 (file)
--- a/src/daemon/common_test.c
+++ b/src/daemon/common_test.c
};
for (size_t 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) };
+ cdtime_t t0 = TIME_T_TO_CDTIME_T (cases[i].t0);
+ value_to_rate_state_t state = {
+ .last_value = cases[i].v0,
+ .last_time = t0,
+ };
gauge_t got;
if (cases[i].t0 == 0) {
- OK(value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state) == EAGAIN);
+ EXPECT_EQ_INT(EAGAIN, value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state));
continue;
}
- OK(value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state) == 0);
+ EXPECT_EQ_INT(0, value_to_rate (&got, cases[i].v1, cases[i].ds_type, TIME_T_TO_CDTIME_T(cases[i].t1), &state));
EXPECT_EQ_DOUBLE(cases[i].want, got);
}