From cbb654052600c376d5ee3401c98a25d09d11a154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 25 Aug 2017 12:59:11 +0200 Subject: qlit: Tighten QLit list vs QList comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Message-Id: <20170825105913.4060-13-marcandre.lureau@redhat.com> [Commit message improved] Signed-off-by: Markus Armbruster --- tests/check-qlit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/check-qlit.c') 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); } -- cgit v1.1