[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 16/26] test-qobject-input-visitor: Use strict vis
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 16/26] test-qobject-input-visitor: Use strict visitor |
Date: |
Sun, 26 Feb 2017 22:43:34 +0100 |
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 <address@hidden>
---
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
- Re: [Qemu-devel] [PATCH v2 12/26] qapi: Improve qobject input visitor error reporting, (continued)
- [Qemu-devel] [PATCH v2 23/26] qapi: Make input visitors detect unvisited list tails, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 18/26] tests-qobject-input-strict: Merge into test-qobject-input-visitor, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 25/26] qapi: Fix object input visit beyond end of list, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 06/26] qmp: Drop duplicated QMP command object checks, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 26/26] qapi: Improve qobject visitor documentation, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 16/26] test-qobject-input-visitor: Use strict visitor,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 09/26] qapi: Improve a QObject input visitor error message, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 05/26] qmp: Clean up how we enforce capability negotiation, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 15/26] qom: Make object_property_set_qobject()'s input visitor strict, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 14/26] qapi: Make string input and opts visitor require non-null input, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 03/26] qmp-test: New, covering basic QMP protocol, Markus Armbruster, 2017/02/26
- [Qemu-devel] [PATCH v2 07/26] qmp: Eliminate silly QERR_QMP_* macros, Markus Armbruster, 2017/02/26