diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-09 19:20:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 19:20:53 +0200 |
commit | aaa55dfac12a79a7074bfd97c8ee2859bb1fbe53 (patch) | |
tree | 863c635081277814250bbca958ea6e74100ca65b /main/tests | |
parent | 7bb2215ed0d7415179a8b59ad4766a3b573cf696 (diff) | |
parent | 5ca74604217758d91e344b052fe87c9eda8940a9 (diff) |
Merge pull request #31216 from YeldhamDev/err_msg_main_servers
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories
Diffstat (limited to 'main/tests')
-rw-r--r-- | main/tests/test_gdscript.cpp | 14 | ||||
-rw-r--r-- | main/tests/test_math.cpp | 6 |
2 files changed, 4 insertions, 16 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index e82af93293..b2b2c22bf9 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -300,14 +300,11 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) { } break; default: { - String error = "Parser bug at " + itos(p_expr->line) + ", invalid expression type: " + itos(p_expr->type); - ERR_EXPLAIN(error); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Parser bug at " + itos(p_expr->line) + ", invalid expression type: " + itos(p_expr->type)); } } return txt; - //return "("+txt+")"; } static void _parser_show_block(const GDScriptParser::BlockNode *p_block, int p_indent) { @@ -910,8 +907,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String if (incr == 0) { - ERR_EXPLAIN("unhandled opcode: " + itos(code[ip])); - ERR_BREAK(true); + ERR_BREAK_MSG(true, "Unhandled opcode: " + itos(code[ip])); } ip += incr; @@ -936,11 +932,7 @@ MainLoop *test(TestType p_type) { } FileAccess *fa = FileAccess::open(test, FileAccess::READ); - - if (!fa) { - ERR_EXPLAIN("Could not open file: " + test); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!fa, NULL, "Could not open file: " + test); Vector<uint8_t> buf; int flen = fa->get_len(); diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index f341159079..68ecb2b1b2 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -494,11 +494,7 @@ MainLoop *test() { } FileAccess *fa = FileAccess::open(test, FileAccess::READ); - - if (!fa) { - ERR_EXPLAIN("Could not open file: " + test); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!fa, NULL, "Could not open file: " + test); Vector<uint8_t> buf; int flen = fa->get_len(); |