From 973a34df046f61a6688c3f3498efa8cd30777441 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 6 May 2013 11:09:31 +0800 Subject: [PATCH] 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 --- test/parser/utils.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.2