FB_AdjustAssertFailureMessageToMax253CharLength  Function Block

This function block is responsible for making sure that the asserted test instance path and test message are not loo long. The total printed message can not be more than 253 characters long.


Inputs

Name Type Description
TestInstancePath T_MaxString
TestMessage T_MaxString

Outputs

Name Type Description
TestInstancePathProcessed T_MaxString
TestMessageProcessed T_MaxString

Variables

Name Type Default Description
TestInstancePathTemporary T_MaxString
MESSAGE_FORMATTED_STRING_MAX_NUMBER_OF_CHARACTERS INT 253 This is actually 254, but if StrArg-argument is used (which it is in TcUnit) it is 253.
TEST_NAME_TOO_LONG STRING '...TestName too long'
TEST_MESSAGE_TOO_LONG STRING '...TestMsg too long'
Declaration source
(*
    This function block is responsible for making sure that the asserted test instance path and test message are not
    loo long. The total printed message can not be more than 253 characters long.
*)
FUNCTION_BLOCK FB_AdjustAssertFailureMessageToMax253CharLength
VAR_INPUT
    TestInstancePath : T_MaxString;
    TestMessage : T_MaxString;
END_VAR
VAR_OUTPUT
    TestInstancePathProcessed : T_MaxString;
    TestMessageProcessed : T_MaxString;
END_VAR
VAR_TEMP
    TestInstancePathTemporary : T_MaxString;
END_VAR
VAR CONSTANT
    MESSAGE_FORMATTED_STRING_MAX_NUMBER_OF_CHARACTERS : INT := 253; // This is actually 254, but if StrArg-argument is used (which it is in TcUnit) it is 253.
    TEST_NAME_TOO_LONG : STRING := '...TestName too long';
    TEST_MESSAGE_TOO_LONG : STRING := '...TestMsg too long';
END_VAR