# HG changeset patch # User Chris Cannam # Date 1484313157 0 # Node ID bbc4e4ee15d5f7a9cc52c8f78ac2dfff321fd1b6 # Parent 3382d914e1109e33c2fead4dc8eba898a1fb1807 Fix spurious test failure in 32-bit build diff -r 3382d914e110 -r bbc4e4ee15d5 base/test/TestPitch.h --- a/base/test/TestPitch.h Fri Jan 13 10:29:44 2017 +0000 +++ b/base/test/TestPitch.h Fri Jan 13 13:12:37 2017 +0000 @@ -86,22 +86,22 @@ { double centsOffset = 0.0; QCOMPARE(Pitch::getPitchForFrequency(MIDDLE_C, ¢sOffset), 60); - QCOMPARE(centsOffset, 0.0); + QCOMPARE(centsOffset + 1.0, 1.0); // avoid ineffective fuzzy-compare to 0 QCOMPARE(Pitch::getPitchForFrequency(261.0, ¢sOffset), 60); QCOMPARE(int(centsOffset), -4); QCOMPARE(Pitch::getPitchForFrequency(440.0, ¢sOffset), 69); - QCOMPARE(centsOffset, 0.0); + QCOMPARE(centsOffset + 1.0, 1.0); } void pitchForFrequencyF() { float centsOffset = 0.f; QCOMPARE(Pitch::getPitchForFrequency(MIDDLE_C, ¢sOffset), 60); - QCOMPARE(centsOffset, 0.f); + QCOMPARE(centsOffset + 1.f, 1.f); // avoid ineffective fuzzy-compare to 0 QCOMPARE(Pitch::getPitchForFrequency(261.0, ¢sOffset), 60); QCOMPARE(int(centsOffset), -4); QCOMPARE(Pitch::getPitchForFrequency(440.0, ¢sOffset), 69); - QCOMPARE(centsOffset, 0.f); + QCOMPARE(centsOffset + 1.f, 1.f); } };