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
0f065edf
Commit
0f065edf
authored
Jun 07, 2017
by
HenryLee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert a change in reverse iterator to pass the test cases
parent
c98169d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/json.hpp
src/json.hpp
+1
-1
test/src/unit-iterators2.cpp
test/src/unit-iterators2.cpp
+8
-8
No files found.
src/json.hpp
View file @
0f065edf
...
...
@@ -8686,7 +8686,7 @@ class basic_json
/// access to successor
reference
operator
[](
difference_type
n
)
const
{
return
base_iterator
::
operator
[](
n
);
return
*
(
this
->
operator
+
(
n
)
);
}
/// return the key of an object iterator
...
...
test/src/unit-iterators2.cpp
View file @
0f065edf
...
...
@@ -833,15 +833,15 @@ TEST_CASE("iterators 2")
auto
it
=
j_object
.
rbegin
();
CHECK_THROWS_AS
(
it
[
0
],
json
::
invalid_iterator
);
CHECK_THROWS_AS
(
it
[
1
],
json
::
invalid_iterator
);
//
CHECK_THROWS_WITH(it[0], "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
//
CHECK_THROWS_WITH(it[1], "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
CHECK_THROWS_WITH
(
it
[
0
],
"[json.exception.invalid_iterator.209] cannot use offsets with object iterators"
);
CHECK_THROWS_WITH
(
it
[
1
],
"[json.exception.invalid_iterator.209] cannot use offsets with object iterators"
);
}
{
auto
it
=
j_object
.
crbegin
();
CHECK_THROWS_AS
(
it
[
0
],
json
::
invalid_iterator
);
CHECK_THROWS_AS
(
it
[
1
],
json
::
invalid_iterator
);
//
CHECK_THROWS_WITH(it[0], "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
//
CHECK_THROWS_WITH(it[1], "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
CHECK_THROWS_WITH
(
it
[
0
],
"[json.exception.invalid_iterator.209] cannot use offsets with object iterators"
);
CHECK_THROWS_WITH
(
it
[
1
],
"[json.exception.invalid_iterator.209] cannot use offsets with object iterators"
);
}
}
...
...
@@ -873,15 +873,15 @@ TEST_CASE("iterators 2")
auto
it
=
j_null
.
rbegin
();
CHECK_THROWS_AS
(
it
[
0
],
json
::
invalid_iterator
);
CHECK_THROWS_AS
(
it
[
1
],
json
::
invalid_iterator
);
//
CHECK_THROWS_WITH(it[0], "[json.exception.invalid_iterator.214] cannot get value");
//
CHECK_THROWS_WITH(it[1], "[json.exception.invalid_iterator.214] cannot get value");
CHECK_THROWS_WITH
(
it
[
0
],
"[json.exception.invalid_iterator.214] cannot get value"
);
CHECK_THROWS_WITH
(
it
[
1
],
"[json.exception.invalid_iterator.214] cannot get value"
);
}
{
auto
it
=
j_null
.
crbegin
();
CHECK_THROWS_AS
(
it
[
0
],
json
::
invalid_iterator
);
CHECK_THROWS_AS
(
it
[
1
],
json
::
invalid_iterator
);
//
CHECK_THROWS_WITH(it[0], "[json.exception.invalid_iterator.214] cannot get value");
//
CHECK_THROWS_WITH(it[1], "[json.exception.invalid_iterator.214] cannot get value");
CHECK_THROWS_WITH
(
it
[
0
],
"[json.exception.invalid_iterator.214] cannot get value"
);
CHECK_THROWS_WITH
(
it
[
1
],
"[json.exception.invalid_iterator.214] cannot get value"
);
}
}
...
...
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