From: Jeremy Kerr Date: Tue, 24 Sep 2013 06:01:43 +0000 (+0800) Subject: test/parser: Allow checks for NULL boot_args X-Git-Tag: v1.0.0~434 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=98a3faddc9e01e2bfc9c267f32fce0173678a40a;ds=sidebyside test/parser: Allow checks for NULL boot_args Signed-off-by: Jeremy Kerr --- diff --git a/test/parser/test-grub2-ubuntu-13_04-x86.c b/test/parser/test-grub2-ubuntu-13_04-x86.c index 60f1b10..8f97858 100644 --- a/test/parser/test-grub2-ubuntu-13_04-x86.c +++ b/test/parser/test-grub2-ubuntu-13_04-x86.c @@ -34,7 +34,7 @@ void run_test(struct parser_test *test) check_unresolved_resource(opt->boot_image); check_not_present_resource(opt->initrd); check_name(opt, "Memory test (memtest86+)"); - check_args(opt, ""); + check_args(opt, NULL); opt = get_boot_option(ctx, 4); check_unresolved_resource(opt->boot_image); diff --git a/test/parser/utils.c b/test/parser/utils.c index 7ebb411..f693982 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -239,6 +239,9 @@ void __check_args(struct discover_boot_option *opt, const char *args, { int rc; + if (!opt->option->boot_args && !args) + return; + if (!opt->option->boot_args) { fprintf(stderr, "%s:%d: arg check failed\n", file, line); fprintf(stderr, " no arguments parsed\n");