[PATCH 3/3] Reverse the logic in virbitmaptest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]