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
Is your feature request related to a problem? Please describe.
Using a UINT32 comparison for smaller uint types does not allow for roll-over situations that are considered a pass condition:
Describe the solution you'd like
A UINT8 comparison could provide an output like this:
🟢[ PASS] 01.001 a_test.c:5 - Some_uint8_ValueUnderTest (0) == UnknownStartValueThatHappensToBeMax_uint8 + 1 (0)
Additionally, use could be made of the desc argument in the actual call (UtAssert_GenericUnsignedCompare) to distinguish it from a UINT32 call and add pertinent information for the developer:
🟢[ PASS] 01.001 a_test.c:5 - Compare UINT8: SomeValueUnderTest (0) == UnknownStartValueThatHappensToBeMax + 1 (0)
Describe alternatives you've considered
Adding a typecast to every assert:
Is your feature request related to a problem? Please describe.
Using a UINT32 comparison for smaller uint types does not allow for roll-over situations that are considered a pass condition:
outputs:
🔴[ FAIL] 01.001 a_test.c:5 - Some_uint8_ValueUnderTest (0) == UnknownStartValueThatHappensToBeMax_uint8 + 1 (256)
Describe the solution you'd like
A UINT8 comparison could provide an output like this:
🟢[ PASS] 01.001 a_test.c:5 - Some_uint8_ValueUnderTest (0) == UnknownStartValueThatHappensToBeMax_uint8 + 1 (0)
Additionally, use could be made of the desc argument in the actual call (UtAssert_GenericUnsignedCompare) to distinguish it from a UINT32 call and add pertinent information for the developer:
🟢[ PASS] 01.001 a_test.c:5 - Compare UINT8: SomeValueUnderTest (0) == UnknownStartValueThatHappensToBeMax + 1 (0)
Describe alternatives you've considered
Adding a typecast to every assert:
which does provide decent output:
🟢[ PASS] 01.001 a_test.c:5 - (uint8)SomeValueUnderTest (0) == (uint8)(UnknownStartValueThatHappensToBeMax + 1) (0)
Additional context
The requirement for adding a typecast becomes cumbersome over time, but writing a line like this is simpler:
and will provide just as much clarity, if not more.
Requester Info
Alan Gibson
NASA/GSFC 587
The text was updated successfully, but these errors were encountered: