Blame SOURCES/kvm-Revert-test-hbitmap-Add-non-advancing-iter_next-test.patch

383d26
From 882e1e9983aee5f98b3ad7c65ced43d7cacfd000 Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Wed, 20 Mar 2019 21:48:34 +0100
383d26
Subject: [PATCH 041/163] Revert "test-hbitmap: Add non-advancing iter_next
383d26
 tests"
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20190320214838.22027-7-jsnow@redhat.com>
383d26
Patchwork-id: 84999
383d26
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 06/10] Revert "test-hbitmap: Add non-advancing iter_next tests"
383d26
Bugzilla: 1691048
383d26
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
RH-Acked-by: Max Reitz <mreitz@redhat.com>
383d26
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
383d26
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
383d26
383d26
This reverts commit 269576848ec3d57d2d958cf5ac69b08c44adf816.
383d26
383d26
The functionality is unused. Drop tests.
383d26
383d26
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
383d26
Reviewed-by: John Snow <jsnow@redhat.com>
383d26
(cherry picked from commit 4294c4ab4825a2ce4d816e52f95a6f08b56aa69c)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 tests/test-hbitmap.c | 36 ++++++++++++------------------------
383d26
 1 file changed, 12 insertions(+), 24 deletions(-)
383d26
383d26
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
383d26
index 4f312e9..6358f35 100644
383d26
--- a/tests/test-hbitmap.c
383d26
+++ b/tests/test-hbitmap.c
383d26
@@ -30,18 +30,6 @@ typedef struct TestHBitmapData {
383d26
 } TestHBitmapData;
383d26
 
383d26
 
383d26
-static int64_t check_hbitmap_iter_next(HBitmapIter *hbi)
383d26
-{
383d26
-    int next0, next1;
383d26
-
383d26
-    next0 = hbitmap_iter_next(hbi, false);
383d26
-    next1 = hbitmap_iter_next(hbi, true);
383d26
-
383d26
-    g_assert_cmpint(next0, ==, next1);
383d26
-
383d26
-    return next0;
383d26
-}
383d26
-
383d26
 /* Check that the HBitmap and the shadow bitmap contain the same data,
383d26
  * ignoring the same "first" bits.
383d26
  */
383d26
@@ -58,7 +46,7 @@ static void hbitmap_test_check(TestHBitmapData *data,
383d26
 
383d26
     i = first;
383d26
     for (;;) {
383d26
-        next = check_hbitmap_iter_next(&hbi;;
383d26
+        next = hbitmap_iter_next(&hbi, true);
383d26
         if (next < 0) {
383d26
             next = data->size;
383d26
         }
383d26
@@ -447,25 +435,25 @@ static void test_hbitmap_iter_granularity(TestHBitmapData *data,
383d26
     /* Note that hbitmap_test_check has to be invoked manually in this test.  */
383d26
     hbitmap_test_init(data, 131072 << 7, 7);
383d26
     hbitmap_iter_init(&hbi, data->hb, 0);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0);
383d26
 
383d26
     hbitmap_test_set(data, ((L2 + L1 + 1) << 7) + 8, 8);
383d26
     hbitmap_iter_init(&hbi, data->hb, 0);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), ==, (L2 + L1 + 1) << 7);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), ==, (L2 + L1 + 1) << 7);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0);
383d26
 
383d26
     hbitmap_iter_init(&hbi, data->hb, (L2 + L1 + 2) << 7);
383d26
     g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0);
383d26
 
383d26
     hbitmap_test_set(data, (131072 << 7) - 8, 8);
383d26
     hbitmap_iter_init(&hbi, data->hb, 0);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), ==, (L2 + L1 + 1) << 7);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), ==, 131071 << 7);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), ==, (L2 + L1 + 1) << 7);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), ==, 131071 << 7);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0);
383d26
 
383d26
     hbitmap_iter_init(&hbi, data->hb, (L2 + L1 + 2) << 7);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), ==, 131071 << 7);
383d26
-    g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), ==, 131071 << 7);
383d26
+    g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0);
383d26
 }
383d26
 
383d26
 static void hbitmap_test_set_boundary_bits(TestHBitmapData *data, ssize_t diff)
383d26
@@ -905,7 +893,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapData *data,
383d26
     for (i = 0; i < num_positions; i++) {
383d26
         hbitmap_deserialize_zeroes(data->hb, positions[i], min_l1, true);
383d26
         hbitmap_iter_init(&iter, data->hb, 0);
383d26
-        next = check_hbitmap_iter_next(&iter);
383d26
+        next = hbitmap_iter_next(&iter, true);
383d26
         if (i == num_positions - 1) {
383d26
             g_assert_cmpint(next, ==, -1);
383d26
         } else {
383d26
@@ -931,10 +919,10 @@ static void test_hbitmap_iter_and_reset(TestHBitmapData *data,
383d26
 
383d26
     hbitmap_iter_init(&hbi, data->hb, BITS_PER_LONG - 1);
383d26
 
383d26
-    check_hbitmap_iter_next(&hbi;;
383d26
+    hbitmap_iter_next(&hbi, true);
383d26
 
383d26
     hbitmap_reset_all(data->hb);
383d26
-    check_hbitmap_iter_next(&hbi;;
383d26
+    hbitmap_iter_next(&hbi, true);
383d26
 }
383d26
 
383d26
 static void test_hbitmap_next_zero_check_range(TestHBitmapData *data,
383d26
-- 
383d26
1.8.3.1
383d26