Exemplo n.º 1
0
char *test_recreate() {
    Stats *st = Stats_recreate(expect.sum, expect.sumsq, expect.n, expect.min, expect.max);

    mu_assert(st->sum == expect.sum, "sum !=");
    mu_assert(st->sumsq == expect.sumsq, "sumsq !=");
    mu_assert(st->n == expect.n, "n !=");
    mu_assert(st->min == expect.min, "min !=");
    mu_assert(st->max == expect.max, "max !=");
    mu_assert(EQ(Stats_mean(st), expect_mean, 3), "mean !=");
    mu_assert(EQ(Stats_stddev(st), expect_stddev, 3), "stddev !=");

    return NULL;
}
Exemplo n.º 2
0
char* test_recreate() {
    Stats* st = Stats_recreate(expect.sum, expect.sumsq, expect.n, expect.min, expect.max);

    mu_assert(st->sum == expect.sum, "sum not equal");
    mu_assert(st->sumsq == expect.sumsq, "sumsq not equal");
    mu_assert(st->n == expect.n, "n not equal");
    mu_assert(st->min == expect.min, "min not equal");
    mu_assert(st->max == expect.max, "max not equal");
    mu_assert(EQ(expect_mean, Stats_mean(st), 3), "mean not valid");
    mu_assert(EQ(expect_stddev, Stats_stddev(st), 3), "stddev not valid");

    return NULL;
}
Exemplo n.º 3
0
Stats *Stats_create(void)
{
	return Stats_recreate(0.0, 0.0, 0L, 0.0, 0.0);
}