From 4a89a841a11cb872f9b0b0959c306fcb96f87d75 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Sat, 27 Jun 2015 09:45:42 +0100 Subject: stats: Add functions to retrieve min/max values of the dataset Signed-off-by: Damien Lespiau --- lib/tests/igt_stats.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/tests') diff --git a/lib/tests/igt_stats.c b/lib/tests/igt_stats.c index 6916f251..dc5fe39c 100644 --- a/lib/tests/igt_stats.c +++ b/lib/tests/igt_stats.c @@ -57,6 +57,17 @@ static void test_init(void) igt_assert(igt_stats_is_population(&stats) == false); } +static void test_min_max(void) +{ + igt_stats_t stats; + + igt_stats_init(&stats, 5); + push_fixture_1(&stats); + + igt_assert(igt_stats_get_min(&stats) == 2); + igt_assert(igt_stats_get_max(&stats) == 10); +} + static void test_mean(void) { igt_stats_t stats; @@ -127,6 +138,7 @@ igt_simple_main { test_init_zero(); test_init(); + test_min_max(); test_mean(); test_invalidate_mean(); test_std_deviation(); -- cgit v1.2.3