Describe the bug
'Port_851' (851): Exception (Exception Code: 0xc0000090, FPU invalid operation) in PLC Application PLC1 Instance, Task PlcTask (RBP: 0xe464a0f010, RIP: 0x2d6b9e6d621, RSP: 0xe464a0ebe0), Area 1, Offset 0x33301
In FB_AssertResultStatic.ReportResult, the data from previous assertions is compared to the current one. In this comparison in F_IsAnyEqualToUnionValue, a byte sequence of an expected or actual value of a previous test may be interpreted falsely as NaN when executing an assertion with REAL or LREAL. A NaN check is missing.
Additionally, the type of the expected/actual value should be stored in the ST_AssertResult to circumvent useless comparisons, because otherwise, values could falsely be interpreted as already existing although being of different type. This would already solve my issue, but not remove the bug. Therefore, 2 fixes are required.
Furthermore, AND_THEN should be used in the IF condition for performance increase.
To Reproduce
Execute a DINT assertion with expected -7777777, which is 0xFF89520F, which represents NaN in 32bit IEEE754.
Execute a REAL assertion afterwards. It will raise the exception.
Expected behavior
No exception.
Software versions
TcUnit library: 1.3.1. with unmerged changes.
XAE: 3.1.4026.18
Run environment
Usermode Runtime 3.1.4026.18
Describe the bug
'Port_851' (851): Exception (Exception Code: 0xc0000090, FPU invalid operation) in PLC Application PLC1 Instance, Task PlcTask (RBP: 0xe464a0f010, RIP: 0x2d6b9e6d621, RSP: 0xe464a0ebe0), Area 1, Offset 0x33301
In
FB_AssertResultStatic.ReportResult, the data from previous assertions is compared to the current one. In this comparison inF_IsAnyEqualToUnionValue, a byte sequence of an expected or actual value of a previous test may be interpreted falsely as NaN when executing an assertion with REAL or LREAL. A NaN check is missing.Additionally, the type of the expected/actual value should be stored in the
ST_AssertResultto circumvent useless comparisons, because otherwise, values could falsely be interpreted as already existing although being of different type. This would already solve my issue, but not remove the bug. Therefore, 2 fixes are required.Furthermore,
AND_THENshould be used in theIFcondition for performance increase.To Reproduce
Execute a DINT assertion with expected
-7777777, which is0xFF89520F, which representsNaNin 32bit IEEE754.Execute a REAL assertion afterwards. It will raise the exception.
Expected behavior
No exception.
Software versions
TcUnit library: 1.3.1. with unmerged changes.
XAE: 3.1.4026.18
Run environment
Usermode Runtime 3.1.4026.18