From: Ján Tomko Date: Sun, 9 Sep 2018 01:33:57 +0000 (+0200) Subject: tests: add a function for checking exclusive flags X-Git-Tag: v4.8.0-rc1~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46a73f4801b96044e490234ba5775b5f5899f3e8;p=thirdparty%2Flibvirt.git tests: add a function for checking exclusive flags We can reject some non-sensical combinations with an error message, once we add flags for them. Signed-off-by: Ján Tomko --- diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d7b50d7ea0..660330e252 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -465,6 +465,18 @@ testCompareXMLToStartupXML(const void *data) } +static int +testCheckExclusiveFlags(int flags) +{ + virCheckFlags(FLAG_EXPECT_FAILURE | + FLAG_EXPECT_PARSE_ERROR | + FLAG_FIPS | + 0, -1); + + return 0; +} + + static int testCompareXMLToArgv(const void *data) { @@ -507,6 +519,9 @@ testCompareXMLToArgv(const void *data) if (virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_ENABLE_FIPS)) flags |= FLAG_FIPS; + if (testCheckExclusiveFlags(info->flags) < 0) + goto cleanup; + if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0) goto cleanup;