[r140]: / trunk / Library / POUs / FB_AdjustAssertFailureMessageToMax252CharLength / svnobj  Maximize  Restore  History

Download this file

4 lines (4 with data), 6.7 kB

Gx_l?!0…jüoÖÚýÖWATúøSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagText˜// Check if any of the two strings are too long (or the combination of them)// All OKÊIF (LEN(STR := MsgFmtString) + LEN(STR := StringArg)) <= MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS THENT    MsgFmtStringProcessed := MsgFmtString;H    StringArgProcessed := StringArg;ð// If test instance path is longer than 252 chars, shorten it down to 252 characters and additionally with the length of the '...TestName too long'. Add the text '...TestName too long' to the test instance path. Leave no characters for the message.šELSIF LEN(STR := MsgFmtString) > MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS THEN†    MsgFmtStringTemp := LEFT(STR := MsgFmtString, SIZE := (MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS - LEN(STR := TestNameTooLong)));®    MsgFmtStringProcessed := CONCAT(STR1 := MsgFmtStringTemp, STR2 := TestNameTooLong);:    StringArgProcessed := '';ö// If test message is too long (so we cant fit the text "...TestMsg too long") to the end of it, shorten it so that we can.ÚELSIF (MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS - LEN(STR := TestMsgTooLong)) >= LEN(STR := MsgFmtString) THENÊ    StringArgProcessed := LEFT(STR := StringArg, SIZE := (MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS - LEN(STR := TestMsgTooLong) - LEN(STR := MsgFmtStringProcessed)));ª    StringArgProcessed := CONCAT(STR1 := StringArgProcessed, STR2 := TestMsgTooLong);Ú// If test instance path is too long (length is between 232 and 252 characters long), shorten it and add the text '...TestName too long'. Leave no characters for the message ELSE!END_IF"Interface#L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}$(*%è    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 252 characters long.'*)(|FUNCTION_BLOCK FB_AdjustAssertFailureMessageToMax252CharLength)VAR_INPUT*j    MsgFmtString : T_MaxString; // Test instance path+X    StringArg : T_MaxString; // Test message,END_VAR-VAR_OUTPUT.P    MsgFmtStringProcessed : T_MaxString;/J    StringArgProcessed : T_MaxString;0VAR1F    MsgFmtStringTemp : T_MaxString;2n    TestNameTooLong : STRING := '...TestName too long';3j    TestMsgTooLong : STRING := '...TestMsg too long';4VAR CONSTANT5¨    MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS : INT := 252; // This is actually 253, but if StrArg-argument is used (which it is in TcUnit) it is 252.6"UniqueIdGenerator7668POULevel9L{8e575c5b-1d37-49c6-941b-5c0ec7874787}:Standard; ChildObjectGuids<8System.Collections.ArrayList=,AddAttributeSubsequent>boolÐÐ-ÐÐ	E
ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ ÚÐ-ÐÐ
­!ÚÐ-ÐÐ
­#ÚÐ-ÐÐ
­$ÚÐ-ÐÐ
­%ÚÐ-ÐÐ
­&ÚÐ-ÐÐ
­(ÚÐ-ÐÐ
­*ÚÐ-ÐÐ
­+ÚÐ- ÐÐ
­,ÚÐ-ÐÐ
­-ÚÐ-ÐÐ
­.ÚÐ-ÐÐ
­	ÚÐ-!Ð"#Ð	E
ÐÐ
­/ÚÐ-$ÐÐ
­0ÚÐ-%ÐÐ
­1ÚÐ-&ÐÐ
­2ÚÐ-'ÐÐ
­3ÚÐ-(ÐÐ
­4ÚÐ-)ÐÐ
­5ÚÐ-*ÐÐ
­6ÚÐ-+ÐÐ
­7ÚÐ-,ÐÐ
­8ÚÐ--ÐÐ
­9ÚÐ-.ÐÐ
­:ÚÐ-/ÐÐ
­;ÚÐ-,ÐÐ
­<ÚÐ-0ÐÐ
­=ÚÐ-1ÐÐ
­>ÚÐ-2ÐÐ
­?ÚÐ-3ÐÐ
­@ÚÐ-,ÐÐ
­AÚÐ-4ÐÐ
­BÚÐ-5ÐÐ
­ÚÐ-,Ð6-7Ð89-:;<Ð=>­