mirror of
https://github.com/nlohmann/json.git
synced 2026-10-17 11:38:14 +00:00
fixed test coverage
This commit is contained in:
1 parent
c8d01fa7b9
commit
42be2edd4c
2 files changed
+16
No files matched your search
@@ -223,5 +223,21 @@ TEST_CASE("deserialization")
|
||||
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
|
||||
}
|
||||
}
|
||||
|
||||
// these cases are required for 100% line coverage
|
||||
SECTION("error cases")
|
||||
{
|
||||
SECTION("case 1")
|
||||
{
|
||||
uint8_t v[] = {'\"', 'a', 'a', 'a', 'a', 'a', 'a', '\\', 'u'};
|
||||
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
|
||||
}
|
||||
|
||||
SECTION("case 2")
|
||||
{
|
||||
uint8_t v[] = {'\"', 'a', 'a', 'a', 'a', 'a', 'a', '\\', 'u', '1'};
|
||||
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user