[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/26] check-block-qdict: Cover flattening of empty l
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 19/26] check-block-qdict: Cover flattening of empty lists and dictionaries |
Date: |
Fri, 15 Jun 2018 16:21:01 +0200 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/check-block-qdict.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tests/check-block-qdict.c b/tests/check-block-qdict.c
index 29f58a2d3d..2da16f01a6 100644
--- a/tests/check-block-qdict.c
+++ b/tests/check-block-qdict.c
@@ -41,6 +41,8 @@ static void qdict_flatten_test(void)
QList *e = qlist_new();
QDict *e_1_2 = qdict_new();
QDict *f = qdict_new();
+ QList *y = qlist_new();
+ QDict *z = qdict_new();
QDict *root = qdict_new();
/*
@@ -62,7 +64,9 @@ static void qdict_flatten_test(void)
* "c": 2,
* "d": 3,
* },
- * "g": 4
+ * "g": 4,
+ * "y": [{}],
+ * "z": {"a": []}
* }
*
* to
@@ -77,6 +81,8 @@ static void qdict_flatten_test(void)
* "f.d": 3,
* "g": 4
* }
+ *
+ * Note that "y" and "z" get eaten.
*/
qdict_put_int(e_1_2, "a", 0);
@@ -91,9 +97,15 @@ static void qdict_flatten_test(void)
qdict_put_int(f, "c", 2);
qdict_put_int(f, "d", 3);
+ qlist_append(y, qdict_new());
+
+ qdict_put(z, "a", qlist_new());
+
qdict_put(root, "e", e);
qdict_put(root, "f", f);
qdict_put_int(root, "g", 4);
+ qdict_put(root, "y", y);
+ qdict_put(root, "z", z);
qdict_flatten(root);
--
2.13.6
- [Qemu-devel] [PULL 10/26] block: Fix -drive for certain non-string scalars, (continued)
- [Qemu-devel] [PULL 10/26] block: Fix -drive for certain non-string scalars, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 12/26] block: Factor out qobject_input_visitor_new_flat_confused(), Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 13/26] block: Make remaining uses of qobject input visitor more robust, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 15/26] block-qdict: Tweak qdict_flatten_qdict(), qdict_flatten_qlist(), Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 17/26] block-qdict: Simplify qdict_is_list() some, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 16/26] block-qdict: Clean up qdict_crumple() a bit, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 09/26] block: Fix -blockdev for certain non-string scalars, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 22/26] rbd: New parameter key-secret, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 20/26] block: Fix -blockdev / blockdev-add for empty objects and arrays, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 18/26] check-block-qdict: Rename qdict_flatten()'s variables for clarity, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 19/26] check-block-qdict: Cover flattening of empty lists and dictionaries,
Kevin Wolf <=
- [Qemu-devel] [PULL 21/26] rbd: New parameter auth-client-required, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 11/26] block: Clean up a misuse of qobject_to() in .bdrv_co_create_opts(), Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 23/26] block: Remove deprecated -drive geometry options, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 26/26] block: Remove dead deprecation warning code, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 24/26] block: Remove deprecated -drive option addr, Kevin Wolf, 2018/06/15
- [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial, Kevin Wolf, 2018/06/15