Commit 034244a2 authored by Niels's avatar Niels

Merge branch 'feature/coverage' into develop

parents aa7f5ad8 1e896eb9
...@@ -7734,7 +7734,7 @@ class basic_json ...@@ -7734,7 +7734,7 @@ class basic_json
}; };
if ((m_limit - m_cursor) < 5) if ((m_limit - m_cursor) < 5)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yybm[0 + yych] & 32) if (yybm[0 + yych] & 32)
...@@ -7868,7 +7868,7 @@ basic_json_parser_6: ...@@ -7868,7 +7868,7 @@ basic_json_parser_6:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yybm[0 + yych] & 32) if (yybm[0 + yych] & 32)
...@@ -7938,7 +7938,7 @@ basic_json_parser_15: ...@@ -7938,7 +7938,7 @@ basic_json_parser_15:
m_marker = ++m_cursor; m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3) if ((m_limit - m_cursor) < 3)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yybm[0 + yych] & 64) if (yybm[0 + yych] & 64)
...@@ -8031,7 +8031,7 @@ basic_json_parser_31: ...@@ -8031,7 +8031,7 @@ basic_json_parser_31:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
basic_json_parser_32: basic_json_parser_32:
...@@ -8068,7 +8068,7 @@ basic_json_parser_36: ...@@ -8068,7 +8068,7 @@ basic_json_parser_36:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= 'e') if (yych <= 'e')
...@@ -8212,7 +8212,7 @@ basic_json_parser_43: ...@@ -8212,7 +8212,7 @@ basic_json_parser_43:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= '@') if (yych <= '@')
...@@ -8248,7 +8248,7 @@ basic_json_parser_44: ...@@ -8248,7 +8248,7 @@ basic_json_parser_44:
m_marker = ++m_cursor; m_marker = ++m_cursor;
if ((m_limit - m_cursor) < 3) if ((m_limit - m_cursor) < 3)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= 'D') if (yych <= 'D')
...@@ -8289,7 +8289,7 @@ basic_json_parser_47: ...@@ -8289,7 +8289,7 @@ basic_json_parser_47:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= '/') if (yych <= '/')
...@@ -8331,7 +8331,7 @@ basic_json_parser_54: ...@@ -8331,7 +8331,7 @@ basic_json_parser_54:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= '@') if (yych <= '@')
...@@ -8385,7 +8385,7 @@ basic_json_parser_60: ...@@ -8385,7 +8385,7 @@ basic_json_parser_60:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= '@') if (yych <= '@')
...@@ -8426,7 +8426,7 @@ basic_json_parser_63: ...@@ -8426,7 +8426,7 @@ basic_json_parser_63:
++m_cursor; ++m_cursor;
if (m_limit <= m_cursor) if (m_limit <= m_cursor)
{ {
yyfill(); // LCOV_EXCL_LINE; yyfill();
} }
yych = *m_cursor; yych = *m_cursor;
if (yych <= '@') if (yych <= '@')
......
...@@ -7698,7 +7698,7 @@ class basic_json ...@@ -7698,7 +7698,7 @@ class basic_json
re2c:define:YYCURSOR = m_cursor; re2c:define:YYCURSOR = m_cursor;
re2c:define:YYLIMIT = m_limit; re2c:define:YYLIMIT = m_limit;
re2c:define:YYMARKER = m_marker; re2c:define:YYMARKER = m_marker;
re2c:define:YYFILL = "yyfill(); // LCOV_EXCL_LINE"; re2c:define:YYFILL = "yyfill()";
re2c:yyfill:parameter = 0; re2c:yyfill:parameter = 0;
re2c:indent:string = " "; re2c:indent:string = " ";
re2c:indent:top = 1; re2c:indent:top = 1;
......
...@@ -445,6 +445,10 @@ TEST_CASE("parser class") ...@@ -445,6 +445,10 @@ TEST_CASE("parser class")
CHECK_THROWS_AS(json::parser("\"\\u0\"").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("\"\\u01\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u012\"").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(), CHECK_THROWS_WITH(json::parser("\"").parse(),
"parse error - unexpected '\"'"); "parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\\"").parse(), CHECK_THROWS_WITH(json::parser("\"\\\"").parse(),
...@@ -457,6 +461,14 @@ TEST_CASE("parser class") ...@@ -457,6 +461,14 @@ TEST_CASE("parser class")
"parse error - unexpected '\"'"); "parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u012\"").parse(), CHECK_THROWS_WITH(json::parser("\"\\u012\"").parse(),
"parse error - unexpected '\"'"); "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 // invalid escapes
for (int c = 1; c < 128; ++c) for (int c = 1; c < 128; ++c)
......
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