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

Download this file

76 lines (76 with data), 8.6 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);V(* Check if this test should be disabled *)‚IF FIND(STR1 := LowerCasedTestName, STR2 := 'disabled_') = 1 THENR    GVL_CfUnit.IgnoreCurrentTest := TRUE;    RETURN;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 Tests[IteratorCounter].GetName() = TrimmedTestName 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 := '$'');*à                FunctionCallResult := WRITE_DEVICE_LOG(msgCtrlMask := UDINT_TO_DWORD(CmpLog.LogClass.LOG_ERROR),+ھ                                                           msgFmtStr := ErrorMessage,,¬                                                           strArg := TrimmedTestName);-$            END_IF.        END_IF/v        TestCycleCountIndex[IteratorCounter] := CycleCount;0    END_IF1END_FOR2RIF NOT TestWithThisNameAlreadyExists THEN3T    (* Test has not been found. Add it. *)4x    Tests[IteratorCounter].SetName(Name := TrimmedTestName);5N    NumberOfTests := NumberOfTests + 1;6j    TestCycleCountIndex[NumberOfTests] := CycleCount;7B    IF IgnoreCurrentTestCase THEN8X        Tests[IteratorCounter].SetSkipped();9	END_IF::IF IgnoreCurrentTestCase THEN;Interface<L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}=*METHOD PUBLIC AddTest>VAR_INPUT?6    TestName : T_MaxString;@END_VARAVARB6    IteratorCounter : UINT;C>    ErrorMessage : T_MaxString;DF    TestInstancePath : T_MaxString;E<    FunctionCallResult : DINT;F.    CycleCount : UDINT;Gd    TestWithThisNameAlreadyExists : BOOL := FALSE;HJ    LowerCasedTestName : T_MaxString;ID    TrimmedTestName : T_MaxString;JB    IgnoreCurrentTestCase : BOOL;ذذذE:ذذ	
­عذ-
ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­	عذ-ذذ	
­
عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­
عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­Iعذ-ذذ	
­Hعذ-ذذ	
­عذ-ذذ	
­Gعذ-ذذ	
­Aعذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ-ذذ	
­عذ- ذذ	
­عذ-!ذذ	
­عذ-"ذذ	
­عذ-#ذذ	
­عذ-$ذذ	
­ عذ-%ذذ	
­!عذ-&ذذ	
­#عذ-'ذذ	
­$عذ-(ذذ	
­%عذ-)ذذ	
­&عذ-*ذذ	
­'عذ-+ذذ	
­(عذ-,ذذ	
­)عذ--ذذ	
­*عذ-.ذذ	
­+عذ-/ذذ	
­,عذ-0ذذ	
­-عذ-1ذذ	
­Jعذ-ذذ	
­Kعذ-2ذذ	
­Lعذ-3ذذ	
­Mعذ-4ذذ	
­Nعذ-5ذذ	
­Oعذ-6ذذ	
­Pعذ-7ذذ	
­Qعذ-8ذذ	
­Rعذ-9ذذ	
­Sعذ-ذذ	
­Tعذ-ذذ	
­Uعذ-ذذ	
­Vعذ-:ذذ	
­Wعذ-ذذ	
­Xعذ-ذذ	
­عذ-ذ;<ذEذذ	
­4عذ-=ذذ	
­5عذ->ذذ	
­6عذ-?ذذ	
­7عذ-@ذذ	
­8عذ-Aذذ	
­9عذ-Bذذ	
­:عذ-Cذذ	
­;عذ-Dذذ	
­<عذ-Eذذ	
­=عذ-Fذذ	
­>عذ-Gذذ	
­?عذ-Hذذ	
­@عذ-Iذذ	
­Yعذ-Jذذ	
­عذ-@