aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-01-20 07:01:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-21 01:18:50 +0000
commit633cf1faf580cf8984c7c6f4a623c8821cb5044b (patch)
tree067f7bc5e74a7f6fbfc1b378332ce4a6015e038d /tests
parent8fdcbd60e4d520fbfd4683cb6fe2350144ef2ca9 (diff)
Test262Runner: fix -Wunused-but-set-variable
The 'int line' variable is shadowed a few lines below by the 'QByteArray line' one, even in the initial commit, so it can never have been used, except for the increment in the first line of the loop's bodies. Remove the variable, fix the warning. Found by Clang 15: test262runner.cpp:380:9: warning: variable 'line' set but not used [-Wunused-but-set-variable] int line = 0; ^ Amends d9c4a527241e0ef3a30e990c518197b0ba345b50. Change-Id: I2139aa4552d1ff2ddbb5737e2a1b26650d6519e7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9d04888c9cb8a89f17279da6ed9b9f65a49a94b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
index 9fe2de5368..2b6145030b 100644
--- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
+++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
@@ -393,9 +393,7 @@ void Test262Runner::loadTestExpectations()
return;
}
- int line = 0;
while (!file.atEnd()) {
- ++line;
QByteArray line = file.readLine().trimmed();
if (line.startsWith('#') || line.isEmpty())
continue;
@@ -440,9 +438,7 @@ void Test262Runner::updateTestExpectations()
QTemporaryFile updatedExpectations;
updatedExpectations.open();
- int line = 0;
while (!file.atEnd()) {
- ++line;
QByteArray originalLine = file.readLine();
QByteArray line = originalLine.trimmed();
if (line.startsWith('#') || line.isEmpty()) {