From 38f616b7bd2d38d496dd1f28fdc10d9bb50a15b0 Mon Sep 17 00:00:00 2001 From: Joao Paulo Magalhaes Date: Mon, 12 Aug 2024 18:37:50 +0100 Subject: [PATCH] rename ExpectError::do_check() to ExpectError::check_error() --- test/test_emit.cpp | 64 +++++++++---------- test/test_json.cpp | 34 +++++----- test/test_lib/test_case.cpp | 8 +-- test/test_lib/test_case.hpp | 6 +- test/test_lib/test_engine.cpp | 4 +- test/test_lib/test_engine.hpp | 2 +- test/test_lib/test_group.cpp | 2 +- test/test_location.cpp | 2 +- test/test_map.cpp | 8 +-- test/test_parser.cpp | 114 +++++++++++++++++----------------- test/test_scalar_dquoted.cpp | 2 +- test/test_scalar_folded.cpp | 12 ++-- test/test_scalar_literal.cpp | 18 +++--- test/test_scalar_plain.cpp | 4 +- test/test_scalar_squoted.cpp | 6 +- test/test_seq.cpp | 12 ++-- test/test_serialize.cpp | 12 ++-- test/test_suite.cpp | 10 +-- test/test_tag_property.cpp | 8 +-- test/test_tree.cpp | 6 +- 20 files changed, 167 insertions(+), 167 deletions(-) diff --git a/test/test_emit.cpp b/test/test_emit.cpp index f7cea26e7..f51480dbd 100644 --- a/test/test_emit.cpp +++ b/test/test_emit.cpp @@ -216,14 +216,14 @@ void test_emits(Tree const& t, id_type id, std::string const& expected, std::str if(max_depth > 1) { EmitOptions opts = EmitOptions{}.max_depth(0); - ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, id, opts, buf); }); }); - ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, id, opts, buf); }); }); - ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, id, opts, f); }); }); - ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, id, opts, f); }); }); - ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(t, id, opts); }); }); - ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(t, id, opts); }); }); - ExpectError::do_check(&t, [&]{ return emitrs_yaml(t, id, opts); }); - ExpectError::do_check(&t, [&]{ return emitrs_json(t, id, opts); }); + ExpectError::check_error(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, id, opts, buf); }); }); + ExpectError::check_error(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, id, opts, buf); }); }); + ExpectError::check_error(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, id, opts, f); }); }); + ExpectError::check_error(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, id, opts, f); }); }); + ExpectError::check_error(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(t, id, opts); }); }); + ExpectError::check_error(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(t, id, opts); }); }); + ExpectError::check_error(&t, [&]{ return emitrs_yaml(t, id, opts); }); + ExpectError::check_error(&t, [&]{ return emitrs_json(t, id, opts); }); } } @@ -264,14 +264,14 @@ void test_emits(Tree const& t, std::string const& expected, std::string const& e if(max_depth > 1) { EmitOptions opts = EmitOptions{}.max_depth(0); - ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, opts, buf); }); }); - ExpectError::do_check(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, opts, buf); }); }); - ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, opts, f); }); }); - ExpectError::do_check(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, opts, f); }); }); - ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(ConstNodeRef(&t), opts); }); }); - ExpectError::do_check(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(ConstNodeRef(&t), opts); }); }); - ExpectError::do_check(&t, [&]{ return emitrs_yaml(t, opts); }); - ExpectError::do_check(&t, [&]{ return emitrs_json(t, opts); }); + ExpectError::check_error(&t, [&]{ return emit2buf([&](substr buf){ return emit_yaml(t, opts, buf); }); }); + ExpectError::check_error(&t, [&]{ return emit2buf([&](substr buf){ return emit_json(t, opts, buf); }); }); + ExpectError::check_error(&t, [&]{ return emit2file([&](FILE *f){ return emit_yaml(t, opts, f); }); }); + ExpectError::check_error(&t, [&]{ return emit2file([&](FILE *f){ return emit_json(t, opts, f); }); }); + ExpectError::check_error(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(ConstNodeRef(&t), opts); }); }); + ExpectError::check_error(&t, [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(ConstNodeRef(&t), opts); }); }); + ExpectError::check_error(&t, [&]{ return emitrs_yaml(t, opts); }); + ExpectError::check_error(&t, [&]{ return emitrs_json(t, opts); }); } } @@ -312,18 +312,18 @@ void test_emits(ConstNodeRef n, std::string const& expected, std::string const& if(max_depth > 1) { EmitOptions opts = EmitOptions{}.max_depth(0); - ExpectError::do_check(n.tree(), [&]{ + ExpectError::check_error(n.tree(), [&]{ return emit2buf([&](substr buf){ return emit_yaml(n, opts, buf); }); }); - ExpectError::do_check(n.tree(), [&]{ return emit2buf([&](substr buf){ return emit_json(n, opts, buf); }); }); - ExpectError::do_check(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_yaml(n, opts, f); }); }); - ExpectError::do_check(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_json(n, opts, f); }); }); - ExpectError::do_check(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(n, opts); }); }); - ExpectError::do_check(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(n, opts); }); }); - ExpectError::do_check(n.tree(), [&]{ return emitrs_yaml(n, opts); }); - ExpectError::do_check(n.tree(), [&]{ return emitrs_json(n, opts); }); + ExpectError::check_error(n.tree(), [&]{ return emit2buf([&](substr buf){ return emit_json(n, opts, buf); }); }); + ExpectError::check_error(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_yaml(n, opts, f); }); }); + ExpectError::check_error(n.tree(), [&]{ return emit2file([&](FILE *f){ return emit_json(n, opts, f); }); }); + ExpectError::check_error(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_yaml(n, opts); }); }); + ExpectError::check_error(n.tree(), [&]{ return emit2stream([&](std::ostringstream &oss){ oss << as_json(n, opts); }); }); + ExpectError::check_error(n.tree(), [&]{ return emitrs_yaml(n, opts); }); + ExpectError::check_error(n.tree(), [&]{ return emitrs_json(n, opts); }); } } } @@ -954,10 +954,10 @@ TEST(emit, error_on_emit_yaml_to_short_buffer) const Tree tree = parse_in_arena(yaml); { char too_small[2]; - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_yaml(tree, too_small); }); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_yaml(tree, too_small, /*error_on_excess*/true); }); substr required = emit_yaml(tree, too_small, /*error_on_excess*/false); @@ -968,10 +968,10 @@ TEST(emit, error_on_emit_yaml_to_short_buffer) substr nothing; EXPECT_EQ(nothing.str, nullptr); EXPECT_EQ(nothing.len, 0u); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_yaml(tree, nothing); }); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_yaml(tree, nothing, /*error_on_excess*/true); }); substr required = emit_yaml(tree, nothing, /*error_on_excess*/false); @@ -986,10 +986,10 @@ TEST(emit, error_on_emit_json_to_short_buffer) const Tree tree = parse_in_arena(json); { char too_small[2]; - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_json(tree, too_small); }); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_json(tree, too_small, /*error_on_excess*/true); }); substr required = emit_json(tree, too_small, /*error_on_excess*/false); @@ -1000,10 +1000,10 @@ TEST(emit, error_on_emit_json_to_short_buffer) substr nothing; EXPECT_EQ(nothing.str, nullptr); EXPECT_EQ(nothing.len, 0u); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_json(tree, nothing); }); - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ emit_json(tree, nothing, /*error_on_excess*/true); }); substr required = emit_json(tree, nothing, /*error_on_excess*/false); diff --git a/test/test_json.cpp b/test/test_json.cpp index 3028d81b8..1d91c4283 100644 --- a/test/test_json.cpp +++ b/test/test_json.cpp @@ -490,119 +490,119 @@ quntity2: 95000000)"); TEST(parse_json, error_on_missing_seq_val) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[foo, , ]"); }); } TEST(parse_json, error_on_double_seq_val) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[0 1, ]"); }); } TEST(parse_json, error_on_double_seq_val_quoted) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[\"0\" 1, ]"); }); } TEST(parse_json, error_on_double_seq_val_quoted_2) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[\"0\" \"1\", ]"); }); } TEST(parse_json, error_on_double_seq_val_quoted_3) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[0 \"1\", ]"); }); } TEST(parse_json, error_on_double_map_val) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"key\": 0 1}"); }); } TEST(parse_json, error_on_double_map_val_quoted) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"key\": 0 \"1\"}"); }); } TEST(parse_json, error_on_double_map_val_quoted_2) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"key\": \"0\" 1}"); }); } TEST(parse_json, error_on_double_map_val_quoted_3) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"key\": \"0\" \"1\"}"); }); } TEST(parse_json, error_on_missing_seq_term) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("[foo, "); }); } TEST(parse_json, error_on_missing_map_val) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"foo\": }"); }); } TEST(parse_json, error_on_missing_map_term) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"foo\": 0"); }); } TEST(parse_json, error_on_missing_map_colon) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"foo\" }"); }); } TEST(parse_json, error_on_bad_map_val) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{\"foo\": , }"); }); } TEST(parse_json, error_on_wrong_key_character) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{'foo': 1}"); }); } TEST(parse_json, error_on_unquoted_key_character) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("{foo: 1}"); }); } TEST(parse_json, error_on_bare_keyval) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_json_in_arena("\"fails\": true"); }); } diff --git a/test/test_lib/test_case.cpp b/test/test_lib/test_case.cpp index b5e8323ec..a78577392 100644 --- a/test/test_lib/test_case.cpp +++ b/test/test_lib/test_case.cpp @@ -265,12 +265,12 @@ void ExpectError::check_success(Tree *tree, std::function fn) EXPECT_FALSE(context.m_got_an_error); } -void ExpectError::do_check(Tree const* tree, std::function fn, Location expected_location) +void ExpectError::check_error(Tree const* tree, std::function fn, Location expected_location) { - do_check(const_cast(tree), fn, expected_location); + check_error(const_cast(tree), fn, expected_location); } -void ExpectError::do_check(Tree *tree, std::function fn, Location expected_location) +void ExpectError::check_error(Tree *tree, std::function fn, Location expected_location) { auto context = ExpectError(tree, expected_location); C4_IF_EXCEPTIONS_(try, if(setjmp(s_jmp_env_expect_error) == 0)) @@ -311,7 +311,7 @@ void ExpectError::do_check(Tree *tree, std::function fn, Location expect void ExpectError::check_assertion(Tree *tree, std::function fn, Location expected_location) { #if RYML_USE_ASSERT - ExpectError::do_check(tree, fn, expected_location); + ExpectError::check_error(tree, fn, expected_location); #else C4_UNUSED(tree); C4_UNUSED(fn); diff --git a/test/test_lib/test_case.hpp b/test/test_lib/test_case.hpp index e85e964b1..68f7be328 100644 --- a/test/test_lib/test_case.hpp +++ b/test/test_lib/test_case.hpp @@ -203,9 +203,9 @@ struct ExpectError ExpectError(Tree *tree, Location loc={}); ~ExpectError(); - static void do_check( std::function fn, Location expected={}) { do_check((const Tree*)nullptr, fn, expected); } - static void do_check(Tree *tree, std::function fn, Location expected={}); - static void do_check(Tree const *tree, std::function fn, Location expected={}); + static void check_error( std::function fn, Location expected={}) { check_error((const Tree*)nullptr, fn, expected); } + static void check_error(Tree *tree, std::function fn, Location expected={}); + static void check_error(Tree const *tree, std::function fn, Location expected={}); static void check_assertion( std::function fn, Location expected={}) { check_assertion(nullptr, fn, expected); } static void check_assertion(Tree *tree, std::function fn, Location expected={}); static void check_success( std::function fn) { check_success(nullptr, fn); }; diff --git a/test/test_lib/test_engine.cpp b/test/test_lib/test_engine.cpp index f2870ee21..91dc75365 100644 --- a/test/test_lib/test_engine.cpp +++ b/test/test_lib/test_engine.cpp @@ -40,7 +40,7 @@ std::vector inject_comments(std::string const& src_) void test_expected_error_events_from_yaml(std::string const& parsed_yaml, Location const& expected_error_location) { - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ EventHandlerYamlStd::EventSink sink; EventHandlerYamlStd handler(&sink); handler.reset(); @@ -53,7 +53,7 @@ void test_expected_error_events_from_yaml(std::string const& parsed_yaml, Locati void test_expected_error_tree_from_yaml(std::string const& parsed_yaml, Location const& expected_error_location) { Tree tree = {}; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ EventHandlerTree handler(&tree, tree.root_id()); ASSERT_EQ(&tree, handler.m_tree); ParseEngine parser(&handler); diff --git a/test/test_lib/test_engine.hpp b/test/test_lib/test_engine.hpp index d749263d2..8ccbf3d3f 100644 --- a/test/test_lib/test_engine.hpp +++ b/test/test_lib/test_engine.hpp @@ -52,7 +52,7 @@ C4_NO_INLINE void test_new_parser_tree_from_events(ReferenceYaml const& yaml) { if(yaml.test_case_flags & HAS_CONTAINER_KEYS) { - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ Tree tree = {}; EventHandlerTree handler(&tree, tree.root_id()); EventProducerFn event_producer; diff --git a/test/test_lib/test_group.cpp b/test/test_lib/test_group.cpp index dddbed0a0..9d7ba3271 100644 --- a/test/test_lib/test_group.cpp +++ b/test/test_lib/test_group.cpp @@ -22,7 +22,7 @@ void YmlTestCase::_test_parse_using_ryml(CaseDataLineEndings *cd) if(c->flags & EXPECT_PARSE_ERROR) { auto flags = c->flags; - ExpectError::do_check(&cd->parsed_tree, [this, cd, flags](){ + ExpectError::check_error(&cd->parsed_tree, [this, cd, flags](){ parse_in_place(c->fileline, cd->src, &cd->parsed_tree); if(flags & RESOLVE_REFS) cd->parsed_tree.resolve(); diff --git a/test/test_location.cpp b/test/test_location.cpp index 561f1fdf7..734c59ea7 100644 --- a/test/test_location.cpp +++ b/test/test_location.cpp @@ -41,7 +41,7 @@ TEST(locations, default_is_no_location) TEST(locations, error_is_triggered_querying_with_locations_disabled) { bool parsed_ok = false; - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ Parser::handler_type evt_handler = {}; Parser parser(&evt_handler, ParserOptions().locations(false)); Tree t = parse_in_arena(&parser, "test", "foo: bar"); diff --git a/test/test_map.cpp b/test/test_map.cpp index 512cf1246..86fc386e0 100644 --- a/test/test_map.cpp +++ b/test/test_map.cpp @@ -275,7 +275,7 @@ TEST(simple_map, test_suite_UT92_0) TEST(simple_map, test_suite_UT92_1) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ csubstr yaml = R"( - { matches % : 20 } @@ -294,7 +294,7 @@ TEST(simple_map, test_suite_UT92_1) TEST(simple_map, two_nested_flow_maps_not_accepted_because_of_container_key) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_arena("{{}}", &tree); }); } @@ -309,7 +309,7 @@ TEST(simple_map, many_unmatched_brackets) for(size_t i = src.size(); i < num_brackets; ++i) src += '{'; Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_place(to_substr(src), &tree); }); } @@ -413,7 +413,7 @@ void verify_error_is_reported(csubstr case_name, csubstr yaml, LineCol lc={}) Location loc = {}; loc.line = lc.line; loc.col = lc.col; - ExpectError::do_check(&tree, [&](){ + ExpectError::check_error(&tree, [&](){ parse_in_arena(yaml, &tree); }, loc); } diff --git a/test/test_parser.cpp b/test/test_parser.cpp index cb5159c8d..5016956db 100644 --- a/test/test_parser.cpp +++ b/test/test_parser.cpp @@ -586,14 +586,14 @@ TEST(parse_in_arena, overloads) TEST(Parser, error_without_handler) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Parser parser{nullptr}; }); } TEST(parse_in_place, error_without_handler) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ EventHandlerTree evth; Parser parser{&evth}; parser.m_evt_handler = nullptr; @@ -604,7 +604,7 @@ TEST(parse_in_place, error_without_handler) TEST(parse_in_arena, error_without_handler) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ EventHandlerTree evth; Parser parser{&evth}; parser.m_evt_handler = nullptr; @@ -1272,7 +1272,7 @@ TEST_F(ParseToSeqFlowTest, whitespace__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_plain__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1292,7 +1292,7 @@ TEST_F(ParseToSeqFlowTest, val_plain__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_squo__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1312,7 +1312,7 @@ TEST_F(ParseToSeqFlowTest, val_squo__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_dquo__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1332,7 +1332,7 @@ TEST_F(ParseToSeqFlowTest, val_dquo__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_literal__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1352,7 +1352,7 @@ TEST_F(ParseToSeqFlowTest, val_literal_anchor__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_folded__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1372,7 +1372,7 @@ TEST_F(ParseToSeqFlowTest, val_folded__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, val_ref__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_ref), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1434,7 +1434,7 @@ TEST_F(ParseToSeqFlowTest, seq_blck__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, map_flow__to__seq_flow__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_flow), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1454,7 +1454,7 @@ TEST_F(ParseToSeqFlowTest, map_flow__to__seq_flow__new_child) TEST_F(ParseToSeqFlowTest, map_blck_plain__to__seq_blck__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_blck_plain), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1474,7 +1474,7 @@ TEST_F(ParseToSeqFlowTest, map_blck_plain__to__seq_blck__new_child) TEST_F(ParseToSeqFlowTest, map_blck_squo__to__seq_blck__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_blck_squo), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1494,7 +1494,7 @@ TEST_F(ParseToSeqFlowTest, map_blck_squo__to__seq_blck__new_child) TEST_F(ParseToSeqFlowTest, map_blck_dquo__to__seq_blck__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_blck_dquo), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1514,7 +1514,7 @@ TEST_F(ParseToSeqFlowTest, map_blck_dquo__to__seq_blck__new_child) TEST_F(ParseToSeqFlowTest, map_blck_literal__to__seq_blck__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_blck_literal), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1534,7 +1534,7 @@ TEST_F(ParseToSeqFlowTest, map_blck_literal__to__seq_blck__new_child) TEST_F(ParseToSeqFlowTest, map_blck_folded__to__seq_blck__root) { NodeRef dst = dst_seq_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_blck_folded), dst); }); _c4dbg_tree("actual", dst_seq_flow); @@ -1590,7 +1590,7 @@ TEST_F(ParseToMapFlowTest, whitespace__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_plain__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1610,7 +1610,7 @@ TEST_F(ParseToMapFlowTest, val_plain__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_plain_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain_anchor), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1630,7 +1630,7 @@ TEST_F(ParseToMapFlowTest, val_plain_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_plain_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain_tag), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1650,7 +1650,7 @@ TEST_F(ParseToMapFlowTest, val_plain_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_squo__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1670,7 +1670,7 @@ TEST_F(ParseToMapFlowTest, val_squo__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_squo_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo_anchor), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1690,7 +1690,7 @@ TEST_F(ParseToMapFlowTest, val_squo_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_squo_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo_tag), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1710,7 +1710,7 @@ TEST_F(ParseToMapFlowTest, val_squo_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_dquo__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1730,7 +1730,7 @@ TEST_F(ParseToMapFlowTest, val_dquo__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_dquo_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo_anchor), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1750,7 +1750,7 @@ TEST_F(ParseToMapFlowTest, val_dquo_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_dquo_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo_tag), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1770,7 +1770,7 @@ TEST_F(ParseToMapFlowTest, val_dquo_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_literal__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1790,7 +1790,7 @@ TEST_F(ParseToMapFlowTest, val_literal__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_literal_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal_anchor), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1810,7 +1810,7 @@ TEST_F(ParseToMapFlowTest, val_literal_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_literal_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal_tag), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1830,7 +1830,7 @@ TEST_F(ParseToMapFlowTest, val_literal_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_folded__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1850,7 +1850,7 @@ TEST_F(ParseToMapFlowTest, val_folded__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_folded_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded_anchor), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1870,7 +1870,7 @@ TEST_F(ParseToMapFlowTest, val_folded_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_folded_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded_tag), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1890,7 +1890,7 @@ TEST_F(ParseToMapFlowTest, val_folded_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, val_ref__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_ref), dst); }); _c4dbg_tree("actual", dst_map_flow); @@ -1910,7 +1910,7 @@ TEST_F(ParseToMapFlowTest, val_ref_to__map_flow__new_child) TEST_F(ParseToMapFlowTest, seq_flow__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow), dst); }); } @@ -1929,7 +1929,7 @@ TEST_F(ParseToMapFlowTest, seq_flow__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, seq_flow_anchor__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow_anchor), dst); }); } @@ -1948,7 +1948,7 @@ TEST_F(ParseToMapFlowTest, seq_flow_anchor__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, seq_flow_tag__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow_tag), dst); }); } @@ -1967,7 +1967,7 @@ TEST_F(ParseToMapFlowTest, seq_flow_tag__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, seq_blck__to__map_flow__root) { NodeRef dst = dst_map_flow.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_blck), dst); }); } @@ -2006,7 +2006,7 @@ TEST_F(ParseToMapFlowTest, map_flow__to__map_flow__new_child) TEST_F(ParseToMapFlowTest, map_flow__to__map_flow__new_child_no_key) { NodeRef dst = dst_map_flow.rootref().append_child(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_flow), dst); }); } @@ -2252,7 +2252,7 @@ class ParseToMapBlockTest : public ParseToNodeTest {}; TEST_F(ParseToMapBlockTest, val_plain__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2272,7 +2272,7 @@ TEST_F(ParseToMapBlockTest, val_plain__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_plain_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain_anchor), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2292,7 +2292,7 @@ TEST_F(ParseToMapBlockTest, val_plain_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_plain_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_plain_tag), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2312,7 +2312,7 @@ TEST_F(ParseToMapBlockTest, val_plain_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_squo__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2332,7 +2332,7 @@ TEST_F(ParseToMapBlockTest, val_squo__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_squo_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo_anchor), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2352,7 +2352,7 @@ TEST_F(ParseToMapBlockTest, val_squo_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_squo_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_squo_tag), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2372,7 +2372,7 @@ TEST_F(ParseToMapBlockTest, val_squo_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_dquo__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2392,7 +2392,7 @@ TEST_F(ParseToMapBlockTest, val_dquo__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_dquo_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo_anchor), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2412,7 +2412,7 @@ TEST_F(ParseToMapBlockTest, val_dquo_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_dquo_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_dquo_tag), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2432,7 +2432,7 @@ TEST_F(ParseToMapBlockTest, val_dquo_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_literal__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2452,7 +2452,7 @@ TEST_F(ParseToMapBlockTest, val_literal__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_literal_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal_anchor), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2472,7 +2472,7 @@ TEST_F(ParseToMapBlockTest, val_literal_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_literal_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_literal_tag), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2492,7 +2492,7 @@ TEST_F(ParseToMapBlockTest, val_literal_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_folded__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2512,7 +2512,7 @@ TEST_F(ParseToMapBlockTest, val_folded__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_folded_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded_anchor), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2532,7 +2532,7 @@ TEST_F(ParseToMapBlockTest, val_folded_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_folded_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_folded_tag), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2552,7 +2552,7 @@ TEST_F(ParseToMapBlockTest, val_folded_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, val_ref__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(val_ref), dst); }); _c4dbg_tree("actual", dst_map_blck); @@ -2572,7 +2572,7 @@ TEST_F(ParseToMapBlockTest, val_ref_to__map_flow__new_child) TEST_F(ParseToMapBlockTest, seq_flow__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow), dst); }); } @@ -2591,7 +2591,7 @@ TEST_F(ParseToMapBlockTest, seq_flow__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, seq_flow_anchor__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow_anchor), dst); }); } @@ -2610,7 +2610,7 @@ TEST_F(ParseToMapBlockTest, seq_flow_anchor__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, seq_flow_tag__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_flow_tag), dst); }); } @@ -2629,7 +2629,7 @@ TEST_F(ParseToMapBlockTest, seq_flow_tag__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, seq_blck__to__map_flow__root) { NodeRef dst = dst_map_blck.rootref(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(seq_blck), dst); }); } @@ -2668,7 +2668,7 @@ TEST_F(ParseToMapBlockTest, map_flow__to__map_flow__new_child) TEST_F(ParseToMapBlockTest, map_flow__to__map_flow__new_child_no_key) { NodeRef dst = dst_map_blck.rootref().append_child(); - ExpectError::do_check(dst.tree(), [&]{ + ExpectError::check_error(dst.tree(), [&]{ parse_in_arena(to_csubstr(map_flow), dst); }); } diff --git a/test/test_scalar_dquoted.cpp b/test/test_scalar_dquoted.cpp index b652f898e..8b90d83b4 100644 --- a/test/test_scalar_dquoted.cpp +++ b/test/test_scalar_dquoted.cpp @@ -706,7 +706,7 @@ void verify_error_is_reported(csubstr case_name, csubstr yaml, Location loc={}) SCOPED_TRACE(case_name); SCOPED_TRACE(yaml); Tree tree; - ExpectError::do_check(&tree, [&](){ + ExpectError::check_error(&tree, [&](){ parse_in_arena(yaml, &tree); }, loc); } diff --git a/test/test_scalar_folded.cpp b/test/test_scalar_folded.cpp index 3abbabca8..2d935186b 100644 --- a/test/test_scalar_folded.cpp +++ b/test/test_scalar_folded.cpp @@ -1735,7 +1735,7 @@ TEST(block_folded, test_suite_W4TN) TEST(block_folded, error_on_folded_in_seqflow) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("[\n >\n a\n,]"); }); } @@ -1744,7 +1744,7 @@ TEST(block_folded, error_on_folded_in_seqflow) TEST(block_folded, error_on_folded_in_mapflow) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("{\n b: >\n a\n,}"); }); } @@ -1753,13 +1753,13 @@ TEST(block_literal, indentation_indicator_0) { { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena(">0"); }); } { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena(">10"); }); } @@ -1801,13 +1801,13 @@ TEST(block_literal, indentation_indicator_1) { { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("--- >0"); }); } { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("--- >10"); }); } diff --git a/test/test_scalar_literal.cpp b/test/test_scalar_literal.cpp index 2bdecf145..a11103d15 100644 --- a/test/test_scalar_literal.cpp +++ b/test/test_scalar_literal.cpp @@ -1023,7 +1023,7 @@ TEST(block_literal, carriage_return) TEST(block_literal, errors_on_tab_indents) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_arena("foo: |4\n this is foo\n now with tab-\n \t \tmust not work\n", &tree); }); } @@ -1032,7 +1032,7 @@ TEST(block_literal, errors_on_tab_indents) TEST(block_literal, error_on_bad_spec_0) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("- |012abc\n must have errors above\n"); }); } @@ -1040,7 +1040,7 @@ TEST(block_literal, error_on_bad_spec_0) TEST(block_literal, error_on_bad_spec_1) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("- |0\n a\n"); }); } @@ -1048,7 +1048,7 @@ TEST(block_literal, error_on_bad_spec_1) TEST(block_literal, error_on_literal_in_seqflow) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("[\n |\n a\n,]"); }); } @@ -1056,7 +1056,7 @@ TEST(block_literal, error_on_literal_in_seqflow) TEST(block_literal, error_on_literal_in_mapflow) { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("{\n b: |\n a\n,}"); }); } @@ -1065,13 +1065,13 @@ TEST(block_literal, indentation_indicator_0) { { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("|0"); }); } { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("|10"); }); } @@ -1113,13 +1113,13 @@ TEST(block_literal, indentation_indicator_1) { { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("--- |0"); }); } { Tree t; - ExpectError::do_check(&t, [&t]{ + ExpectError::check_error(&t, [&t]{ t = parse_in_arena("--- |10"); }); } diff --git a/test/test_scalar_plain.cpp b/test/test_scalar_plain.cpp index 977779671..5f78b70c0 100644 --- a/test/test_scalar_plain.cpp +++ b/test/test_scalar_plain.cpp @@ -309,13 +309,13 @@ TEST(plain_scalar, issue153_map) TEST(plain_scalar, test_suite_BS4K) { Tree t; - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ t = parse_in_arena(R"(word1 # comment word2 word3 )"); }); - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ t = parse_in_arena(R"(word1 # comment word2 )"); diff --git a/test/test_scalar_squoted.cpp b/test/test_scalar_squoted.cpp index 3cd5b4bf2..93b71f8f6 100644 --- a/test/test_scalar_squoted.cpp +++ b/test/test_scalar_squoted.cpp @@ -278,7 +278,7 @@ void verify_error_is_reported(csubstr case_name, csubstr yaml, Location loc={}) SCOPED_TRACE(case_name); SCOPED_TRACE(yaml); Tree tree; - ExpectError::do_check(&tree, [&](){ + ExpectError::check_error(&tree, [&](){ parse_in_arena(yaml, &tree); }, loc); } @@ -289,7 +289,7 @@ void verify_filter_error_is_reported(csubstr case_name, csubstr scalar_, Locatio SCOPED_TRACE(scalar_); { Tree t; - ExpectError::do_check(&t, [&](){ + ExpectError::check_error(&t, [&](){ Parser::handler_type evt_handler = {}; Parser parser(&evt_handler); evt_handler.reset(&t, t.root_id()); @@ -303,7 +303,7 @@ void verify_filter_error_is_reported(csubstr case_name, csubstr scalar_, Locatio } { Tree t; - ExpectError::do_check(&t, [&](){ + ExpectError::check_error(&t, [&](){ Parser::handler_type evt_handler = {}; Parser parser(&evt_handler); evt_handler.reset(&t, t.root_id()); diff --git a/test/test_seq.cpp b/test/test_seq.cpp index 3dfd48690..aa35b5fc9 100644 --- a/test/test_seq.cpp +++ b/test/test_seq.cpp @@ -7,7 +7,7 @@ namespace yml { TEST(simple_seq, bad_seq1) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_arena(R"( --- [ a, b, c ] ] @@ -18,7 +18,7 @@ TEST(simple_seq, bad_seq1) TEST(simple_seq, bad_seq2) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_arena(R"( --- [ [ a, b, c ] @@ -48,7 +48,7 @@ TEST(simple_seq, many_unmatched_brackets) Location loc = {}; loc.line = 1; loc.col = num_brackets + 1u; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_place(to_substr(src), &tree); }, loc); } @@ -157,7 +157,7 @@ TEST(simple_seq, block_tab_tokens__3_tabs_everywhere) } TEST(simple_seq, block_tab_tokens__4_tabs_indentation_error) { - ExpectError::do_check([]{ + ExpectError::check_error([]{ Tree tree = parse_in_arena(R"( - 0 0 - 1 1 @@ -210,14 +210,14 @@ TEST(simple_seq, unterminated_seqimap) { SCOPED_TRACE("space after"); Tree t; - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ parse_in_arena("[a: "); }); } { SCOPED_TRACE("no space after"); Tree t; - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ parse_in_arena("[a:"); }); } diff --git a/test/test_serialize.cpp b/test/test_serialize.cpp index fe2dfdcdb..854727bcd 100644 --- a/test/test_serialize.cpp +++ b/test/test_serialize.cpp @@ -530,11 +530,11 @@ TEST(deserialize, issue434_0) int value = 0; EXPECT_FALSE(read(node, &value)); } - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ int value = 0; cnode >> value; }); - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ int value = 0; node >> value; }); @@ -546,11 +546,11 @@ TEST(deserialize, issue434_0) double value = 0; EXPECT_FALSE(read(node, &value)); } - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ double value = 0; cnode >> value; }); - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ double value = 0; node >> value; }); @@ -572,11 +572,11 @@ void test_deserialize_trailing_434(csubstr yaml, csubstr val, csubstr first, dou int value = {}; EXPECT_FALSE(read(node, &value)); } - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ int value = 1; cnode >> value; }); - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ int value = 1; node >> value; }); diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 194998e8c..d401ffdf1 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -494,7 +494,7 @@ struct TestSequenceData } else { - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ levels[i].parse_yaml_to_tree(); }); break; // because we expect error,we cannot go on to the next @@ -513,7 +513,7 @@ struct TestSequenceData } else { - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ levels[i].parse_json_to_tree(); }); break; // because we expect error,we cannot go on to the next @@ -535,7 +535,7 @@ struct TestSequenceData } else { - ExpectError::do_check([&]{ + ExpectError::check_error([&]{ levels[i].parse_yaml_to_events(); }); break; // because we expect error, we cannot go on to the next @@ -670,7 +670,7 @@ struct TestSequenceData //SKIP_IF(has_container_keys); // DO IT! if(m_expected_error_to_tree_checked) return; - ExpectError::do_check(&levels[0].tree_parsed_from_src, [this]{ + ExpectError::check_error(&levels[0].tree_parsed_from_src, [this]{ levels[0].parse_yaml_to_tree(); }); m_expected_error_to_tree_checked = true; @@ -681,7 +681,7 @@ struct TestSequenceData //SKIP_IF(has_container_keys); // DO IT! if(m_expected_error_to_events_checked) return; - ExpectError::do_check([this]{ + ExpectError::check_error([this]{ levels[0].parse_yaml_to_events(); }); m_expected_error_to_events_checked = true; diff --git a/test/test_tag_property.cpp b/test/test_tag_property.cpp index 27aab0551..27800d47e 100644 --- a/test/test_tag_property.cpp +++ b/test/test_tag_property.cpp @@ -464,7 +464,7 @@ TEST(tag_directives, accepts_multiple_spaces) void test_fail_tag_parsing(csubstr yaml) { Tree t; - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ t = parse_in_arena(yaml); }); } @@ -474,7 +474,7 @@ void test_fail_tag_resolve(csubstr yaml) Tree t; t = parse_in_arena(yaml); _c4dbg_tree(t); - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ t.resolve_tags(); }); } @@ -566,7 +566,7 @@ TEST(tag_directives, decode_uri_chars) { Tree t; auto checkerr = [&t](csubstr yaml){ - ExpectError::do_check(&t, [&]{ + ExpectError::check_error(&t, [&]{ t.clear(); t = parse_in_arena(yaml); t.resolve_tags(); @@ -1044,7 +1044,7 @@ TEST(tags, EHF6) TEST(tags, fuzzcrash0) { Tree tree; - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ parse_in_arena("%TAG !! " "\n" "})" "\n" "" "\n" diff --git a/test/test_tree.cpp b/test/test_tree.cpp index 7ebb23d56..1077f9346 100644 --- a/test/test_tree.cpp +++ b/test/test_tree.cpp @@ -1030,7 +1030,7 @@ void verify_assertion_(csubstr src, Function &&fn) template void verify_error_(Tree &tree, Function &&fn) { - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ (void)fn(tree); }); } @@ -1038,7 +1038,7 @@ template void verify_error_(csubstr src, Function &&fn) { Tree tree = parse_in_arena(src); - ExpectError::do_check(&tree, [&]{ + ExpectError::check_error(&tree, [&]{ (void)fn(tree); }); } @@ -4145,7 +4145,7 @@ TEST(Tree, add_tag_directives) check_up_to(3); t.add_tag_directive(td[3]); check_up_to(4); - ExpectError::do_check(&t, [&]{ // number exceeded + ExpectError::check_error(&t, [&]{ // number exceeded t.add_tag_directive(td[4]); }); t.clear_tag_directives();