TeXworks / texworks

Main codebase for TeXworks, a simple interface for working with TeX documents
https://tug.org/texworks/
GNU General Public License v2.0
697 stars 127 forks source link

test_UI fails because 112,38 != 112,39 #1023

Open jlaurens opened 1 year ago

jlaurens commented 1 year ago

Bug description:

On macOS Ventura 13.3.1(a) this test sometimes fails. The first idea is to replace QCOMPARE with a less strict equality test.

I will post a pull request soon.

stloeffler commented 1 year ago

According to the Qt docs, "When comparing floating-point types (float, double, and qfloat16), qFuzzyCompare() is used for finite values." So there is no strict equality for floating point numbers anyway. From a binary point of view, float (i.e. IEEE 754 binary32) has (slightly more than) 7 decimal digits of accuracy, so 112,28 is indeed significantly different from 112,39 from a numeric point of view (difference in the 5th digit). It would be helpful to know which particular test in test_UI actually fails, as I couldn't find either of the mentioned numbers as hard-coded values.