Hello,
I have encountered some failing tests in fedora builds of sonic-visualiser-2.4.1 on s390(x) and ppc64(le). I hope this is correct place to report this issue, and propose fix.
Failing tests
"QCOMPARE(rm.getValueForPositionUnclamped(0), 0.0);
QCOMPARE(rm.getValueForPositionUnclamped(9), 0.0);"
from TestRangeMapper.h with:
"
.
.
.
FAIL! : TestRangeMapper::linearUpBackward() Compared doubles are not the same (fuzzy compare)
Actual (rm.getValueForPositionUnclamped(0)): -2.23517e-08
Expected (0.0) : 0
Loc: [o/../TestRangeMapper.h(80)]
FAIL! : TestRangeMapper::linearDownBackward() Compared doubles are not the same (fuzzy compare)
Actual (rm.getValueForPositionUnclamped(9)): -2.23517e-08
Expected (0.0) : 0
Loc: [o/../TestRangeMapper.h(96)]
.
.
.
"
Tests fail due QCOMPARE is using qFuzzyCompare to compare floats internally, which may fail when one of a compared value is 0.0(documented behaviour, but bit perplexing as it's not affecting x86 in this case, probably rounding error...).
QT docs/bug:
http://qt-project.org/doc/qt-5/qtglobal.html#qFuzzyCompare-10
http://qt-project.org/doc/qt-5/qtest.html#QCOMPARE
https://bugreports.qt-project.org/browse/QTBUG-16819
Proposed workaround from documentation is not working, as it results in 1!=1. But using qFuzzyIsNull(undocumented, but used/recommended(see up mentioned bug)) in combination with QVERIFY result in tests pass on all Fedora architectures.
In attachment is patch doing these changes.
Also I have filed fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=1161119 (nearly identical to this email).
Best regards,
Jakub Čajka |