1 #include <ccan/tally/tally.c>
2 #include <ccan/tap/tap.h>
7 struct tally
*tally
= tally_new(0);
10 max
= (ssize_t
)~(1ULL << (sizeof(max
)*CHAR_BIT
- 1));
11 min
= (ssize_t
)(1ULL << (sizeof(max
)*CHAR_BIT
- 1));
13 plan_tests(100 + 100);
14 /* Simple mean test: should always be 0. */
15 for (i
= 0; i
< 100; i
++) {
18 ok1(tally_mean(tally
) == 0);
21 /* Works for big values too... */
22 for (i
= 0; i
< 100; i
++) {
23 tally_add(tally
, max
- i
);
24 tally_add(tally
, min
+ 1 + i
);
25 ok1(tally_mean(tally
) == 0);