tests: qemuxml2*test: switch to virTestRunLog

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>
This commit is contained in:
Ján Tomko 2021-08-20 16:34:26 +02:00
parent 8628cbe6ad
commit e431293d74
4 changed files with 6 additions and 17 deletions

View 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;

View 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)

View 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)

View File

@ -58,7 +58,6 @@ struct testQemuConf {
GHashTable *capscache;
GHashTable *capslatest;
GHashTable *qapiSchemaCache;
int *retptr;
};
struct testQemuArgs {