From d66abda4ee24111809dfe1846a0840eb1a1709af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Wed, 3 Apr 2019 12:34:15 +0200 Subject: [PATCH] tests: fix coverage --- test/src/unit-conversions.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index c81720d2..25d4f18a 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -634,13 +634,19 @@ TEST_CASE("value conversion") CHECK(json(b) == j); } + SECTION("uint8_t") + { + auto n = j.get(); + CHECK(n == 1); + } + SECTION("bool") { bool b = j.get(); CHECK(json(b) == j); } - SECTION("exception in case of a non-string type") + SECTION("exception in case of a non-number type") { CHECK_THROWS_AS(json(json::value_t::null).get(), json::type_error&); @@ -650,6 +656,8 @@ TEST_CASE("value conversion") json::type_error&); CHECK_THROWS_AS(json(json::value_t::string).get(), json::type_error&); + CHECK_THROWS_AS(json(json::value_t::string).get(), + json::type_error&); CHECK_THROWS_AS( json(json::value_t::number_integer).get(), json::type_error&);