qa_ctcss_squelch test is failing
|Assignee:||Tom Rondeau||% Done:|
qa_ctcss_squelch test is failing in current master
#1 Updated by Tom Rondeau about 3 years ago
- File qa_ctcss_fix.patch added
- Status changed from New to Feedback
It appears that different OSes, or more likely compilers, handle floats slightly differently (which we've known). In this case, the tests for whether or not to mute the signal is done by comparing the 'same' number, which in reality turn out to be different in the millionths place (for example, 0.2 < 0.2 = 1 because the first value is actually 0.200001, or something).
The attached patch solves this issue by rounding to 5 decimal places, so we should be good enough for minor differences like we're seeing now. The rounding is done by multiplying by N, taking the floor, and then dividing by N. We could possibly just multiply everything by N, take the floor for the right ones, and compare those to avoid the division.