From a59590c7ebddece3b0bc4f05f5b888f0aba8560a Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Wed, 6 Mar 2019 19:02:08 +0100 Subject: [PATCH] tests: use virTestCompareToFile in storagepoolcapstest This will allow to use VIR_TEST_REGENERATE_OUTPUT. Signed-off-by: Pavel Hrdina --- tests/storagepoolcapstest.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c index d31f50c957..c59069ff7c 100644 --- a/tests/storagepoolcapstest.c +++ b/tests/storagepoolcapstest.c @@ -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; -- GitLab