mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: use virtTestDifferenceFull in tests where we have output file
This will enable regenerate functionality for those tests to make developer lives easier while updating tests. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
c7f5e26b5f
commit
2d446b6eeb
@ -114,7 +114,7 @@ testCompareXMLToXMLFiles(const char *inxml,
|
||||
}
|
||||
|
||||
if (STRNEQ(outXmlData, actual)) {
|
||||
virtTestDifference(stderr, outXmlData, actual);
|
||||
virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
|
||||
goto fail;
|
||||
|
||||
if (STRNEQ(xmlData, actual)) {
|
||||
virtTestDifference(stderr, xmlData, actual);
|
||||
virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ testCompareXMLToConfigFiles(const char *xml,
|
||||
goto fail;
|
||||
|
||||
if (STRNEQ(expectxml, actualxml)) {
|
||||
virtTestDifference(stderr, expectxml, actualxml);
|
||||
virtTestDifferenceFull(stderr, expectxml, xml, actualxml, NULL);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
|
||||
goto fail;
|
||||
|
||||
if (STRNEQ(xmlData, actual)) {
|
||||
virtTestDifference(stderr, xmlData, actual);
|
||||
virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -175,6 +175,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
|
||||
static int
|
||||
testQemuHotplugCheckResult(virDomainObjPtr vm,
|
||||
const char *expected,
|
||||
const char *expectedFile,
|
||||
bool fail)
|
||||
{
|
||||
char *actual;
|
||||
@ -192,7 +193,9 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
|
||||
ret = 0;
|
||||
} else {
|
||||
if (!fail)
|
||||
virtTestDifference(stderr, expected, actual);
|
||||
virtTestDifferenceFull(stderr,
|
||||
expected, expectedFile,
|
||||
actual, NULL);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
@ -294,13 +297,15 @@ testQemuHotplug(const void *data)
|
||||
VIR_FREE(dev);
|
||||
}
|
||||
if (ret == 0 || fail)
|
||||
ret = testQemuHotplugCheckResult(vm, result_xml, fail);
|
||||
ret = testQemuHotplugCheckResult(vm, result_xml,
|
||||
result_filename, fail);
|
||||
break;
|
||||
|
||||
case DETACH:
|
||||
ret = testQemuHotplugDetach(vm, dev);
|
||||
if (ret == 0 || fail)
|
||||
ret = testQemuHotplugCheckResult(vm, domain_xml, fail);
|
||||
ret = testQemuHotplugCheckResult(vm, domain_xml,
|
||||
domain_filename, fail);
|
||||
break;
|
||||
|
||||
case UPDATE:
|
||||
|
Loading…
Reference in New Issue
Block a user