test/parser: Allow checks for NULL boot_args
authorJeremy Kerr <jk@ozlabs.org>
Tue, 24 Sep 2013 06:01:43 +0000 (14:01 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 24 Sep 2013 06:01:43 +0000 (14:01 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
test/parser/test-grub2-ubuntu-13_04-x86.c
test/parser/utils.c

index 60f1b1099bfca2629bb8cf40cd6fd50b3ece073c..8f9785862d3826d27da4f51ced71dd717d2b9dbb 100644 (file)
@@ -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);
index 7ebb411c0c9f6eb664991da10e75b7fb684a64c3..f6939828337cfde8aa3ce31b8f1687cea2542e34 100644 (file)
@@ -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");