From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6RA1-0005U1-EZ for qemu-devel@nongnu.org; Mon, 14 Nov 2016 18:59:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6R9y-0003J5-7b for qemu-devel@nongnu.org; Mon, 14 Nov 2016 18:59:37 -0500 References: <1478715476-132280-1-git-send-email-vsementsov@virtuozzo.com> <1478715476-132280-5-git-send-email-vsementsov@virtuozzo.com> From: John Snow Message-ID: Date: Mon, 14 Nov 2016 18:59:27 -0500 MIME-Version: 1.0 In-Reply-To: <1478715476-132280-5-git-send-email-vsementsov@virtuozzo.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 04/21] tests: add hbitmap iter test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org On 11/09/2016 01:17 PM, Vladimir Sementsov-Ogievskiy wrote: > Test that hbitmap iter is resistant to bitmap resetting. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Signed-off-by: Denis V. Lunev > Reviewed-by: Max Reitz Reviewed-by: John Snow > --- > tests/test-hbitmap.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c > index 9b7495c..c76d2b5 100644 > --- a/tests/test-hbitmap.c > +++ b/tests/test-hbitmap.c > @@ -898,6 +898,22 @@ static void hbitmap_test_add(const char *testpath, > hbitmap_test_teardown); > } > > +static void test_hbitmap_iter_and_reset(TestHBitmapData *data, > + const void *unused) > +{ > + HBitmapIter hbi; > + > + hbitmap_test_init(data, L1 * 2, 0); > + hbitmap_set(data->hb, 0, data->size); > + > + hbitmap_iter_init(&hbi, data->hb, BITS_PER_LONG - 1); > + > + hbitmap_iter_next(&hbi); > + > + hbitmap_reset_all(data->hb); > + hbitmap_iter_next(&hbi); > +} > + > int main(int argc, char **argv) > { > g_test_init(&argc, &argv, NULL); > @@ -955,6 +971,9 @@ int main(int argc, char **argv) > test_hbitmap_serialize_part); > hbitmap_test_add("/hbitmap/serialize/zeroes", > test_hbitmap_serialize_zeroes); > + > + hbitmap_test_add("/hbitmap/iter/iter_and_reset", > + test_hbitmap_iter_and_reset); > g_test_run(); > > return 0; > --=20 =97js