diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-07-14 14:18:29 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-07-14 14:22:26 +0000 |
commit | dab15388527d68e8a72494cb3e28c17aab86d4e7 (patch) | |
tree | a8751af7a9685cc830d14813349705fafca77558 /src/imports/controls | |
parent | f66d6116b0fb84982b004e282bea9bfcfbc1f950 (diff) |
Fix tst_QQuickMenu::subMenuPosition()
We're still getting failures after QCOMPARE was fixed
(in c78a960198d59fb9a9ddd83ad7098b1db396edfd):
FAIL! : tst_QQuickMenu::Material::subMenuPosition(cascading,flip) Compared doubles are not the same (fuzzy compare)
Actual (subSubMenu1->popupItem()->x()) : 3.88240550819e-11
Expected (subMenu1->popupItem()->x() - subSubMenu1->width() + overlap): 0
tst_qquickmenu.cpp(1532) : failure location
Quoting Eddy:
"[...] the threshold for double equality is one part in 1e12; the
threshold for fuzzy-is-zero is likewise 1e-12; so 3e-11 is non-zero.
One work-around, of course, would be to cast float(each operand) so as
to get float's wider tolerance (one part in 100,000, null if less than
1e-5)."
So that's what we do in this patch.
Change-Id: Iecf1b6f4b2cf2c81eb652bb0f565ac682b024dae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4b61d6f52b166ca2b4a2e38a2fc60d631372f6a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/imports/controls')
0 files changed, 0 insertions, 0 deletions