mirror of
https://github.com/nlohmann/json.git
synced 2024-08-23 05:22:28 +02:00
Revert a change in reverse iterator to pass the test cases
This commit is contained in:
parent
c98169d0d5
commit
0f065edff6
|
@ -8686,7 +8686,7 @@ class basic_json
|
||||||
/// access to successor
|
/// access to successor
|
||||||
reference operator[](difference_type n) const
|
reference operator[](difference_type n) const
|
||||||
{
|
{
|
||||||
return base_iterator::operator[](n);
|
return *(this->operator+(n));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// return the key of an object iterator
|
/// return the key of an object iterator
|
||||||
|
|
|
@ -833,15 +833,15 @@ TEST_CASE("iterators 2")
|
||||||
auto it = j_object.rbegin();
|
auto it = j_object.rbegin();
|
||||||
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
||||||
CHECK_THROWS_AS(it[1], 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[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[1], "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto it = j_object.crbegin();
|
auto it = j_object.crbegin();
|
||||||
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
||||||
CHECK_THROWS_AS(it[1], 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[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[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();
|
auto it = j_null.rbegin();
|
||||||
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
||||||
CHECK_THROWS_AS(it[1], 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[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[1], "[json.exception.invalid_iterator.214] cannot get value");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto it = j_null.crbegin();
|
auto it = j_null.crbegin();
|
||||||
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
CHECK_THROWS_AS(it[0], json::invalid_iterator);
|
||||||
CHECK_THROWS_AS(it[1], 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[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[1], "[json.exception.invalid_iterator.214] cannot get value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue