Fix json_object_get_boolean() doc for the object and array cases (always returns 0), and add those cases to the test_cast test.

See also issue #658.
This commit is contained in:
Eric Haszlakiewicz
2020-08-17 14:55:54 +00:00
parent cf30cba4ac
commit 2b439ea598
3 changed files with 48 additions and 2 deletions

View File

@@ -28,6 +28,11 @@ int main(int argc, char **argv)
\"int64_number\": 2147483649,\n\
\"negative_number\": -321321321,\n\
\"a_null\": null,\n\
\"empty_array\": [],\n\
\"nonempty_array\": [ 123 ],\n\
\"array_with_zero\": [ 0 ],\n\
\"empty_object\": {},\n\
\"nonempty_object\": { \"a\": 123 },\n\
}";
/* Note: 2147483649 = INT_MAX + 2 */
/* Note: 9223372036854775809 = INT64_MAX + 2 */
@@ -49,6 +54,11 @@ int main(int argc, char **argv)
getit(new_obj, "int64_number");
getit(new_obj, "negative_number");
getit(new_obj, "a_null");
getit(new_obj, "empty_array");
getit(new_obj, "nonempty_array");
getit(new_obj, "array_with_zero");
getit(new_obj, "empty_object");
getit(new_obj, "nonempty_object");
// Now check the behaviour of the json_object_is_type() function.
printf("\n================================\n");