[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 26/85] tests: add hbitmap iter test
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 26/85] tests: add hbitmap iter test |
Date: |
Tue, 11 Jul 2017 18:07:15 +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;
--
2.9.4
- [Qemu-block] [PULL 16/85] block: rip out all traces of password prompting, (continued)
- [Qemu-block] [PULL 16/85] block: rip out all traces of password prompting, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 17/85] block: remove all encryption handling APIs, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 18/85] block: pass option prefix down to crypto layer, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 19/85] qcow2: report encryption specific image information, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 20/85] docs: document encryption options for qcow, qcow2 and luks, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 21/85] iotests: 181 does not work for all formats, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 22/85] mirror: Fix inconsistent backing AioContext for after mirroring, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 23/85] specs/qcow2: fix bitmap granularity qemu-specific note, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 24/85] specs/qcow2: do not use wording 'bitmap header', Max Reitz, 2017/07/11
- [Qemu-block] [PULL 25/85] hbitmap: improve dirty iter, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 26/85] tests: add hbitmap iter test,
Max Reitz <=
- [Qemu-block] [PULL 27/85] block: fix bdrv_dirty_bitmap_granularity signature, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 29/85] qcow2-refcount: rename inc_refcounts() and make it public, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 28/85] block/dirty-bitmap: add deserialize_ones func, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 30/85] qcow2: add bitmaps extension, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 31/85] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 32/85] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 34/85] block: refactor bdrv_reopen_commit, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 33/85] qcow2: autoloading dirty bitmaps, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 35/85] block: new bdrv_reopen_bitmaps_rw interface, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 38/85] block: bdrv_close: release bitmaps after drv->bdrv_close, Max Reitz, 2017/07/11