mirror of
https://github.com/json-c/json-c.git
synced 2026-03-28 17:39:07 +08:00
Add a json_object_from_fd_ex() function, to allow the max nesting depth to be specified.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
OK: json_object_from_fd(./valid.json)={ "foo": 123 }
|
||||
OK: json_object_from_fd(valid.json)={ "foo": 123 }
|
||||
OK: json_object_from_fd_ex(valid_nested.json, 20)={ "foo": 123, "obj2": { "obj3": { "obj4": { "foo": 999 } } } }
|
||||
OK: correctly unable to parse contents of valid_nested.json with low max depth: json_tokener_parse_ex failed: nesting too deep
|
||||
|
||||
OK: json_object_from_file(./not_present.json) correctly returned NULL: json_object_from_file: error opening file ./not_present.json: ERRNO=ENOENT
|
||||
|
||||
OK: json_object_from_fd(closed_fd), expecting NULL, EBADF, got:NULL, json_object_from_fd: error reading fd 10: ERRNO=EBADF
|
||||
|
||||
Reference in New Issue
Block a user