bitXIsEqualTo
Short summary
This assertion method checks if the selected bit of current value is equal to the expected value
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| currentValue | BYTE | current value to check | input |
| number | BitNumberByte | number of bit to check | input |
| expectedValue | BOOL | expected value of bit | input |
| message | AssertMessage | message if the assertion is false | input |
Code
Declaration
METHOD bitXIsEqualTo
VAR_INPUT
(* current value to check *)
currentValue :BYTE;
(* number of bit to check *)
number :BitNumberByte;
(* expected value of bit *)
expectedValue :BOOL;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR
Implementation
IF (
TO_BOOL(
TO_BYTE(SHL(THIS^.LSB, number))
AND currentValue
) <> expectedValue
) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('bitXIsEqualTo'));
END_IF