From 36f14d21dac104dacf19b5f5019acfff19f3bff2 Mon Sep 17 00:00:00 2001 From: Niels Date: Fri, 23 Jan 2015 18:07:31 +0100 Subject: [PATCH] more test cases for reverse iterators --- test/json_unit.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/json_unit.cc b/test/json_unit.cc index 29ce9af4..fd2d18a8 100644 --- a/test/json_unit.cc +++ b/test/json_unit.cc @@ -221,6 +221,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 for (json::const_iterator cit = j1.cbegin(); cit != j1.cend(); ++cit) @@ -661,10 +669,6 @@ TEST_CASE("object") { } - for (json::const_reverse_iterator it = j1.crbegin(); it != j1.crend(); ++it) - { - } - // range-based for for (auto& element : j1) { @@ -696,6 +700,10 @@ TEST_CASE("object") CHECK(it->type() == json::value_t::number); } + for (json::const_reverse_iterator it = j1.crbegin(); it != j1.crend(); ++it) + { + } + // const_iterator using cbegin/cend for (json::const_iterator it = j1.cbegin(); it != j1.cend(); ++it) {