diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-27 09:45:42 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-27 16:04:07 +0100 |
commit | 4a89a841a11cb872f9b0b0959c306fcb96f87d75 (patch) | |
tree | 63c61d77190a97534af84167e596b641f38685de /lib/tests | |
parent | 87009f3d7b155bc2c650d1395f74a2c6e80f0cf6 (diff) |
stats: Add functions to retrieve min/max values of the dataset
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/igt_stats.c | 12 |
1 files changed, 12 insertions, 0 deletions
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(); |