From 0e4c175e04abadc1f0f76e3c144debf1527cf057 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Sat, 27 Jun 2015 11:12:01 +0100 Subject: stats: Add igt_stats_get_range() Somewhat useful, for instance to size an histogram. Signed-off-by: Damien Lespiau --- lib/tests/igt_stats.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/tests') diff --git a/lib/tests/igt_stats.c b/lib/tests/igt_stats.c index dc5fe39c..f09c0793 100644 --- a/lib/tests/igt_stats.c +++ b/lib/tests/igt_stats.c @@ -68,6 +68,16 @@ static void test_min_max(void) igt_assert(igt_stats_get_max(&stats) == 10); } +static void test_range(void) +{ + igt_stats_t stats; + + igt_stats_init(&stats, 5); + push_fixture_1(&stats); + + igt_assert(igt_stats_get_range(&stats) == 8); +} + static void test_mean(void) { igt_stats_t stats; @@ -139,6 +149,7 @@ igt_simple_main test_init_zero(); test_init(); test_min_max(); + test_range(); test_mean(); test_invalidate_mean(); test_std_deviation(); -- cgit v1.2.3