Merge branch 'feature/coverage' into develop

This commit is contained in:
Niels 2016-08-21 22:48:02 +02:00
commit 034244a291
3 changed files with 24 additions and 12 deletions

View file

@ -7734,7 +7734,7 @@ class basic_json
};
if ((m_limit - m_cursor) < 5)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yybm[0 + yych] & 32)
@ -7868,7 +7868,7 @@ basic_json_parser_6:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yybm[0 + yych] & 32)
@ -7938,7 +7938,7 @@ basic_json_parser_15:
m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yybm[0 + yych] & 64)
@ -8031,7 +8031,7 @@ basic_json_parser_31:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
basic_json_parser_32:
@ -8068,7 +8068,7 @@ basic_json_parser_36:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= 'e')
@ -8212,7 +8212,7 @@ basic_json_parser_43:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= '@')
@ -8248,7 +8248,7 @@ basic_json_parser_44:
m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= 'D')
@ -8289,7 +8289,7 @@ basic_json_parser_47:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= '/')
@ -8331,7 +8331,7 @@ basic_json_parser_54:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= '@')
@ -8385,7 +8385,7 @@ basic_json_parser_60:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= '@')
@ -8426,7 +8426,7 @@ basic_json_parser_63:
++m_cursor;
if (m_limit <= m_cursor)
{
yyfill(); // LCOV_EXCL_LINE;
yyfill();
}
yych = *m_cursor;
if (yych <= '@')

View file

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

View file

@ -445,6 +445,10 @@ TEST_CASE("parser class")
CHECK_THROWS_AS(json::parser("\"\\u0\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u01\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u012\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u0").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u01").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u012").parse(), std::invalid_argument);
CHECK_THROWS_WITH(json::parser("\"").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\\"").parse(),
@ -457,6 +461,14 @@ TEST_CASE("parser class")
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u012\"").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u0").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u01").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u012").parse(),
"parse error - unexpected '\"'");
// invalid escapes
for (int c = 1; c < 128; ++c)