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
f774a32d
Unverified
Commit
f774a32d
authored
Jul 08, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
fix test
parent
1b04092c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
unit-assert_macro.cpp
test/src/unit-assert_macro.cpp
+5
-0
No files found.
test/src/unit-assert_macro.cpp
View file @
f774a32d
...
@@ -43,6 +43,8 @@ static int assert_counter;
...
@@ -43,6 +43,8 @@ static int assert_counter;
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
using
nlohmann
::
json
;
using
nlohmann
::
json
;
// the test assumes exceptions to work
#if not defined(JSON_NOEXCEPTION)
TEST_CASE
(
"JSON_ASSERT(x)"
)
TEST_CASE
(
"JSON_ASSERT(x)"
)
{
{
SECTION
(
"basic_json(first, second)"
)
SECTION
(
"basic_json(first, second)"
)
...
@@ -53,8 +55,11 @@ TEST_CASE("JSON_ASSERT(x)")
...
@@ -53,8 +55,11 @@ TEST_CASE("JSON_ASSERT(x)")
json
::
iterator
it
;
json
::
iterator
it
;
json
j
;
json
j
;
// in case assertions do not abort execution, an exception is thrown
CHECK_THROWS_WITH_AS
(
json
(
it
,
j
.
end
()),
"[json.exception.invalid_iterator.201] iterators are not compatible"
,
json
::
invalid_iterator
);
CHECK_THROWS_WITH_AS
(
json
(
it
,
j
.
end
()),
"[json.exception.invalid_iterator.201] iterators are not compatible"
,
json
::
invalid_iterator
);
// check that assertion actually happened
CHECK
(
assert_counter
==
1
);
CHECK
(
assert_counter
==
1
);
}
}
}
}
#endif
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