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:
Pavel Hrdina 2015-12-10 14:12:13 +01:00
parent c7f5e26b5f
commit 2d446b6eeb
5 changed files with 12 additions and 7 deletions

View File

@ -114,7 +114,7 @@ testCompareXMLToXMLFiles(const char *inxml,
}
if (STRNEQ(outXmlData, actual)) {
virtTestDifference(stderr, outXmlData, actual);
virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
goto cleanup;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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: