diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-12-09 11:43:25 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-09 12:52:53 +0000 |
commit | f2f9786e6194725bf48ee3833b1fdf9603b74e69 (patch) | |
tree | 8d7796d5fe9ff43b9acc998c0ba6d1bdb727a39b /tests | |
parent | 92d09ed79e5615c50ad565654ff3c0bcdb773230 (diff) |
Round expected event coordinates in Button's events test
The test expects 20.5 but gets 21 when run with a 4K monitor on
Ubuntu 15.10.
Change-Id: I1a71ee8614dcb86a595fd2832f89e0db617f677e
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_button.qml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_button.qml b/tests/auto/controls/data/tst_button.qml index 9d2e2502..1faf1956 100644 --- a/tests/auto/controls/data/tst_button.qml +++ b/tests/auto/controls/data/tst_button.qml @@ -197,7 +197,7 @@ TestCase { verify(control.activeFocus) mousePress(control, control.width / 2, control.height / 2, Qt.LeftButton) - var expected = { x: control.width / 2, y: control.height / 2, button: Qt.LeftButton, buttons: Qt.LeftButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } + var expected = { x: Math.round(control.width / 2), y: Math.round(control.height / 2), button: Qt.LeftButton, buttons: Qt.LeftButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } compare(control.lastPress, expected, eventErrorMessage(control.lastPress, expected)) compare(control.lastRelease, undefined) compare(control.lastClick, undefined) @@ -215,16 +215,16 @@ TestCase { mouseRelease(control, control.width / 4, control.height / 4, Qt.LeftButton) compare(control.lastPress, undefined) - expected = { x: control.width / 4, y: control.height / 4, button: Qt.LeftButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } + expected = { x: Math.round(control.width / 4), y: Math.round(control.height / 4), button: Qt.LeftButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } compare(control.lastRelease, expected, eventErrorMessage(control.lastRelease, expected)) - expected = { x: control.width / 4, y: control.height / 4, button: Qt.LeftButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: true } + expected = { x: Math.round(control.width / 4), y: Math.round(control.height / 4), button: Qt.LeftButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: true } compare(control.lastClick, expected, eventErrorMessage(control.lastClick, expected)) compare(control.lastDoubleClick, undefined) control.reset() keyPress(Qt.Key_Space) - expected = { x: control.width / 2, y: control.height / 2, button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } + expected = { x: Math.round(control.width / 2), y: Math.round(control.height / 2), button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } compare(control.lastPress, expected, eventErrorMessage(control.lastPress, expected)) compare(control.lastRelease, undefined) compare(control.lastClick, undefined) @@ -234,9 +234,9 @@ TestCase { keyRelease(Qt.Key_Space) compare(control.lastPress, undefined) - expected = { x: control.width / 2, y: control.height / 2, button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } + expected = { x: Math.round(control.width / 2), y: Math.round(control.height / 2), button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: false } compare(control.lastRelease, expected, eventErrorMessage(control.lastRelease, expected)) - expected = { x: control.width / 2, y: control.height / 2, button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: true } + expected = { x: Math.round(control.width / 2), y: Math.round(control.height / 2), button: Qt.NoButton, buttons: Qt.NoButton, modifiers: Qt.NoModifier, wasHeld: false, isClick: true } compare(control.lastClick, expected, eventErrorMessage(control.lastClick, expected)) compare(control.lastDoubleClick, undefined) |