Ticket #7391 (closed: fixed)
Bug in workspace bin comparisons
Reported by: | Russell Taylor | Owned by: | Russell Taylor |
---|---|---|---|
Priority: | major | Milestone: | Release 2.6 |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Owen Arnold |
Description
There's a bug in line 403 of WorkspaceOpOverloads.cpp:
else if ( std::abs(commonSum-sum)/std::max<double>(commonSum,sum) > 1.0E-7 ) return false;
In the case where both commonSum & sum are negative, the comparison will always fail. There are a couple of other places in the same file that also have this problem.
This bug has been there for years, but was spotted while investigating #3390.
Change History
comment:2 Changed 7 years ago by Russell Taylor
Re #7391. Add tests for negative bin boundaries sum bug.
Changeset: ffb76371d755366fcca43a56e3f09ef69d8f7587
comment:3 Changed 7 years ago by Russell Taylor
Re #7391. Take absolute value of sum of bin boundaries.
This fixes a bug if the sum of the bin boundaries is negative (in which case the tests would always evaluate to false).
Changeset: 9811ef92aa72f3db27239ddb9c5131d33729ed9a
comment:4 Changed 7 years ago by Russell Taylor
Re #7391. Change tab indentation to spaces. No code changed.
Changeset: f5dac7c2e1e48453548aaf1be3b4dba08bf503e2
comment:5 Changed 7 years ago by Russell Taylor
- Status changed from accepted to verify
- Resolution set to fixed
Test by inspecting the code and the tests. Branch is bugfix/7391_bin_commonality.
When wanting to add a test case for this bug, I realised that there were no unit tests at all for the code in this file - #7392 is concerned with that.
comment:6 Changed 7 years ago by Owen Arnold
- Status changed from verify to verifying
- Tester set to Owen Arnold