added JSON Test Suite by Nicolas Seriot

pull/126/head
Benedikt Tröster 5 years ago
parent c5bb9557fe
commit 92d4d0d3a1
  1. 381
      tests.c
  2. 1
      tests/JSONTestSuite

@ -38,6 +38,18 @@
else{puts(" FAIL");tests_failed++;} else{puts(" FAIL");tests_failed++;}
#define STREQ(A, B) ((A) && (B) ? strcmp((A), (B)) == 0 : 0) #define STREQ(A, B) ((A) && (B) ? strcmp((A), (B)) == 0 : 0)
#define EPSILON 0.000001 #define EPSILON 0.000001
#define COMPARESERIALIZATION(A) f = fopen(A, "rb");\
fseek(f, 0, SEEK_END);\
fsize = ftell(f);\
fseek(f, 0, SEEK_SET);\
source = malloc(fsize + 1);\
fread(source, 1, fsize, f);\
fclose(f);\
val = json_parse_string(source);\
serial = json_serialize_to_string(val);\
TEST(source != NULL && serial != NULL && strcmp(source, serial)==0);\
free(source);\
json_value_free(val);\
void test_suite_1(void); /* Test 3 files from json.org + serialization*/ void test_suite_1(void); /* Test 3 files from json.org + serialization*/
void test_suite_2(JSON_Value *value); /* Test correctness of parsed values */ void test_suite_2(JSON_Value *value); /* Test correctness of parsed values */
@ -52,6 +64,7 @@ void test_suite_8(void); /* Test serialization */
void test_suite_9(void); /* Test serialization (pretty) */ void test_suite_9(void); /* Test serialization (pretty) */
void test_suite_10(void); /* Testing for memory leaks */ void test_suite_10(void); /* Testing for memory leaks */
void test_suite_11(void); /* Additional things that require testing */ void test_suite_11(void); /* Additional things that require testing */
void test_suite_minefield(void); /* Testing for minefield test suite strings */
void print_commits_info(const char *username, const char *repo); void print_commits_info(const char *username, const char *repo);
void persistence_example(void); void persistence_example(void);
@ -84,6 +97,7 @@ int main() {
test_suite_9(); test_suite_9();
test_suite_10(); test_suite_10();
test_suite_11(); test_suite_11();
test_suite_minefield();
printf("Tests failed: %d\n", tests_failed); printf("Tests failed: %d\n", tests_failed);
printf("Tests passed: %d\n", tests_passed); printf("Tests passed: %d\n", tests_passed);
@ -561,6 +575,373 @@ void test_suite_11() {
TEST(STREQ(array_with_escaped_slashes, serialized)); TEST(STREQ(array_with_escaped_slashes, serialized));
} }
/* test suite based on https://github.com/nst/JSONTestSuite referenced in http://seriot.ch/parsing_json.php by Nicolas Seriot */
void test_suite_minefield(void){
JSON_Value *val;
char* serial;
char* source;
FILE *f;
long fsize;
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/number_1.000000000000000005.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/number_1000000000000000.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/number_10000000000000000999.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/number_1e-999.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/number_1e6.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/object_key_nfc_nfd.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/object_key_nfd_nfc.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/object_same_key_different_values.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/object_same_key_same_value.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/object_same_key_unclear_values.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_1_escaped_invalid_codepoint.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_1_invalid_codepoint.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_2_escaped_invalid_codepoints.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_2_invalid_codepoints.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_3_escaped_invalid_codepoints.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_3_invalid_codepoints.json");
COMPARESERIALIZATION("tests/JSONTestSuite/test_transform/string_with_escaped_NULL.json");
/* non-acceptance */
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_1_true_without_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_a_invalid_utf8.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_colon_instead_of_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_comma_after_close.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_comma_and_number.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_double_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_double_extra_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_extra_close.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_extra_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_incomplete.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_incomplete_invalid_value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_inner_array_no_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_invalid_utf8.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_items_separated_by_semicolon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_just_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_just_minus.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_missing_value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_newlines_unclosed.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_number_and_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_number_and_several_commas.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_spaces_vertical_tab_formfeed.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_star_inside.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_unclosed.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_unclosed_trailing_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_unclosed_with_new_lines.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_array_unclosed_with_object_inside.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_incomplete_false.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_incomplete_null.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_incomplete_true.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_multidigit_number_then_00.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_++.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_+1.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_+Inf.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_-01.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_-1.0..json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_-2..json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_-NaN.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_.-1.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_.2e-3.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0.1.2.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0.3e+.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0.3e.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0.e1.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0e+.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0e.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0_capital_E+.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_0_capital_E.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_1.0e+.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_1.0e-.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_1.0e.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_1eE2.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_1_000.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_2.e+3.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_2.e-3.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_2.e3.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_9.e+.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_expression.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_hex_1_digit.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_hex_2_digits.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_Inf.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_infinity.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_invalid+-.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_invalid-negative-real.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_invalid-utf-8-in-bigger-int.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_invalid-utf-8-in-exponent.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_invalid-utf-8-in-int.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_minus_infinity.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_minus_sign_with_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_minus_space_1.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_NaN.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_neg_int_starting_with_zero.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_neg_real_without_int_part.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_neg_with_garbage_at_end.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_real_garbage_after_e.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_real_without_fractional_part.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_real_with_invalid_utf8_after_e.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_starting_with_dot.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_U+FF11_fullwidth_digit_one.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_with_alpha.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_with_alpha_char.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_number_with_leading_zero.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_bad_value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_bracket_key.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_comma_instead_of_colon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_double_colon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_emoji.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_garbage_at_end.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_key_with_single_quotes.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_lone_continuation_byte_in_key_and_trailing_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_missing_colon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_missing_key.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_missing_semicolon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_missing_value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_no-colon.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_non_string_key.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_non_string_key_but_huge_number_instead.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_repeated_null_null.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_several_trailing_commas.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_single_quote.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_trailing_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_trailing_comment.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_trailing_comment_open.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_trailing_comment_slash_open.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_trailing_comment_slash_open_incomplete.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_two_commas_in_a_row.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_unquoted_key.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_unterminated-value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_with_single_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_object_with_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_single_space.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_1_surrogate_then_escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_1_surrogate_then_escape_u.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_1_surrogate_then_escape_u1.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_1_surrogate_then_escape_u1x.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_accentuated_char_no_quotes.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_backslash_00.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_escaped_backslash_bad.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_escaped_ctrl_char_tab.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_escaped_emoji.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_escape_x.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_incomplete_escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_incomplete_escaped_character.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_incomplete_surrogate.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_incomplete_surrogate_escape_invalid.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_invalid-utf-8-in-escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_invalid_backslash_esc.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_invalid_unicode_escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_invalid_utf8_after_escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_leading_uescaped_thinspace.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_no_quotes_with_bad_escape.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_single_doublequote.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_single_quote.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_single_string_no_double_quotes.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_start_escape_unclosed.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_unescaped_crtl_char.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_unescaped_newline.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_unescaped_tab.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_unicode_CapitalU.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_string_with_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_100000_opening_arrays.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_angle_bracket_..json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_angle_bracket_null.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_array_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_array_with_extra_array_close.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_array_with_unclosed_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_ascii-unicode-identifier.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_capitalized_True.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_close_unopened_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_comma_instead_of_closing_brace.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_double_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_end_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_incomplete_UTF8_BOM.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_lone-invalid-utf-8.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_lone-open-bracket.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_no_data.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_null-byte-outside-string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_number_with_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_object_followed_by_closing_object.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_object_unclosed_no_value.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_object_with_comment.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_object_with_trailing_garbage.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_apostrophe.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_object.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_open_object.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_open_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_array_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object_close_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object_comma.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object_open_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object_open_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_object_string_with_apostrophes.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_open_open.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_single_eacute.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_single_star.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_trailing_#.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_U+2060_word_joined.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_uescaped_LF_before_string.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unclosed_array.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unclosed_array_partial_null.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unclosed_array_unfinished_false.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unclosed_array_unfinished_true.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unclosed_object.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_unicode-identifier.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_UTF8_BOM_no_data.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_whitespace_formfeed.json") == NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/n_structure_whitespace_U+2060_word_joiner.json") == NULL);
/* acceptance: */
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_arraysWithSpaces.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_empty-string.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_empty.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_ending_with_newline.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_false.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_heterogeneous.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_null.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_with_1_and_newline.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_with_leading_space.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_with_several_null.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_array_with_trailing_space.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_0e+1.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_0e1.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_after_space.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_double_close_to_zero.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_int_with_exp.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_minus_zero.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_negative_int.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_negative_one.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_negative_zero.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_capital_e.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_capital_e_neg_exp.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_capital_e_pos_exp.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_exponent.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_fraction_exponent.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_neg_exp.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_real_pos_exponent.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_simple_int.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_number_simple_real.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_basic.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_duplicated_key.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_duplicated_key_and_value.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_empty.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_empty_key.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_escaped_null_in_key.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_extreme_numbers.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_long_strings.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_simple.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_string_unicode.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_object_with_newlines.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_accepted_surrogate_pair.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_accepted_surrogate_pairs.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_allowed_escapes.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_backslash_and_u_escaped_zero.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_backslash_doublequotes.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_comments.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_double_escape_a.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_double_escape_n.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_escaped_control_character.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_escaped_noncharacter.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_in_array.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_in_array_with_leading_space.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_last_surrogates_1_and_2.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_nbsp_uescaped.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_nonCharacterInUTF-8_U+10FFFF.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_nonCharacterInUTF-8_U+FFFF.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_null_escape.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_one-byte-utf-8.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_pi.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_reservedCharacterInUTF-8_U+1BFFF.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_simple_ascii.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_space.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_three-byte-utf-8.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_two-byte-utf-8.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_u+2028_line_sep.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_u+2029_par_sep.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_uEscape.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_uescaped_newline.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unescaped_char_delete.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicodeEscapedBackslash.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_2.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_escaped_double_quote.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+10FFFE_nonchar.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+1FFFE_nonchar.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+2064_invisible_plus.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+FDD0_nonchar.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_unicode_U+FFFE_nonchar.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_utf8.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_string_with_del_character.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_false.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_int.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_negative_real.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_null.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_string.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_lonely_true.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_string_empty.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_trailing_newline.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_true_in_array.json") != NULL);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/y_structure_whitespace_array.json") != NULL);
/* undefined */
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_double_huge_neg_exp.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_huge_exp.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_neg_int_huge_exp.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_pos_double_huge_exp.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_real_neg_overflow.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_real_pos_overflow.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_real_underflow.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_too_big_neg_int.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_too_big_pos_int.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_number_very_big_negative_int.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_object_key_lone_2nd_surrogate.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_1st_surrogate_but_2nd_missing.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_1st_valid_surrogate_2nd_invalid.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_incomplete_surrogates_escape_valid.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_incomplete_surrogate_and_escape_valid.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_incomplete_surrogate_pair.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_invalid_lonely_surrogate.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_invalid_surrogate.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_invalid_utf-8.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_inverted_surrogates_U+1D11E.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_iso_latin_1.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_lone_second_surrogate.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_lone_utf8_continuation_byte.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_not_in_unicode_range.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_overlong_sequence_2_bytes.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_overlong_sequence_6_bytes.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_overlong_sequence_6_bytes_null.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_truncated-utf-8.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_UTF-16LE_with_BOM.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_UTF-8_invalid_sequence.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_utf16BE_no_BOM.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_utf16LE_no_BOM.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_string_UTF8_surrogate_U+D800.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_structure_500_nested_arrays.json") || 1);
TEST(json_parse_file("tests/JSONTestSuite/test_parsing/i_structure_UTF-8_BOM_empty_object.json") || 1);
}
void print_commits_info(const char *username, const char *repo) { void print_commits_info(const char *username, const char *repo) {
JSON_Value *root_value; JSON_Value *root_value;
JSON_Array *commits; JSON_Array *commits;

@ -0,0 +1 @@
Subproject commit e3d9a17a256080e408f9e40bb0cd65fdd88776ab
Loading…
Cancel
Save