Bug #511

qa_ctcss_squelch test is failing

Added by Ben Reynwar 5 months ago. Updated 4 months ago.

Status:Closed Start date:01/31/2013
Priority:High Due date:
Assignee:Tom Rondeau % Done:

0%

Category:gr-analog
Target version:release-3.6.4
Resolution:fixed

Description

qa_ctcss_squelch test is failing in current master

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

History

Updated by Tom Rondeau 4 months 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.

Updated by Ben Reynwar 4 months ago

That fixed the bug for me.

Updated by Johnathan Corgan 4 months 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

Updated by Ben Reynwar 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF