summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-07 14:43:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-07 14:43:59 +0200
commit62b066dbd62e98c78e16769d4203d31b42e1d26e (patch)
tree6d5a61029805f68845ed5642bada4ef89a2eb8e0 /modules
parent58ca3031419cacb35c530cebe68e87a4c27dde06 (diff)
Fix more MSVC C4702 (unreachable code) warnings
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/tests/gdscript_test_runner.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp
index 6c346acb7e..15131afde7 100644
--- a/modules/gdscript/tests/gdscript_test_runner.cpp
+++ b/modules/gdscript/tests/gdscript_test_runner.cpp
@@ -479,9 +479,9 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
result.output = get_text_for_status(result.status) + "\n";
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
- for (const GDScriptParser::ParserError &E : errors) {
- result.output += E.message + "\n"; // TODO: line, column?
- break; // Only the first error since the following might be cascading.
+ if (!errors.is_empty()) {
+ // Only the first error since the following might be cascading.
+ result.output += errors[0].message + "\n"; // TODO: line, column?
}
if (!p_is_generating) {
result.passed = check_output(result.output);
@@ -498,9 +498,9 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
result.output = get_text_for_status(result.status) + "\n";
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
- for (const GDScriptParser::ParserError &E : errors) {
- result.output += E.message + "\n"; // TODO: line, column?
- break; // Only the first error since the following might be cascading.
+ if (!errors.is_empty()) {
+ // Only the first error since the following might be cascading.
+ result.output += errors[0].message + "\n"; // TODO: line, column?
}
if (!p_is_generating) {
result.passed = check_output(result.output);