Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
0fcc4149
Commit
0fcc4149
authored
Jan 10, 2015
by
Raphael Isemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More testing and updated CMake to allow calling private functions from the tests
parent
6105ce54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
CMakeLists.txt
CMakeLists.txt
+3
-0
json_unit.cc
test/json_unit.cc
+6
-0
No files found.
CMakeLists.txt
View file @
0fcc4149
...
...
@@ -4,6 +4,9 @@ project(json)
# Enable C++11 and set flags for coverage testing
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11 -g -O0 --coverage -fprofile-arcs -ftest-coverage"
)
# Make everything public for testing purposes
add_definitions
(
-Dprivate=public
)
# If not specified, use Debug as build type (necessary for coverage testing)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE Debug CACHE STRING
...
...
test/json_unit.cc
View file @
0fcc4149
...
...
@@ -1697,6 +1697,12 @@ TEST_CASE("Parser")
CHECK_THROWS_AS
(
json
::
parse
(
"
\"\\
uD80C
\\
uD80C
\"
"
),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parse
(
"
\"\\
uD80C
\\
u0000
\"
"
),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parse
(
"
\"\\
uD80C
\\
uFFFF
\"
"
),
std
::
invalid_argument
);
// test private code point converter function
CHECK_NOTHROW
(
json
::
parser
(
""
).
codePointToUTF8
(
0x10FFFE
));
CHECK_NOTHROW
(
json
::
parser
(
""
).
codePointToUTF8
(
0x10FFFF
));
CHECK_THROWS_AS
(
json
::
parser
(
""
).
codePointToUTF8
(
0x110000
),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
""
).
codePointToUTF8
(
0x110001
),
std
::
invalid_argument
);
}
SECTION
(
"boolean"
)
...
...
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