From b2b5e4e7e131c1463c2159dd6a0ced36e2e671e7 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 28 Dec 2014 18:12:07 +0100 Subject: [PATCH] + more test cases --- test/JSON_unit.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/JSON_unit.cc b/test/JSON_unit.cc index 40b1e9f2..03b3118b 100644 --- a/test/JSON_unit.cc +++ b/test/JSON_unit.cc @@ -1091,8 +1091,20 @@ TEST_CASE("Iterators") JSON j7 = "hello"; // operator * + CHECK_THROWS_AS(* j1.end(), std::runtime_error); + CHECK_THROWS_AS(* j1.cend(), std::runtime_error); + CHECK_THROWS_AS(* j2.end(), std::runtime_error); + CHECK_THROWS_AS(* j2.cend(), std::runtime_error); + CHECK_THROWS_AS(* j3.end(), std::runtime_error); + CHECK_THROWS_AS(* j3.cend(), std::runtime_error); CHECK_THROWS_AS(* j4.end(), std::runtime_error); - CHECK_THROWS_AS(* j4.end(), std::runtime_error); + CHECK_THROWS_AS(* j4.cend(), std::runtime_error); + CHECK_THROWS_AS(* j5.end(), std::runtime_error); + CHECK_THROWS_AS(* j5.cend(), std::runtime_error); + CHECK_THROWS_AS(* j6.end(), std::runtime_error); + CHECK_THROWS_AS(* j6.cend(), std::runtime_error); + CHECK_THROWS_AS(* j7.end(), std::runtime_error); + CHECK_THROWS_AS(* j7.cend(), std::runtime_error); // operator -> CHECK(j1.begin()->type() == JSON::value_type::number); @@ -1602,5 +1614,6 @@ TEST_CASE("Parser") { CHECK_THROWS_AS(JSON::parse(""), std::invalid_argument); CHECK_THROWS_AS(JSON::parse(std::string("")), std::invalid_argument); + CHECK_THROWS_AS(JSON::parse("[1,2"), std::invalid_argument); } }