]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2argv: add testInfoClear
authorCole Robinson <crobinso@redhat.com>
Thu, 14 Mar 2019 09:54:00 +0000 (05:54 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 21 Mar 2019 16:43:02 +0000 (12:43 -0400)
This is closer to the pattern of qemuxml2xml tests, and will make
things easier if we extend testInfo to contain more freeable data

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
tests/qemuxml2argvtest.c

index 2aad97531515294e73c5a85a37df7a8c108062cd..004d3b4c4fc914fb271f22a3167970d5a33c9f5e 100644 (file)
@@ -678,6 +678,12 @@ testInfoSetArgs(struct testInfo *info, ...)
     return ret;
 }
 
+static void
+testInfoClear(struct testInfo *info)
+{
+    virObjectUnref(info->qemuCaps);
+}
+
 # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX"
 
 static int
@@ -824,10 +830,9 @@ mymain(void)
         if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
-        virObjectUnref(info.qemuCaps); \
+        testInfoClear(&info); \
     } while (0)
 
-
 # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
     DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
 
@@ -864,7 +869,7 @@ mymain(void)
         if (virTestRun("QEMU XML-2-ARGV " _name, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
-        virObjectUnref(info.qemuCaps); \
+        testInfoClear(&info); \
     } while (0)
 
 /* All the following macros require an explicit QEMU_CAPS_* list