]> xenbits.xensource.com Git - libvirt.git/commitdiff
testutils: Fix coverity warning with REGENERATE_OUTPUT
authorCole Robinson <crobinso@redhat.com>
Tue, 12 Jan 2016 15:55:08 +0000 (10:55 -0500)
committerCole Robinson <crobinso@redhat.com>
Tue, 12 Jan 2016 16:30:19 +0000 (11:30 -0500)
- Don't double check for expectName
- actual is always non-NULL by this point, so don't check it either

tests/testutils.c

index 4ffea0c4ad9386471437b961b4d97f49ffd793ab..b587f83b0f38daf1e96696453c796a5d35cd0b21 100644 (file)
@@ -469,15 +469,14 @@ virtTestDifferenceFullInternal(FILE *stream,
     actualStart = actual;
     actualEnd = actual + (strlen(actual)-1);
 
-    if (regenerate && (virTestGetRegenerate() > 0) && expectName && actual) {
+    if (expectName && regenerate && (virTestGetRegenerate() > 0)) {
         char *regencontent;
 
         /* Try to properly indent qemu argv files */
         if (!(regencontent = virStringReplace(actual, " -", " \\\n-")))
             return -1;
 
-        if (expectName && actual &&
-            virFileWriteStr(expectName, regencontent, 0666) < 0) {
+        if (virFileWriteStr(expectName, regencontent, 0666) < 0) {
             VIR_FREE(regencontent);
             return -1;
         }