1
0
mirror of https://github.com/nlohmann/json synced 2024-11-27 06:10:06 +00:00

overworked coverage

This commit is contained in:
Niels 2015-05-09 14:54:33 +02:00
parent bb142d6cae
commit 1f381d496d
3 changed files with 23 additions and 38 deletions

View File

@ -3666,8 +3666,8 @@ class basic_json
if ((m_limit - m_cursor) < 5)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '9')
{
@ -3801,8 +3801,8 @@ basic_json_parser_4:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
basic_json_parser_5:
if (yybm[0 + yych] & 32)
@ -3946,8 +3946,8 @@ basic_json_parser_30:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
basic_json_parser_31:
if (yybm[0 + yych] & 64)
@ -3977,8 +3977,8 @@ basic_json_parser_33:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= 'e')
{
@ -4061,8 +4061,8 @@ basic_json_parser_36:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '@')
{
@ -4094,8 +4094,8 @@ basic_json_parser_37:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '@')
{
@ -4127,8 +4127,8 @@ basic_json_parser_38:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '@')
{
@ -4160,8 +4160,8 @@ basic_json_parser_39:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '@')
{
@ -4196,8 +4196,8 @@ basic_json_parser_40:
m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
basic_json_parser_41:
if (yybm[0 + yych] & 128)
@ -4273,8 +4273,8 @@ basic_json_parser_45:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= '/')
{
@ -4290,8 +4290,8 @@ basic_json_parser_47:
m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3)
{
yyfill();
};
yyfill(); // LCOV_EXCL_LINE;
}
yych = *m_cursor;
if (yych <= 'D')
{

View File

@ -3629,7 +3629,7 @@ class basic_json
re2c:define:YYCURSOR = m_cursor;
re2c:define:YYLIMIT = m_limit;
re2c:define:YYMARKER = m_marker;
re2c:define:YYFILL = "{ yyfill(); }";
re2c:define:YYFILL = "yyfill(); // LCOV_EXCL_LINE";
re2c:yyfill:parameter = 0;
re2c:indent:string = " ";
re2c:indent:top = 1;

View File

@ -7405,21 +7405,6 @@ TEST_CASE("parser class")
// horizontal tab
CHECK(json::parser("\"\\t\"").parse() == json("\t"));
// exotic test cases for full coverage
{
// that one got illegal
//{
// std::stringstream ss;
// ss << "\"\\u000\n1\"";
// CHECK(json::parser(ss).parse().get<json::string_t>() == "\x01");
//}
//{
// std::stringstream ss;
// ss << "\"\\u00\n01\"";
// CHECK(json::parser(ss).parse().get<json::string_t>() == "\x01");
//}
}
CHECK(json::parser("\"\\u0001\"").parse().get<json::string_t>() == "\x01");
CHECK(json::parser("\"\\u000a\"").parse().get<json::string_t>() == "\n");
CHECK(json::parser("\"\\u00b0\"").parse().get<json::string_t>() == "°");