💚 added tests #1198

Test every prefix of Unicode sequences against the different dump functions.
parent c5821d91
...@@ -442,6 +442,7 @@ class serializer ...@@ -442,6 +442,7 @@ class serializer
string_buffer[bytes++] = 'f'; string_buffer[bytes++] = 'f';
string_buffer[bytes++] = 'f'; string_buffer[bytes++] = 'f';
string_buffer[bytes++] = 'd'; string_buffer[bytes++] = 'd';
bytes_after_last_accept = bytes;
} }
// continue processing the string // continue processing the string
......
...@@ -10394,6 +10394,7 @@ class serializer ...@@ -10394,6 +10394,7 @@ class serializer
string_buffer[bytes++] = 'f'; string_buffer[bytes++] = 'f';
string_buffer[bytes++] = 'f'; string_buffer[bytes++] = 'f';
string_buffer[bytes++] = 'd'; string_buffer[bytes++] = 'd';
bytes_after_last_accept = bytes;
} }
// continue processing the string // continue processing the string
......
...@@ -39,6 +39,79 @@ using nlohmann::json; ...@@ -39,6 +39,79 @@ using nlohmann::json;
extern size_t calls; extern size_t calls;
size_t calls = 0; size_t calls = 0;
void check_utf8dump(bool success_expected, int byte1, int byte2, int byte3, int byte4);
void check_utf8dump(bool success_expected, int byte1, int byte2 = -1, int byte3 = -1, int byte4 = -1)
{
std::string json_string;
CAPTURE(byte1);
CAPTURE(byte2);
CAPTURE(byte3);
CAPTURE(byte4);
json_string += std::string(1, static_cast<char>(byte1));
if (byte2 != -1)
{
json_string += std::string(1, static_cast<char>(byte2));
}
if (byte3 != -1)
{
json_string += std::string(1, static_cast<char>(byte3));
}
if (byte4 != -1)
{
json_string += std::string(1, static_cast<char>(byte4));
}
CAPTURE(json_string);
// store the string in a JSON value
json j = json_string;
json j2 = "abc" + json_string + "xyz";
// dumping with ignore/replace must not throw in any case
auto s_ignored = j.dump(-1, ' ', false, json::error_handler_t::ignore);
auto s_ignored2 = j2.dump(-1, ' ', false, json::error_handler_t::ignore);
auto s_replaced = j.dump(-1, ' ', false, json::error_handler_t::replace);
auto s_replaced2 = j2.dump(-1, ' ', false, json::error_handler_t::replace);
if (success_expected)
{
// strict mode must not throw if success is expected
auto s_strict = j.dump();
// all dumps should agree on the string
CHECK(s_strict == s_ignored);
CHECK(s_strict == s_replaced);
// check that ignore/replace string does not contain a replacement character
CHECK(s_ignored.find("\\ufffd") == std::string::npos);
CHECK(s_replaced.find("\\ufffd") == std::string::npos);
}
else
{
// strict mode must throw if success is not expected
CHECK_THROWS_AS(j.dump(), json::type_error&);
// ignore and replace must create different dumps
CHECK(s_ignored != s_replaced);
// check that ignore string does not contain a replacement character
CHECK(s_ignored.find("\\ufffd") == std::string::npos);
// check that replace string contains a replacement character
CHECK(s_replaced.find("\\ufffd") != std::string::npos);
}
// check that prefix and suffix are preserved
CHECK(s_ignored2.substr(1, 3) == "abc");
CHECK(s_ignored2.substr(s_ignored2.size() - 4, 3) == "xyz");
CHECK(s_replaced2.substr(1, 3) == "abc");
CHECK(s_replaced2.substr(s_replaced2.size() - 4, 3) == "xyz");
}
void check_utf8string(bool success_expected, int byte1, int byte2, int byte3, int byte4); void check_utf8string(bool success_expected, int byte1, int byte2, int byte3, int byte4);
// create and check a JSON string with up to four UTF-8 bytes // create and check a JSON string with up to four UTF-8 bytes
...@@ -115,11 +188,13 @@ TEST_CASE("Unicode", "[hide]") ...@@ -115,11 +188,13 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0x80; byte1 <= 0xC1; ++byte1) for (int byte1 = 0x80; byte1 <= 0xC1; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
for (int byte1 = 0xF5; byte1 <= 0xFF; ++byte1) for (int byte1 = 0xF5; byte1 <= 0xFF; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -152,6 +227,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -152,6 +227,7 @@ TEST_CASE("Unicode", "[hide]")
// all other characters are OK // all other characters are OK
check_utf8string(true, byte1); check_utf8string(true, byte1);
check_utf8dump(true, byte1);
} }
} }
} }
...@@ -165,6 +241,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -165,6 +241,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2) for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(true, byte1, byte2); check_utf8string(true, byte1, byte2);
check_utf8dump(true, byte1, byte2);
} }
} }
} }
...@@ -174,6 +251,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -174,6 +251,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xC2; byte1 <= 0xDF; ++byte1) for (int byte1 = 0xC2; byte1 <= 0xDF; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -190,6 +268,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -190,6 +268,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -206,6 +285,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -206,6 +285,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(true, byte1, byte2, byte3); check_utf8string(true, byte1, byte2, byte3);
check_utf8dump(true, byte1, byte2, byte3);
} }
} }
} }
...@@ -216,6 +296,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -216,6 +296,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1) for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -226,6 +307,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -226,6 +307,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0xA0; byte2 <= 0xBF; ++byte2) for (int byte2 = 0xA0; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -245,6 +327,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -245,6 +327,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -265,6 +348,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -265,6 +348,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -282,6 +366,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -282,6 +366,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(true, byte1, byte2, byte3); check_utf8string(true, byte1, byte2, byte3);
check_utf8dump(true, byte1, byte2, byte3);
} }
} }
} }
...@@ -292,6 +377,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -292,6 +377,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1) for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -302,6 +388,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -302,6 +388,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2) for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -321,6 +408,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -321,6 +408,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -341,6 +429,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -341,6 +429,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -358,6 +447,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -358,6 +447,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(true, byte1, byte2, byte3); check_utf8string(true, byte1, byte2, byte3);
check_utf8dump(true, byte1, byte2, byte3);
} }
} }
} }
...@@ -368,6 +458,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -368,6 +458,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xED; byte1 <= 0xED; ++byte1) for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -378,6 +469,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -378,6 +469,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0x9F; ++byte2) for (int byte2 = 0x80; byte2 <= 0x9F; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -397,6 +489,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -397,6 +489,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -417,6 +510,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -417,6 +510,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -434,6 +528,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -434,6 +528,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(true, byte1, byte2, byte3); check_utf8string(true, byte1, byte2, byte3);
check_utf8dump(true, byte1, byte2, byte3);
} }
} }
} }
...@@ -444,6 +539,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -444,6 +539,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1) for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -454,6 +550,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -454,6 +550,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2) for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -473,6 +570,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -473,6 +570,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -493,6 +591,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -493,6 +591,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -512,6 +611,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -512,6 +611,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(true, byte1, byte2, byte3, byte4); check_utf8string(true, byte1, byte2, byte3, byte4);
check_utf8dump(true, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -523,6 +623,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -523,6 +623,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1) for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -533,6 +634,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -533,6 +634,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2) for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -546,6 +648,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -546,6 +648,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -568,6 +671,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -568,6 +671,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -591,6 +695,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -591,6 +695,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -614,6 +719,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -614,6 +719,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -634,6 +740,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -634,6 +740,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(true, byte1, byte2, byte3, byte4); check_utf8string(true, byte1, byte2, byte3, byte4);
check_utf8dump(true, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -645,6 +752,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -645,6 +752,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1) for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -655,6 +763,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -655,6 +763,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2) for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -668,6 +777,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -668,6 +777,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -690,6 +800,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -690,6 +800,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -713,6 +824,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -713,6 +824,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -736,6 +848,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -736,6 +848,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -756,6 +869,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -756,6 +869,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(true, byte1, byte2, byte3, byte4); check_utf8string(true, byte1, byte2, byte3, byte4);
check_utf8dump(true, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -767,6 +881,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -767,6 +881,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1) for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
{ {
check_utf8string(false, byte1); check_utf8string(false, byte1);
check_utf8dump(false, byte1);
} }
} }
...@@ -777,6 +892,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -777,6 +892,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2) for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
{ {
check_utf8string(false, byte1, byte2); check_utf8string(false, byte1, byte2);
check_utf8dump(false, byte1, byte2);
} }
} }
} }
...@@ -790,6 +906,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -790,6 +906,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3) for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
{ {
check_utf8string(false, byte1, byte2, byte3); check_utf8string(false, byte1, byte2, byte3);
check_utf8dump(false, byte1, byte2, byte3);
} }
} }
} }
...@@ -812,6 +929,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -812,6 +929,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -835,6 +953,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -835,6 +953,7 @@ TEST_CASE("Unicode", "[hide]")
for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4) for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
{ {
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
...@@ -858,6 +977,7 @@ TEST_CASE("Unicode", "[hide]") ...@@ -858,6 +977,7 @@ TEST_CASE("Unicode", "[hide]")
} }
check_utf8string(false, byte1, byte2, byte3, byte4); check_utf8string(false, byte1, byte2, byte3, byte4);
check_utf8dump(false, byte1, byte2, byte3, byte4);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment