mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +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;
|
||||
int ret = -1;
|
||||
VIR_AUTOFREE(char *) path = NULL;
|
||||
VIR_AUTOFREE(char *) poolCapsFromFile = NULL;
|
||||
VIR_AUTOFREE(char *) poolCapsXML = NULL;
|
||||
|
||||
|
||||
@ -68,16 +67,11 @@ test_virStoragePoolCapsFormat(const void *opaque)
|
||||
abs_srcdir, data->filename) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virFileReadAll(path, 8192, &poolCapsFromFile) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(poolCapsXML = virStoragePoolCapsFormat(poolCaps)))
|
||||
goto cleanup;
|
||||
|
||||
if (STRNEQ(poolCapsFromFile, poolCapsXML)) {
|
||||
virTestDifference(stderr, poolCapsFromFile, poolCapsXML);
|
||||
if (virTestCompareToFile(poolCapsXML, path) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user