[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 066/100] tests: add hbitmap iter test
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 066/100] tests: add hbitmap iter test |
Date: |
Fri, 7 Jul 2017 19:08:21 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
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>
Message-id: address@hidden
Signed-off-by: Max Reitz <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 23773d2..1acb353 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;
--
1.8.3.1
- [Qemu-block] [PULL 053/100] qcow2: add support for LUKS encryption format, (continued)
- [Qemu-block] [PULL 053/100] qcow2: add support for LUKS encryption format, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 061/100] iotests: 181 does not work for all formats, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 060/100] docs: document encryption options for qcow, qcow2 and luks, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 062/100] mirror: Fix inconsistent backing AioContext for after mirroring, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 058/100] block: pass option prefix down to crypto layer, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 057/100] block: remove all encryption handling APIs, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 063/100] specs/qcow2: fix bitmap granularity qemu-specific note, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 064/100] specs/qcow2: do not use wording 'bitmap header', Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 065/100] hbitmap: improve dirty iter, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 067/100] block: fix bdrv_dirty_bitmap_granularity signature, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 066/100] tests: add hbitmap iter test,
Kevin Wolf <=
- [Qemu-block] [PULL 068/100] block/dirty-bitmap: add deserialize_ones func, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 069/100] qcow2-refcount: rename inc_refcounts() and make it public, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 071/100] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 072/100] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 070/100] qcow2: add bitmaps extension, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 074/100] block: refactor bdrv_reopen_commit, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 073/100] qcow2: autoloading dirty bitmaps, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 078/100] block: bdrv_close: release bitmaps after drv->bdrv_close, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 075/100] block: new bdrv_reopen_bitmaps_rw interface, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 077/100] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap, Kevin Wolf, 2017/07/07