]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add more DO_TEST_CAPS_*() macros
authorAndrea Bolognani <abologna@redhat.com>
Tue, 2 Jul 2019 15:37:20 +0000 (17:37 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 3 Jul 2019 08:18:38 +0000 (10:18 +0200)
Right now we have macros such as DO_TEST_CAPS_LATEST_PARSE_ERROR()
and DO_TEST_CAPS_ARCH_VER(), but there is no concise way to say
"using this version of QEMU on this architecture will result in a
failure".

This commit adds

  DO_TEST_CAPS_ARCH_LATEST_FAILURE()
  DO_TEST_CAPS_ARCH_VER_FAILURE()
  DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR()
  DO_TEST_CAPS_ARCH_VER_PARSE_ERROR()

and reworks

  DO_TEST_CAPS_LATEST_FAILURE()
  DO_TEST_CAPS_LATEST_PARSE_ERROR()

to use the corresponding DO_CAPS_TEST_ARCH_*() macros instead of
using DO_TEST_CAPS_ARCH_LATEST_FULL() directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvtest.c

index 748d43f4884b52d332ec53ce8aea32ab6adcdb3f..ff66a833c91678159e75e149e7bf2c9e7811c8a5 100644 (file)
@@ -730,14 +730,34 @@ mymain(void)
 # define DO_TEST_CAPS_VER(name, ver) \
     DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
 
-# define DO_TEST_CAPS_LATEST_FAILURE(name) \
-    DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
+# define DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, arch) \
+    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
                                   ARG_FLAGS, FLAG_EXPECT_FAILURE)
 
-# define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \
-    DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
+# define DO_TEST_CAPS_ARCH_VER_FAILURE(name, arch, ver) \
+    DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
+                               ARG_FLAGS, FLAG_EXPECT_FAILURE)
+
+# define DO_TEST_CAPS_LATEST_FAILURE(name) \
+    DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, "x86_64")
+
+# define DO_TEST_CAPS_VER_FAILURE(name, ver) \
+    DO_TEST_CAPS_ARCH_VER_FAILURE(name, "x86_64", ver)
+
+# define DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, arch) \
+    DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
 
+# define DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, arch, ver) \
+    DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
+                               ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
+
+# define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \
+    DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, "x86_64")
+
+# define DO_TEST_CAPS_VER_PARSE_ERROR(name, ver) \
+    DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, "x86_64", ver)
+
 # define DO_TEST_FULL(name, ...) \
     DO_TEST_INTERNAL(name, "", \
                      __VA_ARGS__, QEMU_CAPS_LAST)