Received: from eggs.gnu.org ([2001:4830:134:3::10]:40109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPAPi-0006TW-1Y for qemu-devel@nongnu.org; Mon, 18 Jul 2016 11:24:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPAPg-0003Fw-5v for qemu-devel@nongnu.org; Mon, 18 Jul 2016 11:24:57 -0400 References: <1468614461-28807-1-git-send-email-jsnow@redhat.com> <1468614461-28807-10-git-send-email-jsnow@redhat.com> From: Max Reitz Message-ID: <056434cd-8a6e-7ae7-9ea9-9ab922091c7c@redhat.com> Date: Mon, 18 Jul 2016 17:24:46 +0200 MIME-Version: 1.0 In-Reply-To: <1468614461-28807-10-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="44ifEw6FV1vi3ljnjxxFlUfqdi8C6PRAa" Subject: Re: [Qemu-devel] [PATCH v6 09/10] tests: Add test code for hbitmap serialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: vsementsov@virtuozzo.com, famz@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --44ifEw6FV1vi3ljnjxxFlUfqdi8C6PRAa From: Max Reitz To: John Snow , qemu-block@nongnu.org Cc: vsementsov@virtuozzo.com, famz@redhat.com, qemu-devel@nongnu.org Message-ID: <056434cd-8a6e-7ae7-9ea9-9ab922091c7c@redhat.com> Subject: Re: [PATCH v6 09/10] tests: Add test code for hbitmap serialization References: <1468614461-28807-1-git-send-email-jsnow@redhat.com> <1468614461-28807-10-git-send-email-jsnow@redhat.com> In-Reply-To: <1468614461-28807-10-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 15.07.2016 22:27, John Snow wrote: > From: Fam Zheng >=20 > Acked-by: John Snow > Signed-off-by: Fam Zheng > Signed-off-by: John Snow > --- > tests/test-hbitmap.c | 139 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 139 insertions(+) >=20 > diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c > index e3abde1..18e8114 100644 > --- a/tests/test-hbitmap.c > +++ b/tests/test-hbitmap.c [...] > @@ -737,6 +738,16 @@ static void test_hbitmap_meta_one(TestHBitmapData = *data, const void *unused) > } > } > =20 > +static void test_hbitmap_serialize_granularity(TestHBitmapData *data, > + const void *unused) > +{ > + int r; > + > + hbitmap_test_init(data, L3 * 2, 3); > + r =3D hbitmap_serialization_granularity(data->hb); > + g_assert_cmpint(r, =3D=3D, BITS_PER_LONG << 3); Won't this only work on systems where BITS_PER_LONG =3D=3D 64? (Because hbitmap_serialization_granularity() uses a hard-coded 64.) Rest looks good. Max > +} > + > static void test_hbitmap_meta_zero(TestHBitmapData *data, const void *= unused) > { > hbitmap_test_init_meta(data, 0, 0, 1); --44ifEw6FV1vi3ljnjxxFlUfqdi8C6PRAa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEvBAEBCAAZBQJXjPS/EhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrXtM B/0eCGa2BobTmOoulH+DWGvMupvRei1KOkLlxNp6bct+Vz0nFwDe8c+eHXGS5wBI kunkG64mOT/LI3VVtly4Pj2r76zanhFadxoc0DBhK90833muC4etogFynzaLNMAi x4dUazY92LC7RXNA78kv2djqkwXsNu9T0GVxHUx/0vD0Aq+kmLfioSVZdXz5CXqd heWjcwtwK44ERBmXKO/6f9XUm/Sya2s2WqkQOAvZmE+d5WZ7SZ3MvrrTCPMbX2dt K1Ukuhgof9LWxQ1fj+oeq2TkvanLoXK3V8riZuzjR0e9pKuCsoXC1XlPJ0EIZqcm QUgoENfcIvGXWzEwAbeJzjQK =OWFQ -----END PGP SIGNATURE----- --44ifEw6FV1vi3ljnjxxFlUfqdi8C6PRAa--