Skip to content

Commit

Permalink
test-qobject-input-visitor: Use strict visitor
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
Markus Armbruster committed Mar 5, 2017
1 parent 05601ed commit ec95f61
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test-qobject-input-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ec95f61

Please sign in to comment.