Unverified Commit fd4a0eca by Niels Lohmann

Merge branch 'feature/ifstream' into develop

parents 5fa5c17b 88dc7c11
...@@ -8862,7 +8862,8 @@ class basic_json ...@@ -8862,7 +8862,8 @@ class basic_json
// We initially read a lot of characters into the buffer, and we // We initially read a lot of characters into the buffer, and we
// may not have processed all of them. Therefore, we need to // may not have processed all of them. Therefore, we need to
// "rewind" the stream after the last processed char. // "rewind" the stream after the last processed char.
is.seekg(start_position + static_cast<std::streamoff>(processed_chars)); is.seekg(start_position);
is.ignore(static_cast<std::streamsize>(processed_chars));
// clear stream flags // clear stream flags
is.clear(); is.clear();
} }
......
...@@ -711,7 +711,6 @@ TEST_CASE("regression tests") ...@@ -711,7 +711,6 @@ TEST_CASE("regression tests")
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input"); "[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
} }
/*
SECTION("second example from #529") SECTION("second example from #529")
{ {
std::string str = "{\n\"one\" : 1,\n\"two\" : 2\n}\n{\n\"three\" : 3\n}"; std::string str = "{\n\"one\" : 1,\n\"two\" : 2\n}\n{\n\"three\" : 3\n}";
...@@ -735,13 +734,11 @@ TEST_CASE("regression tests") ...@@ -735,13 +734,11 @@ TEST_CASE("regression tests")
if (i == 0) if (i == 0)
{ {
CHECK(val == json({{"one", 1}, {"two", 2}})); CHECK(val == json({{"one", 1}, {"two", 2}}));
CHECK(static_cast<int>(stream.tellg()) == 28);
} }
if (i == 1) if (i == 1)
{ {
CHECK(val == json({{"three", 3}})); CHECK(val == json({{"three", 3}}));
CHECK(static_cast<int>(stream.tellg()) == 44);
} }
++i; ++i;
...@@ -749,7 +746,6 @@ TEST_CASE("regression tests") ...@@ -749,7 +746,6 @@ TEST_CASE("regression tests")
std::remove("test.json"); std::remove("test.json");
} }
*/
} }
SECTION("issue #389 - Integer-overflow (OSS-Fuzz issue 267)") SECTION("issue #389 - Integer-overflow (OSS-Fuzz issue 267)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment