[libvirt PATCH 9/9] tests: qemuxml2*test: switch to virRunTestLog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This essentially reverts:
commit ca5c8e1dc7801854d856cfc62f2054ae753a40c3
    qemuxml2argvtest: Avoid conditions in test macro

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 tests/qemustatusxml2xmltest.c |  3 +--
 tests/qemuxml2argvtest.c      | 10 ++--------
 tests/qemuxml2xmltest.c       |  9 +++------
 tests/testutilsqemu.h         |  1 -
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/tests/qemustatusxml2xmltest.c b/tests/qemustatusxml2xmltest.c
index f6bde507a1..d58f4b69da 100644
--- a/tests/qemustatusxml2xmltest.c
+++ b/tests/qemustatusxml2xmltest.c
@@ -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;
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4ce7ed5f00..00a85988d6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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)
 
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 0413a130c3..6d3526f91f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -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)
diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h
index 64562cbd1c..d59fa53239 100644
--- a/tests/testutilsqemu.h
+++ b/tests/testutilsqemu.h
@@ -58,7 +58,6 @@ struct testQemuConf {
     GHashTable *capscache;
     GHashTable *capslatest;
     GHashTable *qapiSchemaCache;
-    int *retptr;
 };
 
 struct testQemuArgs {
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux