summaryrefslogtreecommitdiffstats
path: root/test/parser/utils.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-05-06 11:09:31 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-05-16 11:53:34 +0800
commit973a34df046f61a6688c3f3498efa8cd30777441 (patch)
tree3d786db86f11af111977911dac43bde1c19daef9 /test/parser/utils.c
parente0a7cb18a4237aa826e5e121ff17373814a1872d (diff)
downloadpetitboot-973a34df046f61a6688c3f3498efa8cd30777441.zip
petitboot-973a34df046f61a6688c3f3498efa8cd30777441.tar.gz
test/parser: Error on invalid parser name
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>
Diffstat (limited to 'test/parser/utils.c')
-rw-r--r--test/parser/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parser/utils.c b/test/parser/utils.c
index a1d0ad2..69b0006 100644
--- 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;
}
OpenPOWER on IntegriCloud