Skip to main content

andMaskIsEqualTo

Short summary

This assertion method checks if the result current value bitwise AND mask is equal to the expected value

Parameters

NameTypeCommentKind
currentValueBYTEcurrent value to checkinput
maskBYTE2nd operand for bitwise operationinput
expectedValueBYTEexpected result after maskinginput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD andMaskIsEqualTo
VAR_INPUT
(* current value to check *)
currentValue :BYTE;
(* 2nd operand for bitwise operation *)
mask :BYTE;
(* expected result after masking *)
expectedValue :BYTE;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR

Implementation

IF ((currentValue AND mask) <> expectedValue) THEN
THIS^.assertionWasWrong(message, THIS^.getDebugInfo('andMaskIsEqualTo'));
END_IF