diff options
author | Geoff Levand <geoff@infradead.org> | 2013-05-18 09:57:07 +0800 |
---|---|---|
committer | Geoff Levand <geoff@infradead.org> | 2013-05-18 09:57:07 +0800 |
commit | 7d20772cc7b4d258ee878b4cb30b313f14502dc7 (patch) | |
tree | ce54ffe159a30ebd887fd015d91434e222664969 /test/parser/utils.c | |
parent | 9974f2d82b9450eaccd7661b3bfabb686ab8e161 (diff) | |
download | talos-petitboot-7d20772cc7b4d258ee878b4cb30b313f14502dc7.tar.gz talos-petitboot-7d20772cc7b4d258ee878b4cb30b313f14502dc7.zip |
test/parser: Add check_not_present_resource
Add a new routine check_not_present_resource() to check
that a resource is not present. This is typically used
to check that an initrd entry has not been found.
Also add any needed checks for no initrd to the existing
tests.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'test/parser/utils.c')
-rw-r--r-- | test/parser/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parser/utils.c b/test/parser/utils.c index 68fc3de..9a6b2e1 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -282,3 +282,10 @@ void __check_unresolved_resource(struct resource *res, if (res->resolved) errx(EXIT_FAILURE, "%s:%d: Resource is resolved", file, line); } + +void __check_not_present_resource(struct resource *res, + const char *file, int line) +{ + if (res) + errx(EXIT_FAILURE, "%s:%d: Resource present", file, line); +} |