1
0
mirror of https://github.com/nlohmann/json synced 2024-11-23 20:40:08 +00:00

Fix some more reverse iterator arithmetic test codes

This commit is contained in:
HenryLee 2017-05-29 19:43:45 +10:00
parent adc73d6d5f
commit a3bf0131c4

View File

@ -769,8 +769,8 @@ TEST_CASE("iterators 2")
{
auto it = j_null.rbegin();
it += 3;
CHECK((j_null.rbegin() - 3) == it);
CHECK((it + 3) == j_null.rbegin());
CHECK((j_null.rbegin() + 3) == it);
CHECK((it - 3) == j_null.rbegin());
CHECK((it - j_null.rbegin()) == 3);
CHECK(it != j_null.rend());
it -= 3;
@ -779,8 +779,8 @@ TEST_CASE("iterators 2")
{
auto it = j_null.crbegin();
it += 3;
CHECK((j_null.crbegin() - 3) == it);
CHECK((it + 3) == j_null.crbegin());
CHECK((j_null.crbegin() + 3) == it);
CHECK((it - 3) == j_null.crbegin());
CHECK((it - j_null.crbegin()) == 3);
CHECK(it != j_null.crend());
it -= 3;
@ -793,8 +793,8 @@ TEST_CASE("iterators 2")
{
auto it = j_value.rbegin();
it += 3;
CHECK((j_value.rbegin() - 3) == it);
CHECK((it + 3) == j_value.rbegin());
CHECK((j_value.rbegin() + 3) == it);
CHECK((it - 3) == j_value.rbegin());
CHECK((it - j_value.rbegin()) == 3);
CHECK(it != j_value.rend());
it -= 3;
@ -803,8 +803,8 @@ TEST_CASE("iterators 2")
{
auto it = j_value.crbegin();
it += 3;
CHECK((j_value.crbegin() - 3) == it);
CHECK((it + 3) == j_value.crbegin());
CHECK((j_value.crbegin() + 3) == it);
CHECK((it - 3) == j_value.crbegin());
CHECK((it - j_value.crbegin()) == 3);
CHECK(it != j_value.crend());
it -= 3;