* [PATCH] mean_and_variance: Drop always failing tests
@ 2024-02-25 16:29 Guenter Roeck
2024-04-02 14:03 ` Guenter Roeck
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2024-02-25 16:29 UTC (permalink / raw)
To: Daniel B . Hill; +Cc: linux-kernel, Guenter Roeck, Kent Overstreet
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>
---
Based on next-20240223. Sorry for the noise if this has already been
addressed.
Tested on top of mainline kernel (v6.8-rc5-329-gab0a97cffa0b)
to avoid other problems seen in next-20240223.
lib/math/mean_and_variance_test.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/lib/math/mean_and_variance_test.c b/lib/math/mean_and_variance_test.c
index 0d8c2451a858..fe8309f456a3 100644
--- a/lib/math/mean_and_variance_test.c
+++ b/lib/math/mean_and_variance_test.c
@@ -135,20 +135,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 };
@@ -160,18 +148,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;
@@ -229,8 +205,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),
{}
};
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mean_and_variance: Drop always failing tests
2024-02-25 16:29 [PATCH] mean_and_variance: Drop always failing tests Guenter Roeck
@ 2024-04-02 14:03 ` Guenter Roeck
2024-04-02 16:26 ` Kent Overstreet
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2024-04-02 14:03 UTC (permalink / raw)
To: Daniel B . Hill; +Cc: linux-kernel, Kent Overstreet
On Sun, Feb 25, 2024 at 08:29:25AM -0800, Guenter Roeck wrote:
> 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.
>
I did not get any response ... ping ....
Guenter
> 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>
> ---
> Based on next-20240223. Sorry for the noise if this has already been
> addressed.
>
> Tested on top of mainline kernel (v6.8-rc5-329-gab0a97cffa0b)
> to avoid other problems seen in next-20240223.
>
> lib/math/mean_and_variance_test.c | 28 +---------------------------
> 1 file changed, 1 insertion(+), 27 deletions(-)
>
> diff --git a/lib/math/mean_and_variance_test.c b/lib/math/mean_and_variance_test.c
> index 0d8c2451a858..fe8309f456a3 100644
> --- a/lib/math/mean_and_variance_test.c
> +++ b/lib/math/mean_and_variance_test.c
> @@ -135,20 +135,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 };
> @@ -160,18 +148,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;
> @@ -229,8 +205,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),
> {}
> };
>
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mean_and_variance: Drop always failing tests
2024-04-02 14:03 ` Guenter Roeck
@ 2024-04-02 16:26 ` Kent Overstreet
0 siblings, 0 replies; 3+ messages in thread
From: Kent Overstreet @ 2024-04-02 16:26 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Daniel B . Hill, linux-kernel
On Tue, Apr 02, 2024 at 07:03:33AM -0700, Guenter Roeck wrote:
> On Sun, Feb 25, 2024 at 08:29:25AM -0800, Guenter Roeck wrote:
> > 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.
> >
>
> I did not get any response ... ping ....
Sorry, just been swamped - applying.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-02 16:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-25 16:29 [PATCH] mean_and_variance: Drop always failing tests Guenter Roeck
2024-04-02 14:03 ` Guenter Roeck
2024-04-02 16:26 ` Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®