]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Reverse the logic in virbitmaptest
authorJán Tomko <jtomko@redhat.com>
Fri, 6 Mar 2015 16:55:38 +0000 (17:55 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 10 Mar 2015 12:45:51 +0000 (13:45 +0100)
Test the whole range in testBit, not just the first bit.

tests/virbitmaptest.c

index ac5f2987d760ecf813c82270a24dc9806f4bbd59..f24727594aafe1e38ebc1c299181bcd4ed30ed28 100644 (file)
@@ -74,11 +74,11 @@ testBit(virBitmapPtr bitmap,
     for (i = start; i <= end; i++) {
         if (virBitmapGetBit(bitmap, i, &result) < 0)
             return -1;
-        if (result == expected)
-            return 0;
+        if (result != expected)
+            return -1;
     }
 
-    return -1;
+    return 0;
 }
 
 static int