提交 a59590c7 编写于 作者: P Pavel Hrdina

tests: use virTestCompareToFile in storagepoolcapstest

This will allow to use VIR_TEST_REGENERATE_OUTPUT.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 094f29df
...@@ -57,7 +57,6 @@ test_virStoragePoolCapsFormat(const void *opaque) ...@@ -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) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册