| 82 | } |
| 83 | |
| 84 | static int test_invalid_surrogate_input(void) |
| 85 | { |
| 86 | ACL_JSON *json = acl_json_alloc(); |
| 87 | const char *data = |
| 88 | "{\"high_only\":\"\\uD83D!\"," |
| 89 | "\"high_bad_low\":\"\\uD83D\\u0041\"," |
| 90 | "\"high_bad_u\":\"\\uD83D\\x\"}"; |
| 91 | const char *expect_high_only = UTF8_REPLACEMENT "!"; |
| 92 | const char *expect_high_bad_low = UTF8_REPLACEMENT "A"; |
| 93 | const char *expect_high_bad_u = UTF8_REPLACEMENT "x"; |
| 94 | int ok; |
| 95 | |
| 96 | acl_json_update(json, data); |
| 97 | ok = acl_json_finish(json) |
| 98 | && check_tag_value(json, "high_only", expect_high_only) |
| 99 | && check_tag_value(json, "high_bad_low", expect_high_bad_low) |
| 100 | && check_tag_value(json, "high_bad_u", expect_high_bad_u); |
| 101 | |
| 102 | acl_json_free(json); |
| 103 | return ok; |
| 104 | } |
| 105 | |
| 106 | int main(void) |
| 107 | { |
no test coverage detected
searching dependent graphs…