From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v3 16/26] test-qobject-input-visitor: Use strict visitor
Date: Tue, 28 Feb 2017 18:39:10 +0100 [thread overview]
Message-ID: <1488303560-18803-17-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1488303560-18803-1-git-send-email-armbru@redhat.com>
The qobject input visitor comes in a strict and a non-strict variant.
This test is the non-strict variant's last user. Turns out it relies
on non-strict only in test_visitor_in_null(), and just out of
laziness. We don't actually test the non-strict behavior.
Clean up test_visitor_in_null(), and switch to the strict variant.
The next commit will drop the non-strict variant.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
tests/test-qobject-input-visitor.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c
index 945404a..125e34c 100644
--- a/tests/test-qobject-input-visitor.c
+++ b/tests/test-qobject-input-visitor.c
@@ -49,7 +49,7 @@ static Visitor *visitor_input_test_init_internal(TestInputVisitorData *data,
data->obj = qobject_from_jsonv(json_string, ap);
g_assert(data->obj);
- data->qiv = qobject_input_visitor_new(data->obj, false);
+ data->qiv = qobject_input_visitor_new(data->obj, true);
g_assert(data->qiv);
return data->qiv;
}
@@ -290,14 +290,14 @@ static void test_visitor_in_null(TestInputVisitorData *data,
* when input is not null.
*/
- v = visitor_input_test_init(data, "{ 'a': null, 'b': '' }");
+ v = visitor_input_test_init(data, "{ 'a': null, 'b': '', 'c': null }");
visit_start_struct(v, NULL, NULL, 0, &error_abort);
visit_type_null(v, "a", &error_abort);
- visit_type_str(v, "a", &tmp, &err);
- g_assert(!tmp);
- error_free_or_abort(&err);
visit_type_null(v, "b", &err);
error_free_or_abort(&err);
+ visit_type_str(v, "c", &tmp, &err);
+ g_assert(!tmp);
+ error_free_or_abort(&err);
visit_check_struct(v, &error_abort);
visit_end_struct(v, NULL);
}
--
2.7.4
next prev parent reply other threads:[~2017-02-28 17:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 17:38 [Qemu-devel] [PATCH v3 00/26] qapi: QMP dispatch and input visitor work Markus Armbruster
2017-02-28 17:38 ` [Qemu-devel] [PATCH v3 01/26] qga: Fix crash on non-dictionary QMP argument Markus Armbruster
2017-02-28 17:38 ` [Qemu-devel] [PATCH v3 02/26] libqtest: Work around a "QMP wants a newline" bug Markus Armbruster
2017-02-28 17:38 ` [Qemu-devel] [PATCH v3 03/26] qmp-test: New, covering basic QMP protocol Markus Armbruster
2017-02-28 17:38 ` [Qemu-devel] [PATCH v3 04/26] qmp: Dumb down how we run QMP command registration Markus Armbruster
2017-02-28 17:38 ` [Qemu-devel] [PATCH v3 05/26] qmp: Clean up how we enforce capability negotiation Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 06/26] qmp: Drop duplicated QMP command object checks Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 07/26] qmp: Eliminate silly QERR_QMP_* macros Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 08/26] qmp: Improve QMP dispatch error messages Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 09/26] qapi: Improve a QObject input visitor error message Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 10/26] qapi: Clean up after commit 3d344c2 Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 11/26] qapi: Make QObject input visitor set *list reliably Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 12/26] qapi: Improve qobject input visitor error reporting Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 13/26] qapi: Drop string input visitor method optional() Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 14/26] qapi: Make string input and opts visitor require non-null input Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 15/26] qom: Make object_property_set_qobject()'s input visitor strict Markus Armbruster
2017-02-28 17:39 ` Markus Armbruster [this message]
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 17/26] qapi: Drop unused non-strict qobject input visitor Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 18/26] tests-qobject-input-strict: Merge into test-qobject-input-visitor Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 19/26] test-string-input-visitor: Tear down existing test automatically Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 20/26] test-string-input-visitor: Improve list coverage Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 21/26] tests: Cover partial input visit of list Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 22/26] test-qobject-input-visitor: Cover missing nested struct member Markus Armbruster
2017-02-28 18:34 ` Eric Blake
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 23/26] qapi: Make input visitors detect unvisited list tails Markus Armbruster
2017-02-28 18:38 ` Eric Blake
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 24/26] tests: Cover input visit beyond end of list Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 25/26] qapi: Fix object " Markus Armbruster
2017-02-28 17:39 ` [Qemu-devel] [PATCH v3 26/26] qapi: Improve qobject visitor documentation Markus Armbruster
2017-02-28 18:03 ` [Qemu-devel] [PATCH v3 00/26] qapi: QMP dispatch and input visitor work no-reply
2017-02-28 18:40 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488303560-18803-17-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).