Skip to content

Commit 7e180e3

Browse files
committed
Fix json_cursor_tests
1 parent 8bc9a46 commit 7e180e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/jsoncons/json_cursor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ class basic_json_cursor : public basic_staj_cursor<CharT>, private virtual ser_c
560560
}
561561
else
562562
{
563-
if (tokenizer_.state() == parse_state::start)
563+
if (!tokenizer_.started())
564564
{
565565
return;
566566
}

test/corelib/src/json_cursor_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ TEMPLATE_TEST_CASE("json_cursor reset test", "",
661661
cursor_type cursor(input0);
662662
std::error_code ec;
663663

664-
REQUIRE(cursor.done());
664+
REQUIRE_FALSE(cursor.done());
665665
cursor.reset(input1);
666666
REQUIRE_FALSE(cursor.done());
667667
CHECK(staj_event_type::string_value == cursor.current().event_type());
@@ -673,7 +673,7 @@ TEMPLATE_TEST_CASE("json_cursor reset test", "",
673673

674674
cursor.reset(input2, ec);
675675
CHECK(ec == json_errc::syntax_error);
676-
CHECK(cursor.done()); //REVISIT Changed behavior
676+
CHECK(!cursor.done());
677677

678678
// Check that cursor can reused be upon reset following an error.
679679
ec = json_errc::success;

0 commit comments

Comments
 (0)