]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2argv: remove full testInfo initialization
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Mar 2019 23:26:08 +0000 (19:26 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 21 Mar 2019 16:43:02 +0000 (12:43 -0400)
Only initialize the fields that are passed in

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

index 563812e2faf74d4a43da185f3f4ccc7feb109f41..9e6b1264a8aa570cd20ff89434f56cf5ad733998 100644 (file)
@@ -799,11 +799,12 @@ mymain(void)
  * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate
  * version.
  */
-# define DO_TEST_CAPS_INTERNAL(name, suffix, \
+# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \
                                arch, capsfile, stripmachinealiases, ...) \
     do { \
         static struct testInfo info = { \
-            name, "." suffix, NULL, NULL, -1, 0, 0, \
+            .name = _name, \
+            .suffix = "." _suffix, \
         }; \
         if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \
                                                             capsfile))) \
@@ -813,7 +814,7 @@ mymain(void)
         if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \
             return EXIT_FAILURE; \
         info.flags |= FLAG_REAL_CAPS; \
-        if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \
+        if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
         virObjectUnref(info.qemuCaps); \
@@ -852,16 +853,16 @@ mymain(void)
                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
 
 
-# define DO_TEST_FULL(name, ...) \
+# define DO_TEST_FULL(_name, ...) \
     do { \
         static struct testInfo info = { \
-            name, NULL, NULL, NULL, -1, 0, 0, \
+            .name = _name, \
         }; \
         if (!(info.qemuCaps = virQEMUCapsNew())) \
             return EXIT_FAILURE; \
         if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \
             return EXIT_FAILURE; \
-        if (virTestRun("QEMU XML-2-ARGV " name, \
+        if (virTestRun("QEMU XML-2-ARGV " _name, \
                        testCompareXMLToArgv, &info) < 0) \
             ret = -1; \
         virObjectUnref(info.qemuCaps); \