rlExpected := 1.0 / 0.0; // results in NaN AssertEquals_REAL(0.0, rlExpected, 0.0001, 'comparison of a valid REAL and NaN should fail');
A comparison between a float value and NaN should be a fail.
Comparison between NaN, +Inf, -Inf should also be supported. If both Expected and Actual are NaN (etc) it should pass.
The test passed.
A note about this.
It seems that if all the variables in the function I'm testing are
0.0
then the math can returnNaN
however if only the divisor (rl2
) is0.0
then the controller will throw a divide-by-zero exception.It is interesting the things you discover as you create more test cases. (Thanks for your work on this library <3 )
Last edit: jtebokkel 2022-03-09
Hi John,
We are aware that certain details in the framework are sub optimal. However, that said, every tip/hint we get to optimise is one step in the right direction.
So, since you found this issue, I hope you could also submit a patch which catches the Not A Number status and yields a fail in the assert.
You can submit your patch in multiple ways. My suggestion would be that you just drop a code here in the Ticket. The reason behind this because I dont know if you hvae the Professional Developer Edition with Git , since we stepped over from SVN to git.
PS Have you found it in v1200?
See the attached files.
Yes, this is in v1.2.0.0