[libvirt] [PATCH 3/3] Reverse the logic in virbitmaptest

Ján Tomko jtomko at redhat.com
Fri Mar 6 17:02:35 UTC 2015


Test the whole range in testBit, not just the first bit.
---
 tests/virbitmaptest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index 1df5987..6b40d74 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -64,11 +64,11 @@ testBit(virBitmapPtr bitmap,
     size_t i;
 
     for (i = start; i <= end; i++) {
-        if (virBitmapGetBit(bitmap, i) == expected)
-            return 0;
+        if (virBitmapGetBit(bitmap, i) != expected)
+            return -1;
     }
 
-    return -1;
+    return 0;
 }
 
 static int
-- 
2.0.5




More information about the libvir-list mailing list