diff --git a/include/simdjson/generic/ondemand/json_iterator-inl.h b/include/simdjson/generic/ondemand/json_iterator-inl.h index 4cfdf2b4..ae0367cf 100644 --- a/include/simdjson/generic/ondemand/json_iterator-inl.h +++ b/include/simdjson/generic/ondemand/json_iterator-inl.h @@ -248,7 +248,7 @@ SIMDJSON_WARN_UNUSED simdjson_result json_iterator::consume_root_double( SIMDJSON_WARN_UNUSED simdjson_result json_iterator::parse_root_bool(const uint8_t *json) noexcept { uint8_t tmpbuf[5+1]; if (!copy_to_buffer(json, tmpbuf)) { logger::log_error(*this, "Not a boolean"); return INCORRECT_TYPE; } - return consume_bool(); + return parse_bool(tmpbuf); } SIMDJSON_WARN_UNUSED simdjson_result json_iterator::consume_root_bool() noexcept { return parse_root_bool(advance()); diff --git a/tests/ondemand/ondemand_basictests.cpp b/tests/ondemand/ondemand_basictests.cpp index 1d92b481..b119a3f7 100644 --- a/tests/ondemand/ondemand_basictests.cpp +++ b/tests/ondemand/ondemand_basictests.cpp @@ -403,12 +403,12 @@ namespace dom_api_tests { TEST_SUCCEED(); } - // bool boolean_values() { - // TEST_START(); - // if (!test_scalar_value ("true"_padded, true)) { return false; } - // if (!test_scalar_value ("false"_padded, false)) { return false; } - // TEST_SUCCEED(); - // } + bool boolean_values() { + TEST_START(); + if (!test_scalar_value ("true"_padded, true)) { return false; } + if (!test_scalar_value ("false"_padded, false)) { return false; } + TEST_SUCCEED(); + } // bool null_value() { // TEST_START(); @@ -698,7 +698,7 @@ namespace dom_api_tests { iterate_empty_object() && string_value() && numeric_values() && - // boolean_values() && + boolean_values() && // null_value() && // document_object_index() && // object_index() &&