mean_and_variance: Drop always failing tests
mean_and_variance_test_2 and mean_and_variance_test_4 always fail. The input parameters to those tests are identical to the input parameters to tests 1 and 3, yet the expected result for tests 2 and 4 is different for the mean and stddev tests. That will always fail. Expected mean_and_variance_get_mean(mv) == mean[i], but mean_and_variance_get_mean(mv) == 22 (0x16) mean[i] == 10 (0xa) Drop the bad tests. Fixes: 65bc41090720 ("mean and variance: More tests") Closes: https://lore.kernel.org/lkml/065b94eb-6a24-4248-b7d7-d3212efb4787@roeck-us.net/ Cc: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
c42cd606e4
commit
97ca7c1f93
@ -136,20 +136,8 @@ static void mean_and_variance_test_1(struct kunit *test)
|
||||
d, mean, stddev, weighted_mean, weighted_stddev);
|
||||
}
|
||||
|
||||
static void mean_and_variance_test_2(struct kunit *test)
|
||||
{
|
||||
s64 d[] = { 100, 10, 10, 10, 10, 10, 10 };
|
||||
s64 mean[] = { 10, 10, 10, 10, 10, 10, 10 };
|
||||
s64 stddev[] = { 9, 9, 9, 9, 9, 9, 9 };
|
||||
s64 weighted_mean[] = { 32, 27, 22, 19, 17, 15, 14 };
|
||||
s64 weighted_stddev[] = { 38, 35, 31, 27, 24, 21, 18 };
|
||||
|
||||
do_mean_and_variance_test(test, 10, 6, ARRAY_SIZE(d), 2,
|
||||
d, mean, stddev, weighted_mean, weighted_stddev);
|
||||
}
|
||||
|
||||
/* Test behaviour where we switch from one steady state to another: */
|
||||
static void mean_and_variance_test_3(struct kunit *test)
|
||||
static void mean_and_variance_test_2(struct kunit *test)
|
||||
{
|
||||
s64 d[] = { 100, 100, 100, 100, 100 };
|
||||
s64 mean[] = { 22, 32, 40, 46, 50 };
|
||||
@ -161,18 +149,6 @@ static void mean_and_variance_test_3(struct kunit *test)
|
||||
d, mean, stddev, weighted_mean, weighted_stddev);
|
||||
}
|
||||
|
||||
static void mean_and_variance_test_4(struct kunit *test)
|
||||
{
|
||||
s64 d[] = { 100, 100, 100, 100, 100 };
|
||||
s64 mean[] = { 10, 11, 12, 13, 14 };
|
||||
s64 stddev[] = { 9, 13, 15, 17, 19 };
|
||||
s64 weighted_mean[] = { 32, 49, 61, 71, 78 };
|
||||
s64 weighted_stddev[] = { 38, 44, 44, 41, 38 };
|
||||
|
||||
do_mean_and_variance_test(test, 10, 6, ARRAY_SIZE(d), 2,
|
||||
d, mean, stddev, weighted_mean, weighted_stddev);
|
||||
}
|
||||
|
||||
static void mean_and_variance_fast_divpow2(struct kunit *test)
|
||||
{
|
||||
s64 i;
|
||||
@ -230,8 +206,6 @@ static struct kunit_case mean_and_variance_test_cases[] = {
|
||||
KUNIT_CASE(mean_and_variance_weighted_advanced_test),
|
||||
KUNIT_CASE(mean_and_variance_test_1),
|
||||
KUNIT_CASE(mean_and_variance_test_2),
|
||||
KUNIT_CASE(mean_and_variance_test_3),
|
||||
KUNIT_CASE(mean_and_variance_test_4),
|
||||
{}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user