lkml.org 
[lkml]   [2025]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 2/2] scanf: break kunit into test cases
Hi Tamir,

On Mon, 10 Feb 2025 at 16:00, Tamir Duberstein <tamird@gmail.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@google.com>
> Signed-off-by: Tamir Duberstein <tamird@gmail.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@linux-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

\
 
 \ /
  Last update: 2025-02-10 17:27    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog