diff --git a/tests/src/unit-file_input.cpp b/tests/src/unit-file_input.cpp index c3e587e74..e88b6f4d0 100644 --- a/tests/src/unit-file_input.cpp +++ b/tests/src/unit-file_input.cpp @@ -170,6 +170,7 @@ TEST_CASE("parsing from a FILE*") check_unlocked(f.get()); } +#if !defined(JSON_NOEXCEPTION) SECTION("the file is unlocked after a parse error") { 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()) == "]"); } +#endif // !defined(JSON_NOEXCEPTION) + SECTION("the file can be parsed again and read with stdio afterwards") { const file_ptr f = open_with(name, "[1] [2] tail"); diff --git a/tests/src/unit-stream-bulk-scan.cpp b/tests/src/unit-stream-bulk-scan.cpp index b5b6ded15..0d35c67cf 100644 --- a/tests/src/unit-stream-bulk-scan.cpp +++ b/tests/src/unit-stream-bulk-scan.cpp @@ -190,6 +190,7 @@ std::vector corpus() 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") { const std::vector 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") { 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); } +#if !defined(JSON_NOEXCEPTION) SECTION("a token that spans several get areas is reported completely") { // 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") { std::string input;