[r306]: / trunk / Library / POUs / FB_AdjustAssertFailureMessageToMax253CharLength / svnobj  Maximize  Restore  History

Download this file

4 lines (4 with data), 6.7 kB

Gx_l%!0…jüoÔÒG_)ÅË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 253 chars, shorten it down to 253 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 233 and 253 characters long), shorten it and add the text '...TestName too long'. Leave no characters for the messageELSE 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 253 characters long.&*)'|FUNCTION_BLOCK FB_AdjustAssertFailureMessageToMax253CharLength(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;/VAR0F    MsgFmtStringTemp : T_MaxString;1n    TestNameTooLong : STRING := '...TestName too long';2j    TestMsgTooLong : STRING := '...TestMsg too long';3VAR CONSTANT4¨    MSG_FMT_STRING_MAX_AMOUNT_OF_CHARACTERS : INT := 253; // This is actually 254, but if StrArg-argument is used (which it is in TcUnit) it is 252.5"UniqueIdGenerator6917POULevel8L{8e575c5b-1d37-49c6-941b-5c0ec7874787}9Standard: ChildObjectGuids;8System.Collections.ArrayList<,AddAttributeSubsequent=boolÐÐ-ÐÐ	E
ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ ÚÐ-ÐÐ
­!ÚÐ-ÐÐ
­#ÚÐ-ÐÐ
­$ÚÐ-ÐÐ
­%ÚÐ-ÐÐ
­&ÚÐ-ÐÐ
­(ÚÐ-ÐÐ
­*ÚÐ-ÐÐ
­+ÚÐ-ÐÐ
­,ÚÐ-ÐÐ
­-ÚÐ-ÐÐ
­.ÚÐ-ÐÐ
­	ÚÐ- Ð!"Ð	E
ÐÐ
­HÚÐ-#ÐÐ
­IÚÐ-$ÐÐ
­JÚÐ-%ÐÐ
­KÚÐ-&ÐÐ
­LÚÐ-'ÐÐ
­MÚÐ-(ÐÐ
­NÚÐ-)ÐÐ
­OÚÐ-*ÐÐ
­PÚÐ-+ÐÐ
­QÚÐ-,ÐÐ
­RÚÐ--ÐÐ
­SÚÐ-.ÐÐ
­TÚÐ-+ÐÐ
­UÚÐ-/ÐÐ
­VÚÐ-0ÐÐ
­WÚÐ-1ÐÐ
­XÚÐ-2ÐÐ
­YÚÐ-+ÐÐ
­ZÚÐ-3ÐÐ
­[ÚÐ-4ÐÐ
­ÚÐ-+Ð5-6Ð78-9:;Ð<=­