You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is an issue with the macro UtAssert_DoubleCmpRel in the file osal/ut_assert/inc/utassert.h. If the input x is a positive number, then the test will always pass (assuming that Ratio is positive). Recommend changing this macro to
Create unit test where the first input to UtAssert_DoubleCmpRel is a large positive number (e.g., 1e3), the second input is a large negative number (e.g., -1e3), and the third input is a very small positive number (e.g., 1e-10).
Expected behavior
The output of UtAssert_DoubleCmpRel is success even though the first and second inputs are very different.
System observed on:
N/A
Reporter Info
Nathan Stacey, NASA GSFC
The text was updated successfully, but these errors were encountered:
Describe the bug
There is an issue with the macro UtAssert_DoubleCmpRel in the file osal/ut_assert/inc/utassert.h. If the input x is a positive number, then the test will always pass (assuming that Ratio is positive). Recommend changing this macro to
#define UtAssert_DoubleCmpRel(x, y, Ratio, ...)
UtAssertEx((fabs(((x) - (y)) / (x)) <= (Ratio)), UtAssert_GetContext(), FILE, LINE, VA_ARGS)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The output of UtAssert_DoubleCmpRel is success even though the first and second inputs are very different.
System observed on:
N/A
Reporter Info
Nathan Stacey, NASA GSFC
The text was updated successfully, but these errors were encountered: