]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Introduce negative versions of DO_TEST_CAPS_LATEST
authorErik Skultety <eskultet@redhat.com>
Fri, 7 Dec 2018 12:13:58 +0000 (13:13 +0100)
committerErik Skultety <eskultet@redhat.com>
Wed, 12 Dec 2018 14:12:35 +0000 (15:12 +0100)
It's fairly easy to forget to add a capability to the list of
capabilities for a negative test case which might yield (for us) very
unfortunate results. Therefore, introduce negative versions of
DO_TEST_CAPS_LATEST macros, so that real QEMU caps can be used with
tests that expect a failure too.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
tests/qemuxml2argvtest.c

index e17709e7e118927e82dd878c1e03d3109aeb42ed..d031b9b08cc5e6a46a1ca320105900743cf2d178 100644 (file)
@@ -806,13 +806,22 @@ mymain(void)
 # define DO_TEST_CAPS_VER(name, ver) \
     DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
 
-# define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
-    DO_TEST_CAPS_INTERNAL(name, arch "-latest", NULL, 0, 0, arch, \
+# define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, flags, parseFlags) \
+    DO_TEST_CAPS_INTERNAL(name, arch "-latest", NULL, flags, parseFlags, arch, \
                           virHashLookup(capslatest, arch), true)
 
+# define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
+    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, 0, 0)
+
 # define DO_TEST_CAPS_LATEST(name) \
     DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
 
+# define DO_TEST_CAPS_LATEST_FAILURE(name) \
+    DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_FAILURE, 0)
+
+# define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \
+    DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_PARSE_ERROR, 0)
+
 /**
  * The following test macros should be used only in cases when the tests require
  * testing of some non-standard combination of capability flags