saxbophone / arby

Arbitrary precision arithmetic in C++, even at compile-time
https://saxbophone.com/arby/
Mozilla Public License 2.0
8 stars 1 forks source link

Investigate leading-zero trap bug #90

Closed saxbophone closed 2 years ago

saxbophone commented 2 years ago

Strangely, this one only occurs when the test executable is run directly (and not when run with ctest), hence it not being picked up in CI.

-------------------------------------------------------------------------------
arby::Nat::from_float() with positive value
-------------------------------------------------------------------------------
/Users/joshua/dev/arby/tests/casting.cpp:59
...............................................................................

/Users/joshua/dev/arby/tests/casting.cpp:61: FAILED:
due to unexpected exception with message:
  leading zeroes in internal representation
saxbophone commented 2 years ago

I've since now managed to write a failing test case for this that fails both with ctest and when the test executable is run directly. The cause of the discrepancy is likely due to different random number generator states causing the problem value to appear in one environment but not in another.