projects
/
petitboot
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0a7cb1
)
test/parser: Error on invalid parser name
author
Jeremy Kerr
<jk@ozlabs.org>
Mon, 6 May 2013 03:09:31 +0000
(11:09 +0800)
committer
Jeremy Kerr
<jk@ozlabs.org>
Thu, 16 May 2013 03:53:34 +0000
(11:53 +0800)
We should error-out if we didn't find a valid parser, so it doesn't look
like we found no boot options.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
test/parser/utils.c
patch
|
blob
|
history
diff --git
a/test/parser/utils.c
b/test/parser/utils.c
index a1d0ad24b590d9938dcdd12ed00b3548137d1e97..69b0006d1f25c6263b8f58f76e02ad6cd466ab36 100644
(file)
--- a/
test/parser/utils.c
+++ b/
test/parser/utils.c
@@
-131,7
+131,12
@@
int test_run_parser(struct parser_test *test, const char *parser_name)
continue;
test->ctx->parser = parser;
rc = parser->parse(test->ctx, test->conf.buf, test->conf.size);
+ break;
}
+ if (i == n_parsers)
+ errx(EXIT_FAILURE, "%s: parser '%s' not found",
+ __func__, parser_name);
+
return rc;
}