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
dc8ab925
Commit
dc8ab925
authored
Dec 25, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests for exceptions (#160)
parent
76e5e29e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
232 additions
and
93 deletions
+232
-93
src/json.hpp
src/json.hpp
+3
-3
src/json.hpp.re2c
src/json.hpp.re2c
+3
-3
test/unit.cpp
test/unit.cpp
+226
-87
No files found.
src/json.hpp
View file @
dc8ab925
...
...
@@ -6371,7 +6371,8 @@ class basic_json
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@throw std::out_of_range if code point is >0x10ffff
@throw std::out_of_range if code point is >0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
@throw std::invalid_argument if the low surrogate is invalid
@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
...
...
@@ -7765,8 +7766,7 @@ basic_json_parser_64:
{
std
::
string
error_msg
=
"parse error - unexpected
\'
"
;
error_msg
+=
m_lexer
.
get_token
();
error_msg
+=
"
\'
("
;
error_msg
+=
lexer
::
token_type_name
(
last_token
)
+
")"
;
error_msg
+=
"
\'
"
;
throw
std
::
invalid_argument
(
error_msg
);
}
}
...
...
src/json.hpp.re2c
View file @
dc8ab925
...
...
@@ -6371,7 +6371,8 @@ class basic_json
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@throw std::out_of_range if code point is >0x10ffff
@throw std::out_of_range if code point is >0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
@throw std::invalid_argument if the low surrogate is invalid
@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
...
...
@@ -7044,8 +7045,7 @@ class basic_json
{
std::string error_msg = "parse error - unexpected \'";
error_msg += m_lexer.get_token();
error_msg += "\' (";
error_msg += lexer::token_type_name(last_token) + ")";
error_msg += "\'";
throw std::invalid_argument(error_msg);
}
}
...
...
test/unit.cpp
View file @
dc8ab925
This diff is collapsed.
Click to expand it.
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