Skip to main content

lsbIsEqualTo

Short summary

This assertion method checks if the least significant bit of current value is equal to the expected value

Parameters

NameTypeCommentKind
currentValueBYTEcurrent value to checkinput
expectedValueBOOLexpected value of lsbinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD lsbIsEqualTo
VAR_INPUT
(* current value to check *)
currentValue :BYTE;
(* expected value of lsb *)
expectedValue :BOOL;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation

IF (TO_BOOL(currentValue AND THIS^.LSB) <> expectedValue) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('lsbIsEqualTo'));
END_IF