Skip the exception-only checks of the stream input tests without exceptions
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+9
No files matched your search
@@ -170,6 +170,7 @@ TEST_CASE("parsing from a FILE*")
|
|||||||
check_unlocked(f.get());
|
check_unlocked(f.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(JSON_NOEXCEPTION)
|
||||||
SECTION("the file is unlocked after a parse error")
|
SECTION("the file is unlocked after a parse error")
|
||||||
{
|
{
|
||||||
const file_ptr f = open_with(name, "[1, 2, x]");
|
const file_ptr f = open_with(name, "[1, 2, x]");
|
||||||
@@ -186,6 +187,8 @@ TEST_CASE("parsing from a FILE*")
|
|||||||
CHECK(std::string(rest.data()) == "]");
|
CHECK(std::string(rest.data()) == "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !defined(JSON_NOEXCEPTION)
|
||||||
|
|
||||||
SECTION("the file can be parsed again and read with stdio afterwards")
|
SECTION("the file can be parsed again and read with stdio afterwards")
|
||||||
{
|
{
|
||||||
const file_ptr f = open_with(name, "[1] [2] tail");
|
const file_ptr f = open_with(name, "[1] [2] tail");
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ std::vector<std::string> corpus()
|
|||||||
|
|
||||||
TEST_CASE("parsing from a std::istream scans the get area in bulk")
|
TEST_CASE("parsing from a std::istream scans the get area in bulk")
|
||||||
{
|
{
|
||||||
|
#if !defined(JSON_NOEXCEPTION)
|
||||||
SECTION("results do not depend on the get area")
|
SECTION("results do not depend on the get area")
|
||||||
{
|
{
|
||||||
const std::vector<read_mode> read_modes = {read_mode::extract, read_mode::parse, read_mode::parse_lenient};
|
const std::vector<read_mode> read_modes = {read_mode::extract, read_mode::parse, read_mode::parse_lenient};
|
||||||
@@ -210,6 +211,8 @@ TEST_CASE("parsing from a std::istream scans the get area in bulk")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !defined(JSON_NOEXCEPTION)
|
||||||
|
|
||||||
SECTION("values are the same as when parsing from a string")
|
SECTION("values are the same as when parsing from a string")
|
||||||
{
|
{
|
||||||
const std::string input = R"({"name": "nlohmann::json", "numbers": [1, -2, 3.5, 4e10, 18446744073709551615],)"
|
const std::string input = R"({"name": "nlohmann::json", "numbers": [1, -2, 3.5, 4e10, 18446744073709551615],)"
|
||||||
@@ -227,6 +230,7 @@ TEST_CASE("parsing from a std::istream scans the get area in bulk")
|
|||||||
CHECK(json::parse(ss) == expected);
|
CHECK(json::parse(ss) == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(JSON_NOEXCEPTION)
|
||||||
SECTION("a token that spans several get areas is reported completely")
|
SECTION("a token that spans several get areas is reported completely")
|
||||||
{
|
{
|
||||||
// the error is found after the string has crossed many get areas; the
|
// the error is found after the string has crossed many get areas; the
|
||||||
@@ -281,6 +285,8 @@ TEST_CASE("parsing from a std::istream scans the get area in bulk")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !defined(JSON_NOEXCEPTION)
|
||||||
|
|
||||||
SECTION("many values from one stream")
|
SECTION("many values from one stream")
|
||||||
{
|
{
|
||||||
std::string input;
|
std::string input;
|
||||||
|
|||||||
Reference in new issue
Block a user