[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v16 04/22] tests: add hbitmap iter test
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH v16 04/22] tests: add hbitmap iter test |
Date: |
Sat, 25 Feb 2017 20:07:40 +0300 |
Test that hbitmap iter is resistant to bitmap resetting.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
---
tests/test-hbitmap.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
index 23773d2051..1acb353889 100644
--- a/tests/test-hbitmap.c
+++ b/tests/test-hbitmap.c
@@ -909,6 +909,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);
@@ -966,6 +982,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;
--
2.11.1
- [Qemu-block] [PATCH v16 00/22] qcow2: persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 22/22] qmp: block-dirty-bitmap-remove: remove persistent, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 01/22] specs/qcow2: fix bitmap granularity qemu-specific note, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 19/22] iotests: test qcow2 persistent dirty bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 20/22] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 12/22] block/dirty-bitmap: add bdrv_dirty_bitmap_next(), Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 03/22] hbitmap: improve dirty iter, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 04/22] tests: add hbitmap iter test,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH v16 21/22] qcow2: add .bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 07/22] qcow2-refcount: rename inc_refcounts() and make it public, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 06/22] block/dirty-bitmap: add deserialize_ones func, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 05/22] block: fix bdrv_dirty_bitmap_granularity signature, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 14/22] block: add bdrv_can_store_new_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 17/22] qmp: add autoload parameter to block-dirty-bitmap-add, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 11/22] block: introduce persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 16/22] qmp: add persistent flag to block-dirty-bitmap-add, Vladimir Sementsov-Ogievskiy, 2017/02/25
- [Qemu-block] [PATCH v16 08/22] qcow2: add bitmaps extension, Vladimir Sementsov-Ogievskiy, 2017/02/25