From 48a349a058981efc2d36e84155438f4c1988f068 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 28 Dec 2014 21:53:13 +0100 Subject: [PATCH] + more test cases --- src/JSON.cc | 6 +----- test/JSON_unit.cc | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/JSON.cc b/src/JSON.cc index ffc4bc06..a0121d78 100644 --- a/src/JSON.cc +++ b/src/JSON.cc @@ -325,11 +325,7 @@ const std::string JSON::_typename() const noexcept { return "boolean"; } - case (value_type::number): - { - return "number"; - } - case (value_type::number_float): + default: { return "number"; } diff --git a/test/JSON_unit.cc b/test/JSON_unit.cc index 43ec2241..d1c86802 100644 --- a/test/JSON_unit.cc +++ b/test/JSON_unit.cc @@ -1380,6 +1380,23 @@ TEST_CASE("Iterators") JSON::const_iterator tmp2(j7.cbegin()); } + // iterator copy assignment + { + JSON::iterator i1 = j2.begin(); + JSON::const_iterator i2 = j2.cbegin(); + JSON::iterator i3 = i1; + JSON::const_iterator i4 = i2; + } + + // operator++ + { + JSON j; + const JSON j_const = j; + for (JSON::iterator i = j.begin(); i != j.end(); ++i); + for (JSON::const_iterator i = j.cbegin(); i != j.cend(); ++i); + for (JSON::const_iterator i = j_const.begin(); i != j_const.end(); ++i); + for (JSON::const_iterator i = j_const.cbegin(); i != j_const.cend(); ++i); + } } TEST_CASE("Comparisons")