Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
034244a2
Commit
034244a2
authored
Aug 21, 2016
by
Niels
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/coverage' into develop
parents
aa7f5ad8
1e896eb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
src/json.hpp
src/json.hpp
+11
-11
src/json.hpp.re2c
src/json.hpp.re2c
+1
-1
test/src/unit-class_parser.cpp
test/src/unit-class_parser.cpp
+12
-0
No files found.
src/json.hpp
View file @
034244a2
...
@@ -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
<=
'@'
)
...
...
src/json.hpp.re2c
View file @
034244a2
...
@@ -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;
...
...
test/src/unit-class_parser.cpp
View file @
034244a2
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment