From c060f44c16966dc1e388f151a0c9ace00f214ca2 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 10 Dec 2015 15:20:56 +0100 Subject: [PATCH] tests.testutils: use virTestDifferenceFull in virtTestCompareToFile Let's use the new virTestDifferenceFull function that will regenerate the expected output and fail the test to let developer know that there something was updated. Signed-off-by: Pavel Hrdina --- tests/testutils.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 70e34564a4..6645d61494 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -670,16 +670,12 @@ virtTestCompareToFile(const char *strcontent, if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent, filecontent)) { - if (virTestGetRegenerate()) { - if (virFileWriteStr(filename, strcontent, 0666) < 0) - goto failure; - goto out; - } - virtTestDifference(stderr, filecontent, strcontent); + virtTestDifferenceFull(stderr, + filecontent, filename, + strcontent, NULL); goto failure; } - out: ret = 0; failure: VIR_FREE(fixedcontent);