[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVnqqffKUQ7+usXruWce8B0KdRxxO41zNY8bTfh-r5oHQ@mail.gmail.com>
Date: Mon, 10 Feb 2025 17:27:04 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Tamir Duberstein <tamird@...il.com>
Cc: David Gow <davidgow@...gle.com>, Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v5 2/2] scanf: break kunit into test cases
Hi Tamir,
On Mon, 10 Feb 2025 at 16:00, Tamir Duberstein <tamird@...il.com> wrote:
> Use `suite_init` and move some tests into `scanf_test_cases`. This
> gives us nicer output in the event of a failure.
>
> Reviewed-by: David Gow <davidgow@...gle.com>
> Signed-off-by: Tamir Duberstein <tamird@...il.com>
Thanks for your patch!
> --- a/lib/scanf_kunit.c
> +++ b/lib/scanf_kunit.c
> @@ -4,19 +4,14 @@
> */
>
> #include <kunit/test.h>
> -#include <linux/bitops.h>
> -#include <linux/kernel.h>
> #include <linux/module.h>
> -#include <linux/overflow.h>
> -#include <linux/printk.h>
> #include <linux/prandom.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> +#include <linux/sprintf.h>
>
> #define BUF_SIZE 1024
>
> -static char *test_buffer;
> -static char *fmt_buffer;
> +static char test_buffer[BUF_SIZE];
> +static char fmt_buffer[BUF_SIZE];
Why? This wastes 2 KiB of memory when the test is not running.
> static struct rnd_state rnd_state;
>
> typedef void (*check_fn)(struct kunit *test, const void *check_data, const char *string,
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists