]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: ensure failure if input file doesn't exist
authorJonathon Jongsma <jjongsma@redhat.com>
Thu, 25 Jun 2020 20:18:23 +0000 (15:18 -0500)
committerLaine Stump <laine@redhat.com>
Thu, 25 Jun 2020 23:51:37 +0000 (19:51 -0400)
commitbac096fff0bf3414ebeb4306a32ad4dab20ccfdf
treeb0f9d22564ab95b92d8df80b7be18d5c29e9b6c6
parent6c560b2d3aa2b2e4ecec44270c814ff9faf5c484
tests: ensure failure if input file doesn't exist

When using the DO_TEST_PARSE_ERROR() macro, a failure to parse the input
file is considered a successful test. However, if the input file is
totally missing, that should be distinguished from a parsing error and
not be treated as a test success.

The function virDomainDefParseFile() simply returns NULL for any parse
failure, including a missing file. So we need to explicitly check
whether the file exists first, and fail the test if it is missing.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
tests/qemuxml2argvtest.c