mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
json: Add a positive test for nested objects
Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
parent
0c1dbf5c79
commit
1879beab87
1 changed files with 13 additions and 0 deletions
|
|
@ -162,6 +162,19 @@ START_TEST(object_test) {
|
||||||
fail_unless(pa_json_object_get_bool(v) == true);
|
fail_unless(pa_json_object_get_bool(v) == true);
|
||||||
|
|
||||||
pa_json_object_unref(o);
|
pa_json_object_unref(o);
|
||||||
|
|
||||||
|
o = pa_json_parse("{ \"parent\": { \"child\": false } }");
|
||||||
|
fail_unless(o != NULL);
|
||||||
|
fail_unless(pa_json_object_get_type(o) == PA_JSON_TYPE_OBJECT);
|
||||||
|
|
||||||
|
v = pa_json_object_get_object_member(o, "parent");
|
||||||
|
fail_unless(v != NULL);
|
||||||
|
fail_unless(pa_json_object_get_type(v) == PA_JSON_TYPE_OBJECT);
|
||||||
|
v = pa_json_object_get_object_member(v, "child");
|
||||||
|
fail_unless(pa_json_object_get_type(v) == PA_JSON_TYPE_BOOL);
|
||||||
|
fail_unless(pa_json_object_get_bool(v) == false);
|
||||||
|
|
||||||
|
pa_json_object_unref(o);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue