| 102 | } |
| 103 | |
| 104 | static bool decode_bad(test_utf8_char s) |
| 105 | { |
| 106 | unsigned int uc = 0xFFFFu; |
| 107 | char const* e = cm_utf8_decode_character(s.data(), s.data() + s.size(), &uc); |
| 108 | if (e) { |
| 109 | report_bad(false, s); |
| 110 | printf("expected failure, got 0x%04X\n", uc); |
| 111 | return false; |
| 112 | } |
| 113 | report_bad(true, s); |
| 114 | printf("failed as expected\n"); |
| 115 | return true; |
| 116 | } |
| 117 | |
| 118 | static void report_valid(bool passed, test_utf8_char s) |
| 119 | { |
no test coverage detected
searching dependent graphs…