🔨 added user-defined exceptions 203-204
This commit is contained in:
parent
9381f6c4da
commit
875b2da95d
5 changed files with 118 additions and 118 deletions
|
|
@ -1193,17 +1193,17 @@ TEST_CASE("constructors")
|
|||
{
|
||||
{
|
||||
json j = "foo";
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
{
|
||||
json j = "bar";
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1211,17 +1211,17 @@ TEST_CASE("constructors")
|
|||
{
|
||||
{
|
||||
json j = false;
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
{
|
||||
json j = true;
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1229,17 +1229,17 @@ TEST_CASE("constructors")
|
|||
{
|
||||
{
|
||||
json j = 17;
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
{
|
||||
json j = 17;
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1247,17 +1247,17 @@ TEST_CASE("constructors")
|
|||
{
|
||||
{
|
||||
json j = 17u;
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
{
|
||||
json j = 17u;
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1265,17 +1265,17 @@ TEST_CASE("constructors")
|
|||
{
|
||||
{
|
||||
json j = 23.42;
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.end(), j.end()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.begin(), j.begin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.end(), j.end()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.begin(), j.begin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
{
|
||||
json j = 23.42;
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), std::out_of_range);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), std::out_of_range);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "iterators out of range");
|
||||
CHECK_THROWS_AS(json(j.cend(), j.cend()), json::invalid_iterator);
|
||||
CHECK_THROWS_AS(json(j.cbegin(), j.cbegin()), json::invalid_iterator);
|
||||
CHECK_THROWS_WITH(json(j.cend(), j.cend()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
CHECK_THROWS_WITH(json(j.cbegin(), j.cbegin()), "[json.exception.invalid_iterator.204] iterators out of range");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue