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