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
36f14d21
Commit
36f14d21
authored
Jan 23, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more test cases for reverse iterators
parent
c22ee3f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
json_unit.cc
test/json_unit.cc
+12
-4
No files found.
test/json_unit.cc
View file @
36f14d21
...
@@ -222,6 +222,14 @@ TEST_CASE("array")
...
@@ -222,6 +222,14 @@ TEST_CASE("array")
}
}
}
}
{
{
for
(
json
::
const_reverse_iterator
it
=
j1
.
rbegin
();
it
!=
j1
.
crend
();
++
it
)
{
}
for
(
json
::
reverse_iterator
it
=
j1
.
rbegin
();
it
!=
j1
.
rend
();
++
it
)
{
}
}
{
// const_iterator with cbegin/cend
// const_iterator with cbegin/cend
for
(
json
::
const_iterator
cit
=
j1
.
cbegin
();
cit
!=
j1
.
cend
();
++
cit
)
for
(
json
::
const_iterator
cit
=
j1
.
cbegin
();
cit
!=
j1
.
cend
();
++
cit
)
{
{
...
@@ -661,10 +669,6 @@ TEST_CASE("object")
...
@@ -661,10 +669,6 @@ TEST_CASE("object")
{
{
}
}
for
(
json
::
const_reverse_iterator
it
=
j1
.
crbegin
();
it
!=
j1
.
crend
();
++
it
)
{
}
// range-based for
// range-based for
for
(
auto
&
element
:
j1
)
for
(
auto
&
element
:
j1
)
{
{
...
@@ -696,6 +700,10 @@ TEST_CASE("object")
...
@@ -696,6 +700,10 @@ TEST_CASE("object")
CHECK
(
it
->
type
()
==
json
::
value_t
::
number
);
CHECK
(
it
->
type
()
==
json
::
value_t
::
number
);
}
}
for
(
json
::
const_reverse_iterator
it
=
j1
.
crbegin
();
it
!=
j1
.
crend
();
++
it
)
{
}
// const_iterator using cbegin/cend
// const_iterator using cbegin/cend
for
(
json
::
const_iterator
it
=
j1
.
cbegin
();
it
!=
j1
.
cend
();
++
it
)
for
(
json
::
const_iterator
it
=
j1
.
cbegin
();
it
!=
j1
.
cend
();
++
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