From d7029c37aad0e93033242123e7a7a05a1c76bed4 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 30 Dec 2016 13:04:33 +0100 Subject: [PATCH] :white_check_mark: improved test coverage --- test/src/unit-cbor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index 9c41dc2f..49a54999 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -28,6 +28,7 @@ SOFTWARE. #include "catch.hpp" +#define private public #include "json.hpp" using nlohmann::json; @@ -1262,6 +1263,12 @@ TEST_CASE("CBOR regressions") } } } + + SECTION("improve code coverage") + { + // exotic edge case + CHECK_THROWS_AS(json::check_length(0xffffffffffffffff, 0xfffffffffffffff0, 0xff), std::out_of_range); + } } TEST_CASE("CBOR roundtrips", "[hide]")