mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55: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)) {
|
if (STRNEQ(outXmlData, actual)) {
|
||||||
virtTestDifference(stderr, outXmlData, actual);
|
virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (STRNEQ(xmlData, actual)) {
|
if (STRNEQ(xmlData, actual)) {
|
||||||
virtTestDifference(stderr, xmlData, actual);
|
virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ testCompareXMLToConfigFiles(const char *xml,
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (STRNEQ(expectxml, actualxml)) {
|
if (STRNEQ(expectxml, actualxml)) {
|
||||||
virtTestDifference(stderr, expectxml, actualxml);
|
virtTestDifferenceFull(stderr, expectxml, xml, actualxml, NULL);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (STRNEQ(xmlData, actual)) {
|
if (STRNEQ(xmlData, actual)) {
|
||||||
virtTestDifference(stderr, xmlData, actual);
|
virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
|
|||||||
static int
|
static int
|
||||||
testQemuHotplugCheckResult(virDomainObjPtr vm,
|
testQemuHotplugCheckResult(virDomainObjPtr vm,
|
||||||
const char *expected,
|
const char *expected,
|
||||||
|
const char *expectedFile,
|
||||||
bool fail)
|
bool fail)
|
||||||
{
|
{
|
||||||
char *actual;
|
char *actual;
|
||||||
@ -192,7 +193,9 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
if (!fail)
|
if (!fail)
|
||||||
virtTestDifference(stderr, expected, actual);
|
virtTestDifferenceFull(stderr,
|
||||||
|
expected, expectedFile,
|
||||||
|
actual, NULL);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,13 +297,15 @@ testQemuHotplug(const void *data)
|
|||||||
VIR_FREE(dev);
|
VIR_FREE(dev);
|
||||||
}
|
}
|
||||||
if (ret == 0 || fail)
|
if (ret == 0 || fail)
|
||||||
ret = testQemuHotplugCheckResult(vm, result_xml, fail);
|
ret = testQemuHotplugCheckResult(vm, result_xml,
|
||||||
|
result_filename, fail);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DETACH:
|
case DETACH:
|
||||||
ret = testQemuHotplugDetach(vm, dev);
|
ret = testQemuHotplugDetach(vm, dev);
|
||||||
if (ret == 0 || fail)
|
if (ret == 0 || fail)
|
||||||
ret = testQemuHotplugCheckResult(vm, domain_xml, fail);
|
ret = testQemuHotplugCheckResult(vm, domain_xml,
|
||||||
|
domain_filename, fail);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UPDATE:
|
case UPDATE:
|
||||||
|
Loading…
Reference in New Issue
Block a user