Blame SOURCES/kvm-check-block-qdict-Cover-flattening-of-empty-lists-an.patch

357786
From b90ea90ed89d27cadc704b664e6ca26ea32fa95d Mon Sep 17 00:00:00 2001
357786
From: Markus Armbruster <armbru@redhat.com>
357786
Date: Mon, 18 Jun 2018 08:43:27 +0200
357786
Subject: [PATCH 20/54] check-block-qdict: Cover flattening of empty lists and
357786
 dictionaries
357786
357786
RH-Author: Markus Armbruster <armbru@redhat.com>
357786
Message-id: <20180618084330.30009-21-armbru@redhat.com>
357786
Patchwork-id: 80734
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 20/23] check-block-qdict: Cover flattening of empty lists and dictionaries
357786
Bugzilla: 1557995
357786
RH-Acked-by: Max Reitz <mreitz@redhat.com>
357786
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
357786
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
357786
357786
Signed-off-by: Markus Armbruster <armbru@redhat.com>
357786
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
357786
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
357786
(cherry picked from commit bef96b1549907b005ce1fa1456d2a0910d2a1aa5)
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 tests/check-block-qdict.c | 14 +++++++++++++-
357786
 1 file changed, 13 insertions(+), 1 deletion(-)
357786
357786
diff --git a/tests/check-block-qdict.c b/tests/check-block-qdict.c
357786
index 29f58a2..2da16f0 100644
357786
--- a/tests/check-block-qdict.c
357786
+++ b/tests/check-block-qdict.c
357786
@@ -41,6 +41,8 @@ static void qdict_flatten_test(void)
357786
     QList *e = qlist_new();
357786
     QDict *e_1_2 = qdict_new();
357786
     QDict *f = qdict_new();
357786
+    QList *y = qlist_new();
357786
+    QDict *z = qdict_new();
357786
     QDict *root = qdict_new();
357786
 
357786
     /*
357786
@@ -62,7 +64,9 @@ static void qdict_flatten_test(void)
357786
      *         "c": 2,
357786
      *         "d": 3,
357786
      *     },
357786
-     *     "g": 4
357786
+     *     "g": 4,
357786
+     *     "y": [{}],
357786
+     *     "z": {"a": []}
357786
      * }
357786
      *
357786
      * to
357786
@@ -77,6 +81,8 @@ static void qdict_flatten_test(void)
357786
      *     "f.d": 3,
357786
      *     "g": 4
357786
      * }
357786
+     *
357786
+     * Note that "y" and "z" get eaten.
357786
      */
357786
 
357786
     qdict_put_int(e_1_2, "a", 0);
357786
@@ -91,9 +97,15 @@ static void qdict_flatten_test(void)
357786
     qdict_put_int(f, "c", 2);
357786
     qdict_put_int(f, "d", 3);
357786
 
357786
+    qlist_append(y, qdict_new());
357786
+
357786
+    qdict_put(z, "a", qlist_new());
357786
+
357786
     qdict_put(root, "e", e);
357786
     qdict_put(root, "f", f);
357786
     qdict_put_int(root, "g", 4);
357786
+    qdict_put(root, "y", y);
357786
+    qdict_put(root, "z", z);
357786
 
357786
     qdict_flatten(root);
357786
 
357786
-- 
357786
1.8.3.1
357786