[r378]: / trunk / Library / POUs / FB_TestSuite / AddTest / svnobj  Maximize  Restore  History

Download this file

76 lines (76 with data), 9.0 kB

Gx_l:#!0…jüo^€ŸÑ‰ÞSystem.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
longTagText
˜GVL_CfUnit.IgnoreCurrentTest := FALSE; // Reset the ignore current test flagVTrimmedTestName := F_LTrim(in := TestName);dTrimmedTestName := F_RTrim(in := TrimmedTestName);nLowerCasedTestName := F_ToLCase(in := TrimmedTestName);Æ(* If test should be disabled, make sure to remove the "disabled_"-part of it from the test name *)‚IF FIND(STR1 := LowerCasedTestName, STR2 := 'disabled_') = 1 THEND    IgnoreCurrentTestCase := TRUE;Æ    TrimmedTestName := DELETE( STR := TrimmedTestName, LEN := LEN( STR := 'disabled_' ), POS := 1);END_IFÆGetCurrentTaskIndex(); // Gets the task index of where this function block instance is being run inÎ(* Check if the test name already exists. Make sure there are no other tests with the same name already>   added for this test suite *)|CycleCount := GetCurrentTaskIndex.CurTaskInfo.dwIECCycleCount;´(* Iterate all the test names that up to this point have been added for this test suite *)bFOR IteratorCounter := 1 TO NumberOfTests BY 1 DO|    IF TrimmedTestName = Tests[IteratorCounter].GetName() THEN\        TestWithThisNameAlreadyExists := TRUE;¬        (* Check if a test with this name has already been called in this PLC cycle *) ‚        IF TestCycleCountIndex[IteratorCounter] = CycleCount THEN!b            GVL_CfUnit.IgnoreCurrentTest := TRUE;"ä            (* A test with this name already exists for this test suite and has already been called in this cycle.#®               Send a message notification, but only if we have not done so already. *)$†            TestDuplicateNameTrigger[IteratorCounter](CLK := TRUE);%ò            IF TestDuplicateNameTrigger[IteratorCounter].Q THEN // Rising edge detected. We have not reported this before&Ü                TestInstancePath := F_RemoveInstancePathAndProjectNameFromTestInstancePath(TestInstancePath :='¬                                                                                           GVL_CfUnit.CurrentTestSuiteBeingCalled^.GetInstancePath());(°                ErrorMessage := 'Test with name $'%s$' already exists in test suite $'';)®                ErrorMessage := CONCAT(STR1 := ErrorMessage, STR2 := TestInstancePath);*–                ErrorMessage := CONCAT(STR1 := ErrorMessage, STR2 := '$'');+”                Write_Device_Log(MsgCtrlMask := CmpLog.LogClass.LOG_ERROR,,L												MsgFmtStr := ErrorMessage,-N												StrArg := TrimmedTestName);.$            END_IF/        END_IF0v        TestCycleCountIndex[IteratorCounter] := CycleCount;1    END_IF2END_FOR3RIF NOT TestWithThisNameAlreadyExists THEN4T    (* Test has not been found. Add it. *)5x    Tests[IteratorCounter].SetName(Name := TrimmedTestName);6N    NumberOfTests := NumberOfTests + 1;7j    TestCycleCountIndex[NumberOfTests] := CycleCount;8B    IF IgnoreCurrentTestCase THEN9X        Tests[IteratorCounter].SetSkipped();:	END_IF;V(* Check if this test should be disabled *)<:IF IgnoreCurrentTestCase THEN=R    GVL_CfUnit.IgnoreCurrentTest := TRUE;>    RETURN;?Interface@L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}A*METHOD PUBLIC AddTestBVAR_INPUTC6    TestName : T_MaxString;DEND_VAREVARF6    IteratorCounter : UINT;G>    ErrorMessage : T_MaxString;HF    TestInstancePath : T_MaxString;I<    FunctionCallResult : DINT;J.    CycleCount : UDINT;Kd    TestWithThisNameAlreadyExists : BOOL := FALSE;LJ    LowerCasedTestName : T_MaxString;MD    TrimmedTestName : T_MaxString;NB    IgnoreCurrentTestCase : BOOL;ÐÐÐE;ÐÐ	
­hÚÐ-
ÐÐ	
­iÚÐ-ÐÐ	
­jÚÐ-ÐÐ	
­kÚÐ-ÐÐ	
­lÚÐ-ÐÐ	
­mÚÐ-ÐÐ	
­nÚÐ-ÐÐ	
­oÚÐ-ÐÐ	
­pÚÐ-ÐÐ	
­qÚÐ-ÐÐ	
­rÚÐ-ÐÐ	
­sÚÐ-ÐÐ	
­îÚÐ-ÐÐ	
­ïÚÐ-ÐÐ	
­ðÚÐ-ÐÐ	
­ñÚÐ-ÐÐ	
­òÚÐ-ÐÐ	
­AÚÐ-ÐÐ	
­ÆÚÐ-ÐÐ	
­ÇÚÐ-ÐÐ	
­ÈÚÐ-ÐÐ	
­ÉÚÐ-ÐÐ	
­ÊÚÐ-ÐÐ	
­ËÚÐ-ÐÐ	
­ÌÚÐ- ÐÐ	
­ÍÚÐ-!ÐÐ	
­ÎÚÐ-"ÐÐ	
­ÏÚÐ-#ÐÐ	
­ÐÚÐ-$ÐÐ	
­ÑÚÐ-%ÐÐ	
­ÒÚÐ-&ÐÐ	
­ÓÚÐ-'ÐÐ	
­ÔÚÐ-(ÐÐ	
­ÕÚÐ-)ÐÐ	
­ÖÚÐ-*ÐÐ	
­×ÚÐ-+ÐÐ	
­ØÚÐ-,ÐÐ	
­ÙÚÐ--ÐÐ	
­ÚÚÐ-.ÐÐ	
­ÛÚÐ-/ÐÐ	
­ÜÚÐ-0ÐÐ	
­ÝÚÐ-1ÐÐ	
­ÞÚÐ-2ÐÐ	
­ßÚÐ-ÐÐ	
­àÚÐ-3ÐÐ	
­áÚÐ-4ÐÐ	
­âÚÐ-5ÐÐ	
­ãÚÐ-6ÐÐ	
­äÚÐ-7ÐÐ	
­åÚÐ-8ÐÐ	
­æÚÐ-9ÐÐ	
­çÚÐ-:ÐÐ	
­èÚÐ-ÐÐ	
­éÚÐ-ÐÐ	
­êÚÐ-;ÐÐ	
­ëÚÐ-<ÐÐ	
­ìÚÐ-=ÐÐ	
­íÚÐ->ÐÐ	
­ÚÐ-Ð?@ÐEÐÐ	
­ZÚÐ-AÐÐ	
­[ÚÐ-BÐÐ	
­\ÚÐ-CÐÐ	
­]ÚÐ-DÐÐ	
­^ÚÐ-EÐÐ	
­_ÚÐ-FÐÐ	
­`ÚÐ-GÐÐ	
­aÚÐ-HÐÐ	
­bÚÐ-IÐÐ	
­cÚÐ-JÐÐ	
­dÚÐ-KÐÐ	
­eÚÐ-LÐÐ	
­fÚÐ-MÐÐ	
­gÚÐ-NÐÐ	
­ÚÐ-D