mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
tests: use virTestCompareToFile in storagepoolcapstest
This will allow to use VIR_TEST_REGENERATE_OUTPUT. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
094f29df07
commit
a59590c7eb
@ -57,7 +57,6 @@ test_virStoragePoolCapsFormat(const void *opaque)
|
|||||||
virStoragePoolCapsPtr poolCaps = NULL;
|
virStoragePoolCapsPtr poolCaps = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOFREE(char *) path = NULL;
|
VIR_AUTOFREE(char *) path = NULL;
|
||||||
VIR_AUTOFREE(char *) poolCapsFromFile = NULL;
|
|
||||||
VIR_AUTOFREE(char *) poolCapsXML = NULL;
|
VIR_AUTOFREE(char *) poolCapsXML = NULL;
|
||||||
|
|
||||||
|
|
||||||
@ -68,16 +67,11 @@ test_virStoragePoolCapsFormat(const void *opaque)
|
|||||||
abs_srcdir, data->filename) < 0)
|
abs_srcdir, data->filename) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virFileReadAll(path, 8192, &poolCapsFromFile) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!(poolCapsXML = virStoragePoolCapsFormat(poolCaps)))
|
if (!(poolCapsXML = virStoragePoolCapsFormat(poolCaps)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (STRNEQ(poolCapsFromFile, poolCapsXML)) {
|
if (virTestCompareToFile(poolCapsXML, path) < 0)
|
||||||
virTestDifference(stderr, poolCapsFromFile, poolCapsXML);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user