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
f2e16430
Commit
f2e16430
authored
May 31, 2017
by
HenryLee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test cases for iterator to const iterator assignment
parent
2d5f0c05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
test/src/unit-iterators1.cpp
test/src/unit-iterators1.cpp
+16
-0
No files found.
test/src/unit-iterators1.cpp
View file @
f2e16430
...
...
@@ -1519,48 +1519,64 @@ TEST_CASE("iterators 1")
json
j
=
true
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"string"
)
{
json
j
=
"hello world"
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"array"
)
{
json
j
=
{
1
,
2
,
3
};
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"object"
)
{
json
j
=
{{
"A"
,
1
},
{
"B"
,
2
},
{
"C"
,
3
}};
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"number (integer)"
)
{
json
j
=
23
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"number (unsigned)"
)
{
json
j
=
23u
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"number (float)"
)
{
json
j
=
23.42
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
SECTION
(
"null"
)
{
json
j
=
nullptr
;
json
::
const_iterator
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
it
=
j
.
begin
();
CHECK
(
it
==
j
.
cbegin
());
}
}
}
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