Skip to main content

bitXIsNotEqualTo

Short summary

This assertion method checks if the selected bit of current value is not equal to the unexpected value

Parameters

NameTypeCommentKind
currentValueBYTEcurrent value to checkinput
numberBitNumberBytenumber of bit to checkinput
unexpectedValueBOOLunexpected value of bitinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD bitXIsNotEqualTo
VAR_INPUT
(* current value to check *)
currentValue :BYTE;
(* number of bit to check *)
number :BitNumberByte;
(* unexpected value of bit *)
unexpectedValue :BOOL;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation

IF (
TO_BOOL(
TO_BYTE(SHL(THIS^.LSB, number))
AND currentValue
) = unexpectedValue
) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('bitXIsNotEqualTo'));
END_IF