Lines Matching full:stats

30 static void push_fixture_1(igt_stats_t *stats)  in push_fixture_1()  argument
32 igt_stats_push(stats, 2); in push_fixture_1()
33 igt_stats_push(stats, 4); in push_fixture_1()
34 igt_stats_push(stats, 6); in push_fixture_1()
35 igt_stats_push(stats, 8); in push_fixture_1()
36 igt_stats_push(stats, 10); in push_fixture_1()
42 igt_stats_t stats; in test_init_zero() local
44 stats.mean = 1.; in test_init_zero()
45 igt_stats_init(&stats); in test_init_zero()
46 igt_assert_eq_double(stats.mean, 0.); in test_init_zero()
51 igt_stats_t stats; in test_init() local
53 igt_stats_init(&stats); in test_init()
59 igt_assert(igt_stats_is_population(&stats) == false); in test_init()
64 igt_stats_t stats; in test_min_max() local
66 igt_stats_init(&stats); in test_min_max()
67 push_fixture_1(&stats); in test_min_max()
69 igt_assert(igt_stats_get_min(&stats) == 2); in test_min_max()
70 igt_assert(igt_stats_get_max(&stats) == 10); in test_min_max()
75 igt_stats_t stats; in test_range() local
77 igt_stats_init(&stats); in test_range()
78 push_fixture_1(&stats); in test_range()
80 igt_assert(igt_stats_get_range(&stats) == 8); in test_range()
93 igt_stats_t stats; in test_quartiles() local
97 igt_stats_init(&stats); in test_quartiles()
98 igt_stats_push_array(&stats, s1, ARRAY_SIZE(s1)); in test_quartiles()
100 igt_stats_get_quartiles(&stats, &q1, &q2, &q3); in test_quartiles()
104 igt_assert_eq_double(igt_stats_get_median(&stats), 40); in test_quartiles()
105 igt_assert_eq_double(igt_stats_get_iqr(&stats), 42.5 - 25.5); in test_quartiles()
107 igt_stats_fini(&stats); in test_quartiles()
110 igt_stats_init(&stats); in test_quartiles()
111 igt_stats_push_array(&stats, s2, ARRAY_SIZE(s2)); in test_quartiles()
113 igt_stats_get_quartiles(&stats, &q1, &q2, &q3); in test_quartiles()
117 igt_assert_eq_double(igt_stats_get_median(&stats), 37.5); in test_quartiles()
118 igt_assert_eq_double(igt_stats_get_iqr(&stats), 40 - 15); in test_quartiles()
120 igt_stats_fini(&stats); in test_quartiles()
125 igt_stats_t stats; in test_invalidate_sorted() local
130 igt_stats_init(&stats); in test_invalidate_sorted()
131 igt_stats_push_array(&stats, s1_truncated, ARRAY_SIZE(s1_truncated)); in test_invalidate_sorted()
132 median1 = igt_stats_get_median(&stats); in test_invalidate_sorted()
134 igt_stats_push(&stats, 43); in test_invalidate_sorted()
135 median2 = igt_stats_get_median(&stats); in test_invalidate_sorted()
143 igt_stats_t stats; in test_mean() local
146 igt_stats_init(&stats); in test_mean()
147 push_fixture_1(&stats); in test_mean()
149 mean = igt_stats_get_mean(&stats); in test_mean()
152 igt_stats_fini(&stats); in test_mean()
157 igt_stats_t stats; in test_invalidate_mean() local
160 igt_stats_init(&stats); in test_invalidate_mean()
161 push_fixture_1(&stats); in test_invalidate_mean()
163 mean1 = igt_stats_get_mean(&stats); in test_invalidate_mean()
166 igt_stats_push(&stats, 100); in test_invalidate_mean()
168 mean2 = igt_stats_get_mean(&stats); in test_invalidate_mean()
171 igt_stats_fini(&stats); in test_invalidate_mean()
180 igt_stats_t stats; in test_std_deviation() local
183 igt_stats_init(&stats); in test_std_deviation()
184 igt_stats_set_population(&stats, true); in test_std_deviation()
186 igt_stats_push(&stats, 2); in test_std_deviation()
187 igt_stats_push(&stats, 4); in test_std_deviation()
188 igt_stats_push(&stats, 4); in test_std_deviation()
189 igt_stats_push(&stats, 4); in test_std_deviation()
190 igt_stats_push(&stats, 5); in test_std_deviation()
191 igt_stats_push(&stats, 5); in test_std_deviation()
192 igt_stats_push(&stats, 7); in test_std_deviation()
193 igt_stats_push(&stats, 9); in test_std_deviation()
195 mean = igt_stats_get_mean(&stats); in test_std_deviation()
198 variance = igt_stats_get_variance(&stats); in test_std_deviation()
201 std_deviation = igt_stats_get_std_deviation(&stats); in test_std_deviation()
204 igt_stats_fini(&stats); in test_std_deviation()
209 igt_stats_t stats; in test_reallocation() local
212 igt_stats_init_with_size(&stats, 1); in test_reallocation()
215 igt_stats_push(&stats, i); in test_reallocation()
218 igt_stats_get_median(&stats); in test_reallocation()
220 igt_assert(!stats.is_float); in test_reallocation()
222 igt_assert_eq(stats.n_values, 101); in test_reallocation()
224 igt_assert_eq(stats.values_u64[i], i); in test_reallocation()
225 igt_assert_eq_double(igt_stats_get_mean(&stats), 50.0); in test_reallocation()
226 igt_assert_eq_double(igt_stats_get_median(&stats), 50.0); in test_reallocation()
228 igt_stats_fini(&stats); in test_reallocation()