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

Download this file

4 lines (4 with data), 6.8 kB

Gx_l╠!0┘jЭo03┐шYЧIнс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_NUMBER_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_NUMBER_OF_CHARACTERS THEN├    MsgFmtStringTemp := LEFT(STR := MsgFmtString, SIZE := (MSG_FMT_STRING_MAX_NUMBER_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_NUMBER_OF_CHARACTERS - LEN(STR := TestMsgTooLong)) >= LEN(STR := MsgFmtString) THEN`    StringArgProcessed := LEFT(STR := StringArg,ю                                            SIZE := (MSG_FMT_STRING_MAX_NUMBER_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 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 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;0J    StringArgProcessed : T_MaxString;1VAR2F    MsgFmtStringTemp : T_MaxString;3n    TestNameTooLong : STRING := '...TestName too long';4j    TestMsgTooLong : STRING := '...TestMsg too long';5VAR CONSTANT6╗    MSG_FMT_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.7"UniqueIdGenerator81359POULevel:L{8e575c5b-1d37-49c6-941b-5c0ec7874787};Standard< ChildObjectGuids=8System.Collections.ArrayList>,AddAttributeSubsequent?boolпп-пп	E
пп
ґrзп-пп
ґsзп-пп
ґtзп-пп
ґuзп-пп
ґvзп-пп
ґwзп-пп
ґxзп-пп
ґyзп-пп
ґzзп-пп
ґ{зп-пп
ґ|зп-пп
ґ}зп-пп
ґ~зп-пп
ґзп-пп
ґ─зп-пп
ґ│зп-пп
ґ┌зп-пп
ґ┐зп- пп
ґ└зп-!пп
ґ┘зп-пп
ґ├зп-пп
ґ┤зп-пп
ґ	зп-"п#$п	E
пп
ґ^зп-%пп
ґ_зп-&пп
ґ`зп-'пп
ґaзп-(пп
ґbзп-)пп
ґcзп-*пп
ґdзп-+пп
ґeзп-,пп
ґfзп--пп
ґgзп-.пп
ґhзп-/пп
ґiзп-0пп
ґjзп--пп
ґkзп-1пп
ґlзп-2пп
ґmзп-3пп
ґnзп-4пп
ґoзп--пп
ґpзп-5пп
ґqзп-6пп
ґзп--п7-8п9:-;<=п>?ґ