🔨 added user-defined exception 406
This commit is contained in:
parent
43b8285249
commit
c5cf32e34d
5 changed files with 11 additions and 7 deletions
|
@ -277,8 +277,9 @@ TEST_CASE("parser class")
|
|||
SECTION("overflow")
|
||||
{
|
||||
// overflows during parsing yield an exception
|
||||
CHECK_THROWS_AS(json::parser("1.18973e+4932").parse() == json(), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json::parser("1.18973e+4932").parse() == json(), "number overflow: 1.18973e+4932");
|
||||
CHECK_THROWS_AS(json::parser("1.18973e+4932").parse() == json(), json::out_of_range);
|
||||
CHECK_THROWS_WITH(json::parser("1.18973e+4932").parse() == json(),
|
||||
"[json.exception.out_of_range.406] number overflow parsing '1.18973e+4932'");
|
||||
}
|
||||
|
||||
SECTION("invalid numbers")
|
||||
|
|
|
@ -590,8 +590,9 @@ TEST_CASE("regression tests")
|
|||
|
||||
SECTION("issue #329 - serialized value not always can be parsed")
|
||||
{
|
||||
CHECK_THROWS_AS(json::parse("22e2222"), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json::parse("22e2222"), "number overflow: 22e2222");
|
||||
CHECK_THROWS_AS(json::parse("22e2222"), json::out_of_range);
|
||||
CHECK_THROWS_WITH(json::parse("22e2222"),
|
||||
"[json.exception.out_of_range.406] number overflow parsing '22e2222'");
|
||||
}
|
||||
|
||||
SECTION("issue #366 - json::parse on failed stream gets stuck")
|
||||
|
|
|
@ -797,7 +797,7 @@ TEST_CASE("nst's JSONTestSuite")
|
|||
CAPTURE(filename);
|
||||
std::ifstream f(filename);
|
||||
json j;
|
||||
CHECK_THROWS_AS(j << f, std::out_of_range);
|
||||
CHECK_THROWS_AS(j << f, json::out_of_range);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue