162 |
|
|
163 |
assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED); |
assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED); |
164 |
|
|
165 |
/* malformed */ |
/* malformed US-ASCII */ |
166 |
uint8_t malformed_ascii[] = { |
uint8_t malformed_ascii[] = { |
167 |
'e', |
'e', |
168 |
0xe8, |
0xe8, |
174 |
|
|
175 |
assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE); |
assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE); |
176 |
|
|
177 |
|
/* malformed UTF-8 */ |
178 |
|
uint8_t malformed_utf8[] = { |
179 |
|
'e', |
180 |
|
0xe8, |
181 |
|
0xe9, |
182 |
|
0xea, |
183 |
|
}; |
184 |
|
|
185 |
|
result = jscoverage_bytes_to_characters("UTF-8", malformed_utf8, 4, &characters, &num_characters); |
186 |
|
|
187 |
|
assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE); |
188 |
|
|
189 |
return 0; |
return 0; |
190 |
} |
} |