]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuxml2*test: switch to virTestRunLog
authorJán Tomko <jtomko@redhat.com>
Fri, 20 Aug 2021 14:34:26 +0000 (16:34 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 23 Aug 2021 12:43:57 +0000 (14:43 +0200)
This essentially reverts:
commit ca5c8e1dc7801854d856cfc62f2054ae753a40c3
    qemuxml2argvtest: Avoid conditions in test macro

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemustatusxml2xmltest.c
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c
tests/testutilsqemu.h

index f6bde507a15cafe422e5a1263b277b7b72d47bad..d58f4b69dab8942cbfbcf6033abec0167b469125 100644 (file)
@@ -83,8 +83,7 @@ mymain(void)
     g_autoptr(virConnect) conn = NULL;
     struct testQemuConf testConf = { .capslatest = capslatest,
                                      .capscache = capscache,
-                                     .qapiSchemaCache = NULL,
-                                     .retptr = NULL };
+                                     .qapiSchemaCache = NULL };
 
     if (!capslatest)
         return EXIT_FAILURE;
index 4ce7ed5f002b66edb2359f06105e717229df8aee..00a85988d6fb52f881ddaefc715169787003cfcc 100644 (file)
@@ -766,8 +766,6 @@ testCompareXMLToArgv(const void *data)
             goto cleanup;
     }
 
-    log = virTestLogContentAndReset();
-    VIR_FREE(log);
     virResetLastError();
 
     if (!(cmd = testCompareXMLToArgvCreateArgs(&driver, vm, migrateURI, info,
@@ -826,9 +824,6 @@ testCompareXMLToArgv(const void *data)
     if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64)
         qemuTestSetHostArch(&driver, VIR_ARCH_NONE);
 
-    if (ret < 0)
-        *info->conf->retptr = ret;
-
     return ret;
 }
 
@@ -856,8 +851,7 @@ mymain(void)
     g_autoptr(GHashTable) capscache = virHashNew(virObjectFreeHashData);
     struct testQemuConf testConf = { .capslatest = capslatest,
                                      .capscache = capscache,
-                                     .qapiSchemaCache = qapiSchemaCache,
-                                     .retptr = &ret };
+                                     .qapiSchemaCache = qapiSchemaCache };
 
     if (!capslatest)
         return EXIT_FAILURE;
@@ -952,7 +946,7 @@ mymain(void)
         }; \
         testQemuInfoSetArgs(&info, &testConf, __VA_ARGS__); \
         testInfoSetPaths(&info, _suffix); \
-        virTestRun("QEMU XML-2-ARGV " _name _suffix, testCompareXMLToArgv, &info); \
+        virTestRunLog(&ret, "QEMU XML-2-ARGV " _name _suffix, testCompareXMLToArgv, &info); \
         testQemuInfoClear(&info); \
     } while (0)
 
index 0413a130c343fcbfacabc2abdb8c1958f27bf2d5..6d3526f91f81ac9c62887eaf9beaac416c3bf26d 100644 (file)
@@ -55,7 +55,6 @@ testXML2XMLActive(const void *opaque)
                                    info->infile, info->outfile, true,
                                    info->parseFlags,
                                    TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS) < 0) {
-        *info->conf->retptr = -1;
         return -1;
     }
 
@@ -73,7 +72,6 @@ testXML2XMLInactive(const void *opaque)
                                    info->infile, info->outfile, false,
                                    info->parseFlags,
                                    TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS) < 0) {
-        *info->conf->retptr = -1;
         return -1;
     }
 
@@ -118,8 +116,7 @@ mymain(void)
     g_autoptr(virConnect) conn = NULL;
     struct testQemuConf testConf = { .capslatest = capslatest,
                                      .capscache = capscache,
-                                     .qapiSchemaCache = NULL,
-                                     .retptr = &ret };
+                                     .qapiSchemaCache = NULL };
 
     if (!capslatest)
         return EXIT_FAILURE;
@@ -168,12 +165,12 @@ mymain(void)
  \
         if (when & WHEN_INACTIVE) { \
             testInfoSetPaths(&info, suffix, WHEN_INACTIVE); \
-            virTestRun("QEMU XML-2-XML-inactive " _name, testXML2XMLInactive, &info); \
+            virTestRunLog(&ret, "QEMU XML-2-XML-inactive " _name, testXML2XMLInactive, &info); \
         } \
  \
         if (when & WHEN_ACTIVE) { \
             testInfoSetPaths(&info, suffix, WHEN_ACTIVE); \
-            virTestRun("QEMU XML-2-XML-active " _name, testXML2XMLActive, &info); \
+            virTestRunLog(&ret, "QEMU XML-2-XML-active " _name, testXML2XMLActive, &info); \
         } \
         testQemuInfoClear(&info); \
     } while (0)
index 64562cbd1c772bf93363dbdb5b8800f300e12384..d59fa5323986264dd7dc04d0174b78d3d9ec8424 100644 (file)
@@ -58,7 +58,6 @@ struct testQemuConf {
     GHashTable *capscache;
     GHashTable *capslatest;
     GHashTable *qapiSchemaCache;
-    int *retptr;
 };
 
 struct testQemuArgs {