diff options
Diffstat (limited to 'tests/test-qobject-input-visitor.c')
-rw-r--r-- | tests/test-qobject-input-visitor.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c index 34bab8a913..f98caf9818 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -510,6 +510,7 @@ static void test_visitor_in_null(TestInputVisitorData *data, { Visitor *v; Error *err = NULL; + QNull *null; char *tmp; /* @@ -524,12 +525,15 @@ static void test_visitor_in_null(TestInputVisitorData *data, v = visitor_input_test_init_full(data, false, "{ 'a': null, 'b': '' }"); visit_start_struct(v, NULL, NULL, 0, &error_abort); - visit_type_null(v, "a", &error_abort); - visit_type_null(v, "b", &err); + visit_type_null(v, "a", &null, &error_abort); + g_assert(qobject_type(QOBJECT(null)) == QTYPE_QNULL); + QDECREF(null); + visit_type_null(v, "b", &null, &err); error_free_or_abort(&err); + g_assert(!null); visit_type_str(v, "c", &tmp, &err); - g_assert(!tmp); error_free_or_abort(&err); + g_assert(!tmp); visit_check_struct(v, &error_abort); visit_end_struct(v, NULL); } @@ -1087,6 +1091,7 @@ static void test_visitor_in_fail_struct_missing(TestInputVisitorData *data, Error *err = NULL; Visitor *v; QObject *any; + QNull *null; GenericAlternate *alt; bool present; int en; @@ -1120,7 +1125,7 @@ static void test_visitor_in_fail_struct_missing(TestInputVisitorData *data, error_free_or_abort(&err); visit_type_any(v, "any", &any, &err); error_free_or_abort(&err); - visit_type_null(v, "null", &err); + visit_type_null(v, "null", &null, &err); error_free_or_abort(&err); visit_start_list(v, "sub", NULL, 0, &error_abort); visit_start_struct(v, NULL, NULL, 0, &error_abort); |