Bug #511

qa_ctcss_squelch test is failing

Added by Ben Reynwar about 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:01/31/2013
Priority:HighDue date:
Assignee:Tom Rondeau% Done:


Target version:release-3.6.4


qa_ctcss_squelch test is failing in current master

qa_ctcss_fix.patch Magnifier (881 Bytes) Tom Rondeau, 02/05/2013 10:44 pm


#1 Updated by Tom Rondeau about 3 years ago

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.

#2 Updated by Ben Reynwar about 3 years ago

That fixed the bug for me.

#3 Updated by Johnathan Corgan about 3 years ago

  • Status changed from Feedback to Resolved
  • Assignee set to Tom Rondeau
  • Target version set to release-3.6.4
  • Resolution set to fixed

Fixed in 40c9245a

#4 Updated by Ben Reynwar almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF