From 8f7052537404733a213dcfb7fd0ccd1589ef0cd6 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 30 Oct 2016 17:46:00 +0100 Subject: [PATCH] more test coverage --- test/src/unit-deserialization.cpp | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/src/unit-deserialization.cpp b/test/src/unit-deserialization.cpp index 497454df..a46ffced 100644 --- a/test/src/unit-deserialization.cpp +++ b/test/src/unit-deserialization.cpp @@ -280,6 +280,42 @@ TEST_CASE("deserialization") uint8_t v[] = {'\"', 0x7F, 0xEF, 0xC0}; CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); } + + SECTION("case 10") + { + uint8_t v[] = {'\"', 0x7F, 0xED, 0x7F}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } + + SECTION("case 11") + { + uint8_t v[] = {'\"', 0x7F, 0xF0, 0x8F}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } + + SECTION("case 12") + { + uint8_t v[] = {'\"', 0x7F, 0xF0, 0xC0}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } + + SECTION("case 13") + { + uint8_t v[] = {'\"', 0x7F, 0xF3, 0x7F}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } + + SECTION("case 14") + { + uint8_t v[] = {'\"', 0x7F, 0xF3, 0xC0}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } + + SECTION("case 15") + { + uint8_t v[] = {'\"', 0x7F, 0xF4, 0x7F}; + CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument); + } } } }