From nobody Wed Nov 5 08:16:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533318812159114.50302852399602; Fri, 3 Aug 2018 10:53:32 -0700 (PDT) Received: from localhost ([::1]:52547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fleGP-0003nz-1P for importer@patchew.org; Fri, 03 Aug 2018 13:53:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fleAJ-00007J-Cz for qemu-devel@nongnu.org; Fri, 03 Aug 2018 13:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fleAE-0008Pz-GH for qemu-devel@nongnu.org; Fri, 03 Aug 2018 13:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:42022) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fleAE-0008PS-7m; Fri, 03 Aug 2018 13:46:58 -0400 Received: from vz-out.virtuozzo.com ([185.231.240.5] helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1fleAB-0003t9-KB; Fri, 03 Aug 2018 20:46:55 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Fri, 3 Aug 2018 20:46:53 +0300 Message-Id: <20180803174654.278336-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180803174654.278336-1-vsementsov@virtuozzo.com> References: <20180803174654.278336-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 5/6] Revert "test-hbitmap: Add non-advancing iter_next tests" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, jcody@redhat.com, mreitz@redhat.com, den@openvz.org, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit 269576848ec3d57d2d958cf5ac69b08c44adf816. The functionality is unused. Drop tests. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/test-hbitmap.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index 5e67ac1d3a..f2158f767d 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitmap.c @@ -30,18 +30,6 @@ typedef struct TestHBitmapData { } TestHBitmapData; =20 =20 -static int64_t check_hbitmap_iter_next(HBitmapIter *hbi) -{ - int next0, next1; - - next0 =3D hbitmap_iter_next(hbi, false); - next1 =3D hbitmap_iter_next(hbi, true); - - g_assert_cmpint(next0, =3D=3D, next1); - - return next0; -} - /* Check that the HBitmap and the shadow bitmap contain the same data, * ignoring the same "first" bits. */ @@ -58,7 +46,7 @@ static void hbitmap_test_check(TestHBitmapData *data, =20 i =3D first; for (;;) { - next =3D check_hbitmap_iter_next(&hbi); + next =3D hbitmap_iter_next(&hbi, true); if (next < 0) { next =3D data->size; } @@ -447,25 +435,25 @@ static void test_hbitmap_iter_granularity(TestHBitmap= Data *data, /* Note that hbitmap_test_check has to be invoked manually in this tes= t. */ hbitmap_test_init(data, 131072 << 7, 7); hbitmap_iter_init(&hbi, data->hb, 0); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0); =20 hbitmap_test_set(data, ((L2 + L1 + 1) << 7) + 8, 8); hbitmap_iter_init(&hbi, data->hb, 0); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), =3D=3D, (L2 + L1 + 1) <= < 7); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), =3D=3D, (L2 + L1 + 1) <= < 7); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0); =20 hbitmap_iter_init(&hbi, data->hb, (L2 + L1 + 2) << 7); g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0); =20 hbitmap_test_set(data, (131072 << 7) - 8, 8); hbitmap_iter_init(&hbi, data->hb, 0); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), =3D=3D, (L2 + L1 + 1) <= < 7); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), =3D=3D, 131071 << 7); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), =3D=3D, (L2 + L1 + 1) <= < 7); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), =3D=3D, 131071 << 7); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0); =20 hbitmap_iter_init(&hbi, data->hb, (L2 + L1 + 2) << 7); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), =3D=3D, 131071 << 7); - g_assert_cmpint(check_hbitmap_iter_next(&hbi), <, 0); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), =3D=3D, 131071 << 7); + g_assert_cmpint(hbitmap_iter_next(&hbi, true), <, 0); } =20 static void hbitmap_test_set_boundary_bits(TestHBitmapData *data, ssize_t = diff) @@ -905,7 +893,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapDa= ta *data, for (i =3D 0; i < num_positions; i++) { hbitmap_deserialize_zeroes(data->hb, positions[i], min_l1, true); hbitmap_iter_init(&iter, data->hb, 0); - next =3D check_hbitmap_iter_next(&iter); + next =3D hbitmap_iter_next(&iter, true); if (i =3D=3D num_positions - 1) { g_assert_cmpint(next, =3D=3D, -1); } else { @@ -931,10 +919,10 @@ static void test_hbitmap_iter_and_reset(TestHBitmapDa= ta *data, =20 hbitmap_iter_init(&hbi, data->hb, BITS_PER_LONG - 1); =20 - check_hbitmap_iter_next(&hbi); + hbitmap_iter_next(&hbi, true); =20 hbitmap_reset_all(data->hb); - check_hbitmap_iter_next(&hbi); + hbitmap_iter_next(&hbi, true); } =20 static void test_hbitmap_next_zero_check(TestHBitmapData *data, int64_t st= art) --=20 2.11.1