[libvirt] [PATCH v2 4/4] tests: Use the new DO_TEST_CAPS_*() macros

Andrea Bolognani abologna at redhat.com
Tue Jul 2 15:50:42 UTC 2019


There are probably more situations where they could be taken
advantage of, but these are very obvious scenarios because we
either manage to get rid of a bunch of explicit capabilities,
or we make a bunch of related test cases all use the macros
by switching the only odd one out.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 tests/qemuxml2argvtest.c | 33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 8d725040d3..08697e91d6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2849,7 +2849,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
     DO_TEST_CAPS_LATEST("intel-iommu-eim");
     DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb");
-    DO_TEST_PARSE_ERROR("intel-iommu-wrong-machine", NONE);
+    DO_TEST_CAPS_LATEST_PARSE_ERROR("intel-iommu-wrong-machine");
     DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64");
 
     DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
@@ -2915,29 +2915,9 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-virtio-scsi-reservations");
 
     DO_TEST_CAPS_LATEST("tseg-explicit-size");
-    DO_TEST_PARSE_ERROR("tseg-i440fx",
-                        QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_IOH3420,
-                        QEMU_CAPS_ICH9_AHCI,
-                        QEMU_CAPS_MACHINE_SMM_OPT,
-                        QEMU_CAPS_VIRTIO_SCSI,
-                        QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES);
-    DO_TEST_PARSE_ERROR("tseg-explicit-size",
-                        QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_IOH3420,
-                        QEMU_CAPS_ICH9_AHCI,
-                        QEMU_CAPS_MACHINE_SMM_OPT,
-                        QEMU_CAPS_VIRTIO_SCSI);
-    DO_TEST_PARSE_ERROR("tseg-invalid-size",
-                        QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_IOH3420,
-                        QEMU_CAPS_ICH9_AHCI,
-                        QEMU_CAPS_MACHINE_SMM_OPT,
-                        QEMU_CAPS_VIRTIO_SCSI,
-                        QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES);
+    DO_TEST_CAPS_LATEST_PARSE_ERROR("tseg-i440fx");
+    DO_TEST_CAPS_VER_PARSE_ERROR("tseg-explicit-size", "2.10.0");
+    DO_TEST_CAPS_LATEST_PARSE_ERROR("tseg-invalid-size");
 
     DO_TEST("video-virtio-gpu-ccw", QEMU_CAPS_CCW,
             QEMU_CAPS_DEVICE_VIRTIO_GPU,
@@ -2971,10 +2951,7 @@ mymain(void)
     DO_TEST_CAPS_VER("virtio-non-transitional", "3.1.0");
     DO_TEST_CAPS_LATEST("virtio-transitional");
     DO_TEST_CAPS_LATEST("virtio-non-transitional");
-    DO_TEST_PARSE_ERROR("virtio-transitional-not-supported",
-                        QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_PCI_BRIDGE,
-                        QEMU_CAPS_DEVICE_IOH3420);
+    DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-transitional-not-supported");
 
     /* Simple headless guests for various architectures */
     DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-headless", "aarch64");
-- 
2.21.0




More information about the libvir-list mailing list