aboutsummaryrefslogtreecommitdiff
path: root/tests/check-qlit.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-25 12:59:11 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-09-04 13:09:12 +0200
commitcbb654052600c376d5ee3401c98a25d09d11a154 (patch)
tree60ca5d5d064445fbae2dbb40e05b82d9a30c37ed /tests/check-qlit.c
parent6da8a7a3b444211914418d2b3c7dc615d70a7d2d (diff)
downloadqemu-cbb654052600c376d5ee3401c98a25d09d11a154.zip
qemu-cbb654052600c376d5ee3401c98a25d09d11a154.tar.gz
qemu-cbb654052600c376d5ee3401c98a25d09d11a154.tar.bz2
qlit: Tighten QLit list vs QList comparison
We check that all members of the QLit list are also in the QList. We neglect to check the other direction. Fix that. While there, use QLIST_FOREACH_ENTRY() to simplify the code and break the loop on the first mismatch. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170825105913.4060-13-marcandre.lureau@redhat.com> [Commit message improved] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/check-qlit.c')
-rw-r--r--tests/check-qlit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/check-qlit.c b/tests/check-qlit.c
index d2ecc20..c59ec1a 100644
--- a/tests/check-qlit.c
+++ b/tests/check-qlit.c
@@ -58,6 +58,9 @@ static void qlit_equal_qobject_test(void)
g_assert(!qlit_equal_qobject(&qlit_foo, qobj));
+ qdict_put(qobject_to_qdict(qobj), "bee", qlist_new());
+ g_assert(!qlit_equal_qobject(&qlit, qobj));
+
qobject_decref(qobj);
}