]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests.testutils: use virTestDifferenceFull in virtTestCompareToFile
authorPavel Hrdina <phrdina@redhat.com>
Thu, 10 Dec 2015 14:20:56 +0000 (15:20 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 8 Jan 2016 15:08:15 +0000 (16:08 +0100)
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 <phrdina@redhat.com>
tests/testutils.c

index 70e34564a48623bd33827cfeb19560222852a89c..6645d61494fa2cc8348c787a7f6d58bb58e263f3 100644 (file)
@@ -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);