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
1b04092c
Unverified
Commit
1b04092c
authored
Jul 08, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
fix test
parent
28ef8737
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
test/src/unit-assert_macro.cpp
test/src/unit-assert_macro.cpp
+10
-9
test/src/unit-udt_macro.cpp
test/src/unit-udt_macro.cpp
+6
-6
No files found.
test/src/unit-assert_macro.cpp
View file @
1b04092c
...
...
@@ -45,15 +45,16 @@ using nlohmann::json;
TEST_CASE
(
"JSON_ASSERT(x)"
)
{
assert_counter
=
0
;
const
json
j
=
{{
"bar"
,
1
}};
CHECK
(
assert_counter
==
0
);
// accessing non-existing key in const value would assert
if
(
j
[
"foo"
]
==
1
)
SECTION
(
"basic_json(first, second)"
)
{
CHECK
(
true
);
}
assert_counter
=
0
;
CHECK
(
assert_counter
==
0
);
json
::
iterator
it
;
json
j
;
CHECK
(
assert_counter
==
1
);
CHECK_THROWS_WITH_AS
(
json
(
it
,
j
.
end
()),
"[json.exception.invalid_iterator.201] iterators are not compatible"
,
json
::
invalid_iterator
);
CHECK
(
assert_counter
==
1
);
}
}
test/src/unit-udt_macro.cpp
View file @
1b04092c
...
...
@@ -60,9 +60,9 @@ class person_with_private_data
class
person_without_private_data_1
{
public:
std
::
string
name
=
""
;
int
age
=
0
;
json
metadata
=
nullptr
;
std
::
string
name
=
""
;
int
age
=
0
;
json
metadata
=
nullptr
;
bool
operator
==
(
const
person_without_private_data_1
&
rhs
)
const
{
...
...
@@ -82,9 +82,9 @@ class person_without_private_data_1
class
person_without_private_data_2
{
public:
std
::
string
name
=
""
;
int
age
=
0
;
json
metadata
=
nullptr
;
std
::
string
name
=
""
;
int
age
=
0
;
json
metadata
=
nullptr
;
bool
operator
==
(
const
person_without_private_data_2
&
rhs
)
const
{
...
...
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