diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-12-11 10:47:18 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2017-12-13 11:02:04 +0000 |
commit | d297dfd0641e6608386205d99a0518726c315867 (patch) | |
tree | 9c1ba182f3e3ae39a9194cd2b3fde37e099b4a76 /tests | |
parent | f2347407964bed0e88826f3eb8303bbad46297db (diff) |
tst_inputpanel: don't rely on index var being valid after first loop
In Qt 5.10 this code would work, but in dev inputIndex is null.
It might be a regression or it might be a fix to comply with the
standard, but either way, we should be explicit in the test and
initialize the variable in the for loop's initial expression.
Task-number: QTBUG-64988
Change-Id: Idf6019307a02a32dcb6237e2e83e5a9cd512df3d
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 89bd1d70..61d6f509 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -1048,7 +1048,7 @@ Rectangle { // Remove Jamos one by one. // The number of removed characters must match to the number of Jamos entered. - for (; inputIndex >= 0; inputIndex--) { + for (inputIndex = data.inputSequence.length - 1; inputIndex >= 0; inputIndex--) { compare(textInput.text, intermediateResult.pop()) inputPanel.virtualKeyClick(Qt.Key_Backspace) } |