diff --git a/TcUnit/TcUnit/DUTs/ST_AdsLogStringMessage.TcDUT b/TcUnit/TcUnit/DUTs/ST_AdsLogStringMessage.TcDUT index 52a585f..c85b1f5 100644 --- a/TcUnit/TcUnit/DUTs/ST_AdsLogStringMessage.TcDUT +++ b/TcUnit/TcUnit/DUTs/ST_AdsLogStringMessage.TcDUT @@ -5,8 +5,8 @@ TYPE ST_AdsLogStringMessage : STRUCT MsgCtrlMask : DWORD; - MsgFmtStr : Tc2_System.T_MaxString; - StrArg : Tc2_System.T_MaxString; + MsgFmtStr : T_MaxString; + StrArg : T_MaxString; END_STRUCT END_TYPE]]> diff --git a/TcUnit/TcUnit/DUTs/ST_AssertArrayResult.TcDUT b/TcUnit/TcUnit/DUTs/ST_AssertArrayResult.TcDUT index ff1b906..8f89cd1 100644 --- a/TcUnit/TcUnit/DUTs/ST_AssertArrayResult.TcDUT +++ b/TcUnit/TcUnit/DUTs/ST_AssertArrayResult.TcDUT @@ -7,8 +7,8 @@ STRUCT ExpectedsTypeClass : IBaseLibrary.TypeClass; // The data type of the expecteds-array ActualsSize : UDINT; // Size in bytes of the actuals-array ActualsTypeClass : IBaseLibrary.TypeClass; // The data type of the actuals-array - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_STRUCT END_TYPE]]> diff --git a/TcUnit/TcUnit/DUTs/ST_AssertResult.TcDUT b/TcUnit/TcUnit/DUTs/ST_AssertResult.TcDUT index a5f8519..240277c 100644 --- a/TcUnit/TcUnit/DUTs/ST_AssertResult.TcDUT +++ b/TcUnit/TcUnit/DUTs/ST_AssertResult.TcDUT @@ -5,8 +5,8 @@ STRUCT Expected : U_ExpectedOrActual; Actual : U_ExpectedOrActual; - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_STRUCT END_TYPE]]> diff --git a/TcUnit/TcUnit/DUTs/ST_TestCaseResult.TcDUT b/TcUnit/TcUnit/DUTs/ST_TestCaseResult.TcDUT index 11b2691..2d77c16 100644 --- a/TcUnit/TcUnit/DUTs/ST_TestCaseResult.TcDUT +++ b/TcUnit/TcUnit/DUTs/ST_TestCaseResult.TcDUT @@ -3,11 +3,11 @@ diff --git a/TcUnit/TcUnit/POUs/FB_AdjustAssertFailureMessageToMax253CharLength.TcPOU b/TcUnit/TcUnit/POUs/FB_AdjustAssertFailureMessageToMax253CharLength.TcPOU index 63ca5ba..3e3b3f1 100644 --- a/TcUnit/TcUnit/POUs/FB_AdjustAssertFailureMessageToMax253CharLength.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_AdjustAssertFailureMessageToMax253CharLength.TcPOU @@ -7,15 +7,15 @@ *) FUNCTION_BLOCK FB_AdjustAssertFailureMessageToMax253CharLength VAR_INPUT - MsgFmtString : Tc2_System.T_MaxString; // Test instance path - StringArg : Tc2_System.T_MaxString; // Test message + MsgFmtString : T_MaxString; // Test instance path + StringArg : T_MaxString; // Test message END_VAR VAR_OUTPUT - MsgFmtStringProcessed : Tc2_System.T_MaxString; - StringArgProcessed : Tc2_System.T_MaxString; + MsgFmtStringProcessed : T_MaxString; + StringArgProcessed : T_MaxString; END_VAR VAR - MsgFmtStringTemp : Tc2_System.T_MaxString; + MsgFmtStringTemp : T_MaxString; TestNameTooLong : STRING := '...TestName too long'; TestMsgTooLong : STRING := '...TestMsg too long'; END_VAR @@ -26,24 +26,24 @@ END_VAR]]> MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS THEN - MsgFmtStringTemp := Tc2_Standard.LEFT(STR := MsgFmtString, SIZE := (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - Tc2_Standard.LEN(STR := TestNameTooLong))); - MsgFmtStringProcessed := Tc2_Standard.CONCAT(STR1 := MsgFmtStringTemp, STR2 := TestNameTooLong); +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 fit the text) -ELSIF (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - Tc2_Standard.LEN(STR := TestMsgTooLong)) >= Tc2_Standard.LEN(STR := MsgFmtString) THEN +ELSIF (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - LEN(STR := TestMsgTooLong)) >= LEN(STR := MsgFmtString) THEN MsgFmtStringProcessed := MsgFmtString; - StringArgProcessed := Tc2_Standard.LEFT(STR := StringArg, - SIZE := (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - Tc2_Standard.LEN(STR := TestMsgTooLong) - Tc2_Standard.LEN(STR := MsgFmtStringProcessed))); - StringArgProcessed := Tc2_Standard.CONCAT(STR1 := StringArgProcessed, STR2 := TestMsgTooLong); + 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 - MsgFmtStringTemp := Tc2_Standard.LEFT(STR := MsgFmtString, SIZE := (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - Tc2_Standard.LEN(STR := TestNameTooLong))); - MsgFmtStringProcessed := Tc2_Standard.CONCAT(STR1 := MsgFmtStringTemp, STR2 := TestNameTooLong); + MsgFmtStringTemp := LEFT(STR := MsgFmtString, SIZE := (MSG_FMT_STRING_MAX_NUMBER_OF_CHARACTERS - LEN(STR := TestNameTooLong))); + MsgFmtStringProcessed := CONCAT(STR1 := MsgFmtStringTemp, STR2 := TestNameTooLong); StringArgProcessed := ''; END_IF]]> diff --git a/TcUnit/TcUnit/POUs/FB_AdsAssertMessageFormatter.TcPOU b/TcUnit/TcUnit/POUs/FB_AdsAssertMessageFormatter.TcPOU index c135a02..1b441d6 100644 --- a/TcUnit/TcUnit/POUs/FB_AdsAssertMessageFormatter.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_AdsAssertMessageFormatter.TcPOU @@ -13,34 +13,34 @@ FUNCTION_BLOCK FB_AdsAssertMessageFormatter IMPLEMENTS I_AssertMessageFormatter] 0 THEN - TestInstancePathFinal := Tc2_Standard.CONCAT(STR1 := TestInstancePathFinal, STR2 := ', EXP: '); - TestInstancePathFinal := Tc2_Standard.CONCAT(STR1 := TestInstancePathFinal, STR2 := Expected); +IF LEN(STR := Expected) > 0 THEN + TestInstancePathFinal := CONCAT(STR1 := TestInstancePathFinal, STR2 := ', EXP: '); + TestInstancePathFinal := CONCAT(STR1 := TestInstancePathFinal, STR2 := Expected); END_IF -IF Tc2_Standard.LEN(STR := Actual) > 0 THEN - TestInstancePathFinal := Tc2_Standard.CONCAT(STR1 := TestInstancePathFinal, STR2 := ', ACT: '); - TestInstancePathFinal := Tc2_Standard.CONCAT(STR1 := TestInstancePathFinal, STR2 := Actual); +IF LEN(STR := Actual) > 0 THEN + TestInstancePathFinal := CONCAT(STR1 := TestInstancePathFinal, STR2 := ', ACT: '); + TestInstancePathFinal := CONCAT(STR1 := TestInstancePathFinal, STR2 := Actual); END_IF -IF Tc2_Standard.LEN(STR := Message) > 0 THEN - TestInstancePathFinal := Tc2_Standard.CONCAT(STR1 := TestInstancePathFinal, STR2 := ', MSG: %s'); +IF LEN(STR := Message) > 0 THEN + TestInstancePathFinal := CONCAT(STR1 := TestInstancePathFinal, STR2 := ', MSG: %s'); END_IF AdjustAssertFailureMessageToMax253CharLength(MsgFmtString := TestInstancePathFinal, @@ -48,7 +48,7 @@ AdjustAssertFailureMessageToMax253CharLength(MsgFmtString := TestInstancePathFin MsgFmtStringProcessed => TestInstancePathProcessed, StringArgProcessed => MessageProcessed); -GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, +GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := TestInstancePathProcessed, StrArg := MessageProcessed);]]> diff --git a/TcUnit/TcUnit/POUs/FB_AdsLogStringMessageFifoQueue.TcPOU b/TcUnit/TcUnit/POUs/FB_AdsLogStringMessageFifoQueue.TcPOU index 90cc2b0..dc35d51 100644 --- a/TcUnit/TcUnit/POUs/FB_AdsLogStringMessageFifoQueue.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_AdsLogStringMessageFifoQueue.TcPOU @@ -8,8 +8,8 @@ FUNCTION_BLOCK FB_AdsLogStringMessageFifoQueue VAR ArrayBuffer : ARRAY[0..((GVL_Param_TcUnit.AdsLogMessageFifoRingBufferSize * (SIZEOF(ST_ADSLogStringMessage) + MEM_RING_BUFFER_INTERNAL_USE_PER_DATA_RECORD)) - 1)] OF BYTE; - MemRingBuffer : Tc2_Utilities.FB_MemRingBuffer; - TimerBetweenMessages : Tc2_Standard.TON := (IN := TRUE, PT := TIME_BETWEEN_MESSAGES); + MemRingBuffer : FB_MemRingBuffer; + TimerBetweenMessages : TON := (IN := TRUE, PT := TIME_BETWEEN_MESSAGES); END_VAR VAR CONSTANT MEM_RING_BUFFER_INTERNAL_USE_PER_DATA_RECORD : USINT := 4; @@ -28,7 +28,7 @@ IF GetLogCount() > 0 THEN GetAndRemoveLogFromQueue(AdsLogStringMessage => MessageToBeSent, Error => ErrorGet); IF NOT ErrorGet THEN - ReturnValue := Tc2_System.ADSLOGSTR(msgCtrlMask := MessageToBeSent.MsgCtrlMask, + ReturnValue := ADSLOGSTR(msgCtrlMask := MessageToBeSent.MsgCtrlMask, msgFmtStr := MessageToBeSent.MsgFmtStr, strArg := MessageToBeSent.StrArg); END_IF @@ -63,8 +63,8 @@ Error := NOT MemRingBuffer.bOk;]]> METHOD INTERNAL WriteLog VAR_INPUT MsgCtrlMask : DWORD; - MsgFmtStr : Tc2_System.T_MaxString; - StrArg : Tc2_System.T_MaxString; + MsgFmtStr : T_MaxString; + StrArg : T_MaxString; END_VAR VAR_OUTPUT Error : BOOL; // Buffer overflow @@ -74,7 +74,7 @@ VAR END_VAR]]> IF PrintingTestSuiteResultNumber <= GVL_TcUnit.NumberOfInitializedTestSuites AND NOT PrintedTestSuitesResults THEN PrintingTestSuiteTrigger(CLK := GVL_TcUnit.TestSuiteAddresses[PrintingTestSuiteResultNumber]^.AreAllTestsFinished()); IF PrintingTestSuiteTrigger.Q THEN - StringToPrint := Tc2_Standard.CONCAT(STR1 := '| Test suite ID=', + StringToPrint := CONCAT(STR1 := '| Test suite ID=', STR2 := UINT_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Identity)); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ' $'%s$''); (* Print test suite name and ID *) - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := StringToPrint, StrArg := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Name); (* Print number of tests/number of failed tests in test suite *) - StringToPrint := Tc2_Standard.CONCAT(STR1 := '| ID=', + StringToPrint := CONCAT(STR1 := '| ID=', STR2 := UINT_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Identity)); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ' number of tests='); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := UINT_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].NumberOfTests)); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ', number of failed tests='); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := UINT_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].NumberOfFailedTests)); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ', duration='); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := LREAL_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Duration)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := StringToPrint, StrArg := ''); @@ -93,43 +93,43 @@ IF PrintingTestSuiteResultNumber <= GVL_TcUnit.NumberOfInitializedTestSuites AND (* Iterate and print all tests in test suite *) FOR TestsInTestSuiteCounter := 1 TO MaxNumberOfTestsToPrint BY 1 DO (* Print test name *) - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := '| Test name=%s', StrArg := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestName); (* Print test class name *) - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := '| Test class name=%s', StrArg := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestClassName); (* Print test result/status (SUCCESS, FAILED, SKIPPED) + number of assertions made *) IF TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestIsFailed THEN - StringToPrint := Tc2_Standard.CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_FAIL); + StringToPrint := CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_FAIL); ELSIF TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestIsSkipped THEN - StringToPrint := Tc2_Standard.CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_SKIP); + StringToPrint := CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_SKIP); ELSE - StringToPrint := Tc2_Standard.CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_PASS); + StringToPrint := CONCAT(STR1 := '| Test status=', STR2 := TEST_STATUS_PASS); END_IF - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, STR2 := ', number of asserts='); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, STR2 := + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ', number of asserts='); + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := UINT_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].NumberOfAsserts)); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, STR2 := ', duration='); - StringToPrint := Tc2_Standard.CONCAT(STR1 := StringToPrint, STR2 := + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := ', duration='); + StringToPrint := CONCAT(STR1 := StringToPrint, STR2 := LREAL_TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].Duration)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := StringToPrint, StrArg := ''); (* Print assertion/failure message (if existing) *) - IF (Tc2_Standard.LEN(STR := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureMessage) > 0) THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + IF (LEN(STR := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureMessage) > 0) THEN + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := '| Test assert message=%s', StrArg := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureMessage); END_IF (* Print assertion/failure type (if existing) *) IF TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureType <> E_AssertionType.Type_UNDEFINED THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := '| Test assert type=%s', StrArg := F_AssertionTypeToString(AssertionType := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureType)); @@ -138,13 +138,13 @@ IF PrintingTestSuiteResultNumber <= GVL_TcUnit.NumberOfInitializedTestSuites AND (* Print error message if there are too many tests in the test suite *) IF (TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].NumberOfTests > GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := 'Tests failed because the number of tests (%s', - StrArg := Tc2_Standard.CONCAT(STR1 := TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].NumberOfTests), - STR2 := Tc2_Standard.CONCAT(STR1 := ') in the test suite $'', - STR2 := Tc2_Standard.CONCAT(STR1 := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Name, - STR2 := Tc2_Standard.CONCAT(STR1 := '$' are more than is defined in parameter $'GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite$' (', - STR2 := Tc2_Standard.CONCAT(STR1 := UINT_TO_STRING(GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite), + StrArg := CONCAT(STR1 := TO_STRING(TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].NumberOfTests), + STR2 := CONCAT(STR1 := ') in the test suite $'', + STR2 := CONCAT(STR1 := TcUnitTestResults.TestSuiteResults[PrintingTestSuiteResultNumber].Name, + STR2 := CONCAT(STR1 := '$' are more than is defined in parameter $'GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite$' (', + STR2 := CONCAT(STR1 := UINT_TO_STRING(GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite), STR2 := '). Please increase this parameter.')))))); END_IF @@ -160,25 +160,25 @@ END_IF (* Log end results once all test suites have finished running *) IF (GVL_TcUnit.NumberOfInitializedTestSuites = 0 OR PrintingTestSuiteResultNumber = GVL_TcUnit.NumberOfInitializedTestSuites) AND NOT PrintedFinalTestResults AND TestResults.GetAreTestResultsAvailable() THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '%s', StrArg := '| ==========TESTS FINISHED RUNNING=========='); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '| Test suites: %s', StrArg := UINT_TO_STRING(TcUnitTestResults.NumberOfTestSuites)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '| Tests: %s', StrArg := UINT_TO_STRING(TcUnitTestResults.NumberOfTestCases)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '| Successful tests: %s', StrArg := UINT_TO_STRING(TcUnitTestResults.NumberOfSuccessfulTestCases)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '| Failed tests: %s', StrArg := UINT_TO_STRING(TcUnitTestResults.NumberOfFailedTestCases)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '| Duration: %s', StrArg := LREAL_TO_STRING(TcUnitTestResults.Duration)); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := '%s', StrArg := '| ======================================'); PrintedFinalTestResults := TRUE; diff --git a/TcUnit/TcUnit/POUs/FB_AssertArrayResultStatic.TcPOU b/TcUnit/TcUnit/POUs/FB_AssertArrayResultStatic.TcPOU index 2b2ea86..1fd749b 100644 --- a/TcUnit/TcUnit/POUs/FB_AssertArrayResultStatic.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_AssertArrayResultStatic.TcPOU @@ -22,7 +22,7 @@ VAR TotalArrayAsserts : UINT := 0; (* Function block to get the current task cycle *) - GetCurrentTaskIndex : Tc2_System.GETCURTASKINDEX; + GetCurrentTaskIndex : GETCURTASKINDEX; (* The total number of instances of each of the "AssertArrayResults" *) AssertArrayResultInstances : ARRAY[1..GVL_Param_TcUnit.MaxNumberOfAssertsForEachTestSuite] OF ST_AssertArrayResultInstances; @@ -43,8 +43,8 @@ VAR_INPUT ExpectedsTypeClass : IBaseLibrary.TypeClass; ActualsSize : UDINT; ActualsTypeClass : IBaseLibrary.TypeClass; - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_VAR]]> @@ -76,8 +76,8 @@ VAR_INPUT ActualSize : UDINT; ActualTypeClass : IBaseLibrary.TypeClass; ActualValue : POINTER TO BYTE; - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_VAR VAR IteratorCounter : UINT; @@ -105,8 +105,8 @@ VAR_INPUT ActualSize : UDINT; ActualTypeClass : IBaseLibrary.TypeClass; ActualValue : POINTER TO BYTE; - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_VAR VAR IteratorCounter : UINT; @@ -137,8 +137,8 @@ VAR_INPUT ActualSize : UDINT; ActualTypeClass : IBaseLibrary.TypeClass; ActualValue : POINTER TO BYTE; - Message : Tc2_System.T_MaxString; - TestInstancePath : Tc2_System.T_MaxString; + Message : T_MaxString; + TestInstancePath : T_MaxString; END_VAR VAR IteratorCounter : UINT; @@ -163,7 +163,7 @@ END_FOR]]> METHOD PUBLIC Delete : SysFile.SysTypes.RTS_IEC_RESULT; VAR_INPUT (* File name can contain an absolute or relative path to the file. Path entries must be separated with a forward slash (/) *) - FileName : Tc2_System.T_MaxString; + FileName : T_MaxString; END_VAR]]> @@ -44,7 +44,7 @@ END_VAR]]> *) METHOD PUBLIC Open : SysFile.SysTypes.RTS_IEC_RESULT; VAR_INPUT - FileName : Tc2_System.T_MaxString := 'filepath/output.xml'; // File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) + FileName : T_MaxString := 'filepath/output.xml'; // File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) FileAccessMode : SysFile.ACCESS_MODE := SysFile.ACCESS_MODE.AM_APPEND_PLUS; END_VAR]]> diff --git a/TcUnit/TcUnit/POUs/FB_StreamBuffer.TcPOU b/TcUnit/TcUnit/POUs/FB_StreamBuffer.TcPOU index 2bb3507..a2683f8 100644 --- a/TcUnit/TcUnit/POUs/FB_StreamBuffer.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_StreamBuffer.TcPOU @@ -17,7 +17,7 @@ END_VAR]]> +PROPERTY Append : T_MaxString]]> - - + @@ -46,7 +46,7 @@ END_VAR]]> - + @@ -86,10 +86,10 @@ METHOD INTERNAL GetTestOrder : UINT(0..GVL_Param_TcUnit.MaxNumberOfTestsForEachT - @@ -125,7 +125,7 @@ Duration := LWORD_TO_LREAL(FinishedAt - StartedAt) * GVL_TcUnit.HundredNanosecon diff --git a/TcUnit/TcUnit/POUs/FB_TestResults.TcPOU b/TcUnit/TcUnit/POUs/FB_TestResults.TcPOU index dc6b679..801e587 100644 --- a/TcUnit/TcUnit/POUs/FB_TestResults.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_TestResults.TcPOU @@ -9,14 +9,14 @@ VAR (* Misc variables *) StoringTestSuiteResultNumber : UINT(1..GVL_Param_TcUnit.MaxNumberOfTestSuites); - StoringTestSuiteTrigger : Tc2_Standard.R_TRIG; + StoringTestSuiteTrigger : R_TRIG; StoredTestSuiteResults : BOOL; StoredGeneralTestResults : BOOL; NumberOfTestsToAnalyse : UINT(1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite); END_VAR VAR_TEMP - TestSuiteName : Tc2_System.T_MaxString; - TestName : Tc2_System.T_MaxString; + TestSuiteName : T_MaxString; + TestName : T_MaxString; TestsInTestSuiteCounter : UINT(1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite); diff --git a/TcUnit/TcUnit/POUs/FB_TestSuite.TcPOU b/TcUnit/TcUnit/POUs/FB_TestSuite.TcPOU index de5f310..6474d45 100644 --- a/TcUnit/TcUnit/POUs/FB_TestSuite.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_TestSuite.TcPOU @@ -12,19 +12,19 @@ FUNCTION_BLOCK FB_TestSuite VAR {attribute 'instance-path'} {attribute 'noinit'} - InstancePath : Tc2_System.T_MaxString; + InstancePath : T_MaxString; (* We need to have access to specific information of the current task that this test suite is executed in. This is for instance necessary when we need to know whether a test is defined already. The definition of a test that is defined already is that we call on it with the same name twice in the same cycle *) - GetCurrentTaskIndex : Tc2_System.GETCURTASKINDEX; + GetCurrentTaskIndex : GETCURTASKINDEX; NumberOfTests : UINT(0..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) := 0; Tests : ARRAY[1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite] OF FB_Test; (* Rising trigger of whether we have already notified the user of that the test name pointed to by the current position is a duplicate *) - TestDuplicateNameTrigger : ARRAY[1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite] OF Tc2_Standard.R_TRIG; + TestDuplicateNameTrigger : ARRAY[1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite] OF R_TRIG; (* Last cycle count index for a specific test. Used to detect whether this test has already been defined in the current test suite *) TestCycleCountIndex : ARRAY[1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite] OF UDINT; @@ -54,32 +54,32 @@ END_VAR]]> - - + @@ -194,15 +194,15 @@ VAR_IN_OUT END_VAR VAR_INPUT Delta : LREAL; // The maximum delta between the value of expected and actual for which both numbers are still considered equal, proportional to the expected value in that array cell - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR Equals : BOOL := TRUE; SizeEquals : BOOL := TRUE; - ExpectedString : Tc2_System.T_MaxString; - ActualString : Tc2_System.T_MaxString; + ExpectedString : T_MaxString; + ActualString : T_MaxString; AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; DimensionIndex : USINT; // Index when looping through Dimensions LowerBoundExpecteds : ARRAY[1..2] OF DINT; // Lower bounds of Expecteds array in each dimension UpperBoundExpecteds : ARRAY[1..2] OF DINT; // Upper bounds of Expecteds array in each dimension @@ -286,48 +286,48 @@ IF NOT AlreadyReported AND NOT Equals THEN AssertionMessage := Message); IF NOT SizeEquals THEN - Message := Tc2_Standard.CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); + Message := CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); ExpectedString := 'SIZE = ['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] ('); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := 'x'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ')'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] ('); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := 'x'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ')'); ActualString := 'SIZE = ['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] ('); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := 'x'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ')'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] ('); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := 'x'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ')'); ELSE ExpectedString := 'ARRAY['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] = '); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := LREAL_TO_STRING(Expected)); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] = '); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := LREAL_TO_STRING(Expected)); ActualString := 'ARRAY['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] = '); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := LREAL_TO_STRING(Actual)); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] = '); + ActualString := CONCAT(STR1 := ActualString, STR2 := LREAL_TO_STRING(Actual)); END_IF AssertMessageFormatter.LogAssertFailure(Expected := ExpectedString, @@ -348,15 +348,15 @@ VAR_IN_OUT END_VAR VAR_INPUT Delta : REAL; // The maximum delta between the value of expected and actual for which both numbers are still considered equal, proportional to the expected value in that array cell - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR Equals : BOOL := TRUE; SizeEquals : BOOL := TRUE; - ExpectedString : Tc2_System.T_MaxString; - ActualString : Tc2_System.T_MaxString; + ExpectedString : T_MaxString; + ActualString : T_MaxString; AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; DimensionIndex : USINT; // Index when looping through Dimensions LowerBoundExpecteds : ARRAY[1..2] OF DINT; // Lower bounds of Expecteds array in each dimension UpperBoundExpecteds : ARRAY[1..2] OF DINT; // Upper bounds of Expecteds array in each dimension @@ -440,48 +440,48 @@ IF NOT AlreadyReported AND NOT Equals THEN AssertionMessage := Message); IF NOT SizeEquals THEN - Message := Tc2_Standard.CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); + Message := CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); ExpectedString := 'SIZE = ['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] ('); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := 'x'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ')'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] ('); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := 'x'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ')'); ActualString := 'SIZE = ['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] ('); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := 'x'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ')'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] ('); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := 'x'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ')'); ELSE ExpectedString := 'ARRAY['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] = '); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := REAL_TO_STRING(Expected)); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] = '); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := REAL_TO_STRING(Expected)); ActualString := 'ARRAY['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] = '); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := REAL_TO_STRING(Actual)); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] = '); + ActualString := CONCAT(STR1 := ActualString, STR2 := REAL_TO_STRING(Actual)); END_IF AssertMessageFormatter.LogAssertFailure(Expected := ExpectedString, @@ -502,15 +502,15 @@ VAR_IN_OUT END_VAR VAR_INPUT Delta : LREAL; // The maximum delta between the value of expected and actual for which both numbers are still considered equal, proportional to the expected value in that array cell - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR Equals : BOOL := TRUE; SizeEquals : BOOL := TRUE; - ExpectedString : Tc2_System.T_MaxString; - ActualString : Tc2_System.T_MaxString; + ExpectedString : T_MaxString; + ActualString : T_MaxString; AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; DimensionIndex : USINT; // Index when looping through Dimensions LowerBoundExpecteds : ARRAY[1..3] OF DINT; // Lower bounds of Expecteds array in each dimension UpperBoundExpecteds : ARRAY[1..3] OF DINT; // Upper bounds of Expecteds array in each dimension @@ -605,64 +605,64 @@ IF NOT AlreadyReported AND NOT Equals THEN AssertionMessage := Message); IF NOT SizeEquals THEN - Message := Tc2_Standard.CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); + Message := CONCAT(STR1 := Message, STR2 := ', size of arrays not matching.'); ExpectedString := 'SIZE = ['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[3])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '..'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[3])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] ('); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := 'x'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := 'x'); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[3])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ')'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(LowerBoundExpecteds[3])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '..'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(UpperBoundExpecteds[3])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] ('); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := 'x'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := 'x'); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(SizeOfExpecteds[3])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ')'); ActualString := 'SIZE = ['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[3])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '..'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[3])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] ('); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := 'x'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := 'x'); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[3])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ')'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(LowerBoundActuals[3])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '..'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(UpperBoundActuals[3])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] ('); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := 'x'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := 'x'); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(SizeOfActuals[3])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ')'); ELSE ExpectedString := 'ARRAY['; - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := ','); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[3])); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := '] = '); - ExpectedString := Tc2_Standard.CONCAT(STR1 := ExpectedString, STR2 := LREAL_TO_STRING(Expected) ); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[1])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[2])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := ','); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := DINT_TO_STRING(ExpectedArrayIndex[3])); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := '] = '); + ExpectedString := CONCAT(STR1 := ExpectedString, STR2 := LREAL_TO_STRING(Expected) ); ActualString := 'ARRAY['; - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := ','); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[3])); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := '] = '); - ActualString := Tc2_Standard.CONCAT(STR1 := ActualString, STR2 := LREAL_TO_STRING(Actual)); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[1])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[2])); + ActualString := CONCAT(STR1 := ActualString, STR2 := ','); + ActualString := CONCAT(STR1 := ActualString, STR2 := DINT_TO_STRING(ActualArrayIndex[3])); + ActualString := CONCAT(STR1 := ActualString, STR2 := '] = '); + ActualString := CONCAT(STR1 := ActualString, STR2 := LREAL_TO_STRING(Actual)); END_IF AssertMessageFormatter.LogAssertFailure(Expected := ExpectedString, @@ -683,15 +683,15 @@ VAR_IN_OUT END_VAR VAR_INPUT Delta : REAL; // The maximum delta between the value of expected and actual for which both numbers are still considered equal, proportional to the expected value in that array cell - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR Equals : BOOL := TRUE; SizeEquals : BOOL := TRUE; - ExpectedString : Tc2_System.T_MaxString; - ActualString : Tc2_System.T_MaxString; + ExpectedString : T_MaxString; + ActualString : T_MaxString; AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; DimensionIndex : USINT; // Index when looping through Dimensions LowerBoundExpecteds : ARRAY[1..3] OF DINT; // Lower bounds of Expecteds array in each dimension UpperBoundExpecteds : ARRAY[1..3] OF DINT; // Upper bounds of Expecteds array in each dimension @@ -704,9 +704,9 @@ VAR ActualArrayIndex : ARRAY[1..3] OF DINT; // Array of current Actual array indexes when looping through arrays Expected : REAL; // Single expected value Actual : REAL; // Single actual value - ExpectedValueString : Tc2_System.T_MaxString; - ActualValueString : Tc2_System.T_MaxString; - FormatString : Tc2_Utilities.FB_FormatString; // String formatter for output messages + ExpectedValueString : T_MaxString; + ActualValueString : T_MaxString; + FormatString : FB_FormatString; // String formatter for output messages END_VAR]]> Tc2_Standard.LEN(STR := stringActual); + MEMCPY(destAddr := ADR(stringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(stringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + DataSizeNotEquals := LEN(STR := stringExpected) <> LEN(STR := stringActual); ELSIF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_WSTRING THEN - Tc2_System.MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); - Tc2_System.MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); - DataSizeNotEquals := Tc2_Standard.WLEN(STR := wstringExpected) <> Tc2_Standard.WLEN(STR := wstringActual); + MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + DataSizeNotEquals := WLEN(STR := wstringExpected) <> WLEN(STR := wstringActual); ELSIF (Expected.diSize <> Actual.diSize) THEN DataSizeNotEquals := TRUE; END_IF @@ -2374,176 +2374,176 @@ IF NOT DataTypesNotEquals AND NOT DataSizeNotEquals THEN (* BOOL *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_BOOL THEN - Tc2_System.MEMCPY(destAddr := ADR(boolExpected), srcAddr := Expected.pValue, n := SIZEOF(BOOL)); - Tc2_System.MEMCPY(destAddr := ADR(boolActual), srcAddr := Actual.pValue, n := SIZEOF(BOOL)); + MEMCPY(destAddr := ADR(boolExpected), srcAddr := Expected.pValue, n := SIZEOF(BOOL)); + MEMCPY(destAddr := ADR(boolActual), srcAddr := Actual.pValue, n := SIZEOF(BOOL)); AssertEquals_BOOL(Expected := boolExpected, Actual := boolActual, Message := Message); RETURN; END_IF (* BYTE *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_BYTE THEN - Tc2_System.MEMCPY(destAddr := ADR(byteExpected), srcAddr := Expected.pValue, n := SIZEOF(BYTE)); - Tc2_System.MEMCPY(destAddr := ADR(byteActual), srcAddr := Actual.pValue, n := SIZEOF(BYTE)); + MEMCPY(destAddr := ADR(byteExpected), srcAddr := Expected.pValue, n := SIZEOF(BYTE)); + MEMCPY(destAddr := ADR(byteActual), srcAddr := Actual.pValue, n := SIZEOF(BYTE)); AssertEquals_BYTE(Expected := byteExpected, Actual := byteActual, Message := Message); RETURN; END_IF (* DATE *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_DATE THEN - Tc2_System.MEMCPY(destAddr := ADR(dateExpected), srcAddr := Expected.pValue, n := SIZEOF(DATE)); - Tc2_System.MEMCPY(destAddr := ADR(dateActual), srcAddr := Actual.pValue, n := SIZEOF(DATE)); + MEMCPY(destAddr := ADR(dateExpected), srcAddr := Expected.pValue, n := SIZEOF(DATE)); + MEMCPY(destAddr := ADR(dateActual), srcAddr := Actual.pValue, n := SIZEOF(DATE)); AssertEquals_DATE(Expected := dateExpected, Actual := dateActual, Message := Message); RETURN; END_IF (* DATE_AND_TIME *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_DATEANDTIME THEN - Tc2_System.MEMCPY(destAddr := ADR(dateAndTimeExpected), srcAddr := Expected.pValue, n := SIZEOF(DATE_AND_TIME)); - Tc2_System.MEMCPY(destAddr := ADR(dateAndTimeActual), srcAddr := Actual.pValue, n := SIZEOF(DATE_AND_TIME)); + MEMCPY(destAddr := ADR(dateAndTimeExpected), srcAddr := Expected.pValue, n := SIZEOF(DATE_AND_TIME)); + MEMCPY(destAddr := ADR(dateAndTimeActual), srcAddr := Actual.pValue, n := SIZEOF(DATE_AND_TIME)); AssertEquals_DATE_AND_TIME(Expected := dateAndTimeExpected, Actual := dateAndTimeActual, Message := Message); RETURN; END_IF (* DINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_DINT THEN - Tc2_System.MEMCPY(destAddr := ADR(dintExpected), srcAddr := Expected.pValue, n := SIZEOF(DINT)); - Tc2_System.MEMCPY(destAddr := ADR(dintActual), srcAddr := Actual.pValue, n := SIZEOF(DINT)); + MEMCPY(destAddr := ADR(dintExpected), srcAddr := Expected.pValue, n := SIZEOF(DINT)); + MEMCPY(destAddr := ADR(dintActual), srcAddr := Actual.pValue, n := SIZEOF(DINT)); AssertEquals_DINT(Expected := dintExpected, Actual := dintActual, Message := Message); RETURN; END_IF (* DWORD *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_DWORD THEN - Tc2_System.MEMCPY(destAddr := ADR(dwordExpected), srcAddr := Expected.pValue, n := SIZEOF(DWORD)); - Tc2_System.MEMCPY(destAddr := ADR(dwordActual), srcAddr := Actual.pValue, n := SIZEOF(DWORD)); + MEMCPY(destAddr := ADR(dwordExpected), srcAddr := Expected.pValue, n := SIZEOF(DWORD)); + MEMCPY(destAddr := ADR(dwordActual), srcAddr := Actual.pValue, n := SIZEOF(DWORD)); AssertEquals_DWORD(Expected := dwordExpected, Actual := dwordActual, Message := Message); RETURN; END_IF (* INT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_INT THEN - Tc2_System.MEMCPY(destAddr := ADR(intExpected), srcAddr := Expected.pValue, n := SIZEOF(INT)); - Tc2_System.MEMCPY(destAddr := ADR(intActual), srcAddr := Actual.pValue, n := SIZEOF(INT)); + MEMCPY(destAddr := ADR(intExpected), srcAddr := Expected.pValue, n := SIZEOF(INT)); + MEMCPY(destAddr := ADR(intActual), srcAddr := Actual.pValue, n := SIZEOF(INT)); AssertEquals_INT(Expected := intExpected, Actual := intActual, Message := Message); RETURN; END_IF (* LINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_LINT THEN - Tc2_System.MEMCPY(destAddr := ADR(lintExpected), srcAddr := Expected.pValue, n := SIZEOF(LINT)); - Tc2_System.MEMCPY(destAddr := ADR(lintActual), srcAddr := Actual.pValue, n := SIZEOF(LINT)); + MEMCPY(destAddr := ADR(lintExpected), srcAddr := Expected.pValue, n := SIZEOF(LINT)); + MEMCPY(destAddr := ADR(lintActual), srcAddr := Actual.pValue, n := SIZEOF(LINT)); AssertEquals_LINT(Expected := lintExpected, Actual := lintActual, Message := Message); RETURN; END_IF (* LREAL *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_LREAL THEN - Tc2_System.MEMCPY(destAddr := ADR(lrealExpected), srcAddr := Expected.pValue, n := SIZEOF(LREAL)); - Tc2_System.MEMCPY(destAddr := ADR(lrealActual), srcAddr := Actual.pValue, n := SIZEOF(LREAL)); + MEMCPY(destAddr := ADR(lrealExpected), srcAddr := Expected.pValue, n := SIZEOF(LREAL)); + MEMCPY(destAddr := ADR(lrealActual), srcAddr := Actual.pValue, n := SIZEOF(LREAL)); AssertEquals_LREAL(Expected := lrealExpected, Actual := lrealActual, Delta := 0.0, Message := Message); RETURN; END_IF (* LTIME *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_LTIME THEN - Tc2_System.MEMCPY(destAddr := ADR(ltimeExpected), srcAddr := Expected.pValue, n := SIZEOF(LTIME)); - Tc2_System.MEMCPY(destAddr := ADR(ltimeActual), srcAddr := Actual.pValue, n := SIZEOF(LTIME)); + MEMCPY(destAddr := ADR(ltimeExpected), srcAddr := Expected.pValue, n := SIZEOF(LTIME)); + MEMCPY(destAddr := ADR(ltimeActual), srcAddr := Actual.pValue, n := SIZEOF(LTIME)); AssertEquals_LTIME(Expected := ltimeExpected, Actual := ltimeActual, Message := Message); RETURN; END_IF (* LWORD *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_LWORD THEN - Tc2_System.MEMCPY(destAddr := ADR(lwordExpected), srcAddr := Expected.pValue, n := SIZEOF(LWORD)); - Tc2_System.MEMCPY(destAddr := ADR(lwordActual), srcAddr := Actual.pValue, n := SIZEOF(LWORD)); + MEMCPY(destAddr := ADR(lwordExpected), srcAddr := Expected.pValue, n := SIZEOF(LWORD)); + MEMCPY(destAddr := ADR(lwordActual), srcAddr := Actual.pValue, n := SIZEOF(LWORD)); AssertEquals_LWORD(Expected := lwordExpected, Actual := lwordActual, Message := Message); RETURN; END_IF (* REAL *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_REAL THEN - Tc2_System.MEMCPY(destAddr := ADR(realExpected), srcAddr := Expected.pValue, n := SIZEOF(REAL)); - Tc2_System.MEMCPY(destAddr := ADR(realActual), srcAddr := Actual.pValue, n := SIZEOF(REAL)); + MEMCPY(destAddr := ADR(realExpected), srcAddr := Expected.pValue, n := SIZEOF(REAL)); + MEMCPY(destAddr := ADR(realActual), srcAddr := Actual.pValue, n := SIZEOF(REAL)); AssertEquals_REAL(Expected := realExpected, Actual := realActual, Delta := 0.0, Message := Message); RETURN; END_IF (* SINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_SINT THEN - Tc2_System.MEMCPY(destAddr := ADR(sintExpected), srcAddr := Expected.pValue, n := SIZEOF(SINT)); - Tc2_System.MEMCPY(destAddr := ADR(sintActual), srcAddr := Actual.pValue, n := SIZEOF(SINT)); + MEMCPY(destAddr := ADR(sintExpected), srcAddr := Expected.pValue, n := SIZEOF(SINT)); + MEMCPY(destAddr := ADR(sintActual), srcAddr := Actual.pValue, n := SIZEOF(SINT)); AssertEquals_SINT(Expected := sintExpected, Actual := sintActual, Message := Message); RETURN; END_IF (* STRING *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_STRING THEN - Tc2_System.MEMCPY(destAddr := ADR(stringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); - Tc2_System.MEMCPY(destAddr := ADR(stringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + MEMCPY(destAddr := ADR(stringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(stringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); AssertEquals_STRING(Expected := stringExpected, Actual := stringActual, Message := Message); RETURN; END_IF (* WSTRING *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_WSTRING THEN - Tc2_System.MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); - Tc2_System.MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); AssertEquals_WSTRING(Expected := wstringExpected, Actual := wstringActual, Message := Message); RETURN; END_IF (* TIME *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_TIME THEN - Tc2_System.MEMCPY(destAddr := ADR(timeExpected), srcAddr := Expected.pValue, n := SIZEOF(TIME)); - Tc2_System.MEMCPY(destAddr := ADR(timeActual), srcAddr := Actual.pValue, n := SIZEOF(TIME)); + MEMCPY(destAddr := ADR(timeExpected), srcAddr := Expected.pValue, n := SIZEOF(TIME)); + MEMCPY(destAddr := ADR(timeActual), srcAddr := Actual.pValue, n := SIZEOF(TIME)); AssertEquals_TIME(Expected := timeExpected, Actual := timeActual, Message := Message); RETURN; END_IF (* TIME_OF_DAY *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_TIMEOFDAY THEN - Tc2_System.MEMCPY(destAddr := ADR(timeOfDayExpected), srcAddr := Expected.pValue, n := SIZEOF(TIME_OF_DAY)); - Tc2_System.MEMCPY(destAddr := ADR(timeOfDayActual), srcAddr := Actual.pValue, n := SIZEOF(TIME_OF_DAY)); + MEMCPY(destAddr := ADR(timeOfDayExpected), srcAddr := Expected.pValue, n := SIZEOF(TIME_OF_DAY)); + MEMCPY(destAddr := ADR(timeOfDayActual), srcAddr := Actual.pValue, n := SIZEOF(TIME_OF_DAY)); AssertEquals_TIME_OF_DAY(Expected := timeOfDayExpected, Actual := timeOfDayActual, Message := Message); RETURN; END_IF (* UDINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_UDINT THEN - Tc2_System.MEMCPY(destAddr := ADR(udintExpected), srcAddr := Expected.pValue, n := SIZEOF(UDINT)); - Tc2_System.MEMCPY(destAddr := ADR(udintActual), srcAddr := Actual.pValue, n := SIZEOF(UDINT)); + MEMCPY(destAddr := ADR(udintExpected), srcAddr := Expected.pValue, n := SIZEOF(UDINT)); + MEMCPY(destAddr := ADR(udintActual), srcAddr := Actual.pValue, n := SIZEOF(UDINT)); AssertEquals_UDINT(Expected := udintExpected, Actual := udintActual, Message := Message); RETURN; END_IF (* UINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_UINT THEN - Tc2_System.MEMCPY(destAddr := ADR(uintExpected), srcAddr := Expected.pValue, n := SIZEOF(UINT)); - Tc2_System.MEMCPY(destAddr := ADR(uintActual), srcAddr := Actual.pValue, n := SIZEOF(UINT)); + MEMCPY(destAddr := ADR(uintExpected), srcAddr := Expected.pValue, n := SIZEOF(UINT)); + MEMCPY(destAddr := ADR(uintActual), srcAddr := Actual.pValue, n := SIZEOF(UINT)); AssertEquals_UINT(Expected := uintExpected, Actual := uintActual, Message := Message); RETURN; END_IF (* ULINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_ULINT THEN - Tc2_System.MEMCPY(destAddr := ADR(ulintExpected), srcAddr := Expected.pValue, n := SIZEOF(ULINT)); - Tc2_System.MEMCPY(destAddr := ADR(ulintActual), srcAddr := Actual.pValue, n := SIZEOF(ULINT)); + MEMCPY(destAddr := ADR(ulintExpected), srcAddr := Expected.pValue, n := SIZEOF(ULINT)); + MEMCPY(destAddr := ADR(ulintActual), srcAddr := Actual.pValue, n := SIZEOF(ULINT)); AssertEquals_ULINT(Expected := ulintExpected, Actual := ulintActual, Message := Message); RETURN; END_IF (* USINT *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_USINT THEN - Tc2_System.MEMCPY(destAddr := ADR(usintExpected), srcAddr := Expected.pValue, n := SIZEOF(USINT)); - Tc2_System.MEMCPY(destAddr := ADR(usintActual), srcAddr := Actual.pValue, n := SIZEOF(USINT)); + MEMCPY(destAddr := ADR(usintExpected), srcAddr := Expected.pValue, n := SIZEOF(USINT)); + MEMCPY(destAddr := ADR(usintActual), srcAddr := Actual.pValue, n := SIZEOF(USINT)); AssertEquals_USINT(Expected := usintExpected, Actual := usintActual, Message := Message); RETURN; END_IF (* WORD *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_WORD THEN - Tc2_System.MEMCPY(destAddr := ADR(wordExpected), srcAddr := Expected.pValue, n := SIZEOF(WORD)); - Tc2_System.MEMCPY(destAddr := ADR(wordActual), srcAddr := Actual.pValue, n := SIZEOF(WORD)); + MEMCPY(destAddr := ADR(wordExpected), srcAddr := Expected.pValue, n := SIZEOF(WORD)); + MEMCPY(destAddr := ADR(wordActual), srcAddr := Actual.pValue, n := SIZEOF(WORD)); AssertEquals_WORD(Expected := wordExpected, Actual := wordActual, Message := Message); RETURN; END_IF @@ -2555,45 +2555,45 @@ END_IF TestInstancePath := AddTestNameToInstancePath(TestInstancePath := FindTestSuiteInstancePath()); IF DataTypesNotEquals THEN - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := '(Type class = ', STR2 := F_AnyTypeClassToString((Expected.TypeClass))); - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := ExpectedDataString, STR2 := ')'); - ActualDataString := Tc2_Standard.CONCAT(STR1 := '(Type class = ', STR2 := F_AnyTypeClassToString(Actual.TypeClass)); - ActualDataString := Tc2_Standard.CONCAT(STR1 := ActualDataString, STR2 := ')'); + ExpectedDataString := CONCAT(STR1 := '(Type class = ', STR2 := F_AnyTypeClassToString((Expected.TypeClass))); + ExpectedDataString := CONCAT(STR1 := ExpectedDataString, STR2 := ')'); + ActualDataString := CONCAT(STR1 := '(Type class = ', STR2 := F_AnyTypeClassToString(Actual.TypeClass)); + ActualDataString := CONCAT(STR1 := ActualDataString, STR2 := ')'); ELSIF DataSizeNotEquals THEN (* Take special care of STRING and WSTRING, as these can be declared with different sizes, although their content might be the same *) IF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_STRING THEN - Tc2_System.MEMCPY(destAddr := ADR(stringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); - Tc2_System.MEMCPY(destAddr := ADR(stringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := '(Data size (LEN) = ', STR2 := INT_TO_STRING(Tc2_Standard.LEN(STR := stringExpected))); - ActualDataString := Tc2_Standard.CONCAT(STR1 := '(Data size (LEN) = ', STR2 := INT_TO_STRING(Tc2_Standard.LEN(STR := stringActual))); + MEMCPY(destAddr := ADR(stringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(stringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + ExpectedDataString := CONCAT(STR1 := '(Data size (LEN) = ', STR2 := INT_TO_STRING(LEN(STR := stringExpected))); + ActualDataString := CONCAT(STR1 := '(Data size (LEN) = ', STR2 := INT_TO_STRING(LEN(STR := stringActual))); ELSIF UDINT_TO_INT(Expected.TypeClass) = IBaseLibrary.TypeClass.TYPE_WSTRING THEN - Tc2_System.MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); - Tc2_System.MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := '(Data size (WLEN) = ', STR2 := INT_TO_STRING(Tc2_Standard.WLEN(STR := wstringExpected))); - ActualDataString := Tc2_Standard.CONCAT(STR1 := '(Data size (WLEN) = ', STR2 := INT_TO_STRING(Tc2_Standard.WLEN(STR := wstringActual))); + MEMCPY(destAddr := ADR(wstringExpected), srcAddr := Expected.pValue, n := DINT_TO_UDINT(Expected.diSize)); + MEMCPY(destAddr := ADR(wstringActual), srcAddr := Actual.pValue, n := DINT_TO_UDINT(Actual.diSize)); + ExpectedDataString := CONCAT(STR1 := '(Data size (WLEN) = ', STR2 := INT_TO_STRING(WLEN(STR := wstringExpected))); + ActualDataString := CONCAT(STR1 := '(Data size (WLEN) = ', STR2 := INT_TO_STRING(WLEN(STR := wstringActual))); ELSE - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := '(Data size = ', STR2 := DINT_TO_STRING(Expected.diSize)); - ActualDataString := Tc2_Standard.CONCAT(STR1 := '(Data size = ', STR2 := DINT_TO_STRING(Actual.diSize)); + ExpectedDataString := CONCAT(STR1 := '(Data size = ', STR2 := DINT_TO_STRING(Expected.diSize)); + ActualDataString := CONCAT(STR1 := '(Data size = ', STR2 := DINT_TO_STRING(Actual.diSize)); END_IF - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := ExpectedDataString, STR2 := ')'); - ActualDataString := Tc2_Standard.CONCAT(STR1 := ActualDataString, STR2 := ')'); + ExpectedDataString := CONCAT(STR1 := ExpectedDataString, STR2 := ')'); + ActualDataString := CONCAT(STR1 := ActualDataString, STR2 := ')'); ELSIF DataContentNotEquals THEN FOR Count := 0 TO MIN(Expected.diSize-1, 38) BY 1 DO // One byte will equal two characters (example: 255 = 0xff, 1 = 0x01) - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := ExpectedDataString, - STR2 := Tc2_Utilities.BYTE_TO_HEXSTR(in := Expected.pValue[Count], + ExpectedDataString := CONCAT(STR1 := ExpectedDataString, + STR2 := BYTE_TO_HEXSTR(in := Expected.pValue[Count], iPrecision := 2, bLoCase := FALSE)); END_FOR - ExpectedDataString := Tc2_Standard.CONCAT(STR1 := '0x', STR2 := ExpectedDataString); + ExpectedDataString := CONCAT(STR1 := '0x', STR2 := ExpectedDataString); FOR Count := 0 TO MIN(Actual.diSize-1, 38) BY 1 DO // One byte will equal two characters (example: 255 = 0xff, 1 = 0x01) - ActualDataString := Tc2_Standard.CONCAT(STR1 := ActualDataString, - STR2 := Tc2_Utilities.BYTE_TO_HEXSTR(in := Actual.pValue[Count], + ActualDataString := CONCAT(STR1 := ActualDataString, + STR2 := BYTE_TO_HEXSTR(in := Actual.pValue[Count], iPrecision := 2, bLoCase := FALSE)); END_FOR - ActualDataString := Tc2_Standard.CONCAT(STR1 := '0x', STR2 := ActualDataString); + ActualDataString := CONCAT(STR1 := '0x', STR2 := ActualDataString); END_IF AssertResults.ReportResult(ExpectedSize := DINT_TO_UDINT(Expected.diSize), @@ -2625,11 +2625,11 @@ METHOD PUBLIC AssertEquals_BOOL VAR_INPUT Expected : BOOL; // BOOL expected value Actual : BOOL; // BOOL actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; END_VAR]]> @@ -2694,14 +2694,14 @@ IF NOT AlreadyReported AND Expected <> Actual THEN SetTestFailed(AssertionType := E_AssertionType.Type_BYTE, AssertionMessage := Message); - AssertMessageFormatter.LogAssertFailure(Expected := Tc2_Standard.CONCAT( + AssertMessageFormatter.LogAssertFailure(Expected := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.BYTE_TO_HEXSTR(in := Expected, + STR2 := BYTE_TO_HEXSTR(in := Expected, iPrecision := 2, bLoCase := FALSE)), - Actual := Tc2_Standard.CONCAT( + Actual := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.BYTE_TO_HEXSTR(in := Actual, + STR2 := BYTE_TO_HEXSTR(in := Actual, iPrecision := 2, bLoCase := FALSE)), Message := Message, @@ -2717,10 +2717,10 @@ METHOD PUBLIC AssertEquals_DATE VAR_INPUT Expected : DATE; // DATE expected value Actual : DATE; // DATE actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2759,10 +2759,10 @@ METHOD PUBLIC AssertEquals_DATE_AND_TIME VAR_INPUT Expected : DATE_AND_TIME; // DATE_AND_TIME expected value Actual : DATE_AND_TIME; // DATE_AND_TIME actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2801,10 +2801,10 @@ METHOD PUBLIC AssertEquals_DINT VAR_INPUT Expected : DINT; // DINT expected value Actual : DINT; // DINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2843,10 +2843,10 @@ METHOD PUBLIC AssertEquals_DWORD VAR_INPUT Expected : DWORD; // DWORD expected value Actual : DWORD; // DWORD actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2870,14 +2870,14 @@ IF NOT AlreadyReported AND Expected <> Actual THEN SetTestFailed(AssertionType := E_AssertionType.Type_DWORD, AssertionMessage := Message); - AssertMessageFormatter.LogAssertFailure(Expected := Tc2_Standard.CONCAT( + AssertMessageFormatter.LogAssertFailure(Expected := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.DWORD_TO_HEXSTR(in := Expected, + STR2 := DWORD_TO_HEXSTR(in := Expected, iPrecision := 8, bLoCase := FALSE)), - Actual := Tc2_Standard.CONCAT( + Actual := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.DWORD_TO_HEXSTR(in := Actual, + STR2 := DWORD_TO_HEXSTR(in := Actual, iPrecision := 8, bLoCase := FALSE)), Message := Message, @@ -2893,10 +2893,10 @@ METHOD PUBLIC AssertEquals_INT VAR_INPUT Expected : INT; // INT expected value Actual : INT; // INT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2935,10 +2935,10 @@ METHOD PUBLIC AssertEquals_LINT VAR_INPUT Expected : LINT; // LINT expected value Actual : LINT; // LINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -2978,10 +2978,10 @@ VAR_INPUT Expected : LREAL; // LREAL expected value Actual : LREAL; // LREAL actual value Delta : LREAL; // The maximum delta between the absolute value of expected and actual for which both numbers are still considered equal - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3020,10 +3020,10 @@ METHOD PUBLIC AssertEquals_LTIME VAR_INPUT Expected : LTIME; // LTIME expected value Actual : LTIME; // LTIME actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3062,10 +3062,10 @@ METHOD PUBLIC AssertEquals_LWORD VAR_INPUT Expected : LWORD; // LWORD expected value Actual : LWORD; // LWORD actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3089,14 +3089,14 @@ IF NOT AlreadyReported AND Expected <> Actual THEN SetTestFailed(AssertionType := E_AssertionType.Type_LWORD, AssertionMessage := Message); - AssertMessageFormatter.LogAssertFailure(Expected := Tc2_Standard.CONCAT( + AssertMessageFormatter.LogAssertFailure(Expected := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.LWORD_TO_HEXSTR(in := Expected, + STR2 := LWORD_TO_HEXSTR(in := Expected, iPrecision := 16, bLoCase := FALSE)), - Actual := Tc2_Standard.CONCAT( + Actual := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.LWORD_TO_HEXSTR(in := Actual, + STR2 := LWORD_TO_HEXSTR(in := Actual, iPrecision := 16, bLoCase := FALSE)), Message := Message, @@ -3113,10 +3113,10 @@ VAR_INPUT Expected : REAL; // REAL expected value Actual : REAL; // REAL actual value Delta : REAL; // The maximum delta between the absolute value of expected and actual for which both numbers are still considered equal - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3155,10 +3155,10 @@ METHOD PUBLIC AssertEquals_SINT VAR_INPUT Expected : SINT; // SINT expected value Actual : SINT; // SINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3195,12 +3195,12 @@ END_IF]]> *) METHOD PUBLIC AssertEquals_STRING VAR_INPUT - Expected : Tc2_System.T_MaxString; // STRING expected value - Actual : Tc2_System.T_MaxString; // STRING actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Expected : T_MaxString; // STRING expected value + Actual : T_MaxString; // STRING actual value + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3220,7 +3220,7 @@ AssertResults.ReportResult(ExpectedSize := SIZEOF(Expected), TestInstancePath := TestInstancePath, AlreadyReported => AlreadyReported); -IF NOT AlreadyReported AND (Tc2_Standard.LEN(STR := Expected) <> Tc2_Standard.LEN(STR := Actual) OR (Expected <> Actual)) THEN +IF NOT AlreadyReported AND (LEN(STR := Expected) <> LEN(STR := Actual) OR (Expected <> Actual)) THEN SetTestFailed(AssertionType := E_AssertionType.Type_STRING, AssertionMessage := Message); @@ -3239,10 +3239,10 @@ METHOD PUBLIC AssertEquals_TIME VAR_INPUT Expected : TIME; // TIME expected value Actual : TIME; // TIME actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3281,10 +3281,10 @@ METHOD PUBLIC AssertEquals_TIME_OF_DAY VAR_INPUT Expected : TIME_OF_DAY; // TIME_OF_DAY expected value Actual : TIME_OF_DAY; // TIME_OF_DAY actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3323,10 +3323,10 @@ METHOD PUBLIC AssertEquals_UDINT VAR_INPUT Expected : UDINT; // UDINT expected value Actual : UDINT; // UDINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3365,10 +3365,10 @@ METHOD PUBLIC AssertEquals_UINT VAR_INPUT Expected : UINT; // UINT expected value Actual : UINT; // UINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3407,10 +3407,10 @@ METHOD PUBLIC AssertEquals_ULINT VAR_INPUT Expected : ULINT; // ULINT expected value Actual : ULINT; // ULINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3449,11 +3449,11 @@ METHOD PUBLIC AssertEquals_USINT VAR_INPUT Expected : USINT; // USINT expected value Actual : USINT; // USINT actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR AlreadyReported : BOOL; - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; END_VAR]]> @@ -3518,14 +3518,14 @@ IF NOT AlreadyReported AND Expected <> Actual THEN SetTestFailed(AssertionType := E_AssertionType.Type_WORD, AssertionMessage := Message); - AssertMessageFormatter.LogAssertFailure(Expected := Tc2_Standard.CONCAT( + AssertMessageFormatter.LogAssertFailure(Expected := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.WORD_TO_HEXSTR(in := Expected, + STR2 := WORD_TO_HEXSTR(in := Expected, iPrecision := 4, bLoCase := FALSE)), - Actual := Tc2_Standard.CONCAT( + Actual := CONCAT( STR1 := '0x', - STR2 := Tc2_Utilities.WORD_TO_HEXSTR(in := Actual, + STR2 := WORD_TO_HEXSTR(in := Actual, iPrecision := 4, bLoCase := FALSE)), Message := Message, @@ -3541,10 +3541,10 @@ METHOD PUBLIC AssertEquals_WSTRING VAR_INPUT Expected : WSTRING(255); // WSTRING expected value Actual : WSTRING(255); // WSTRING actual value - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR VAR - TestInstancePath : Tc2_System.T_MaxString; + TestInstancePath : T_MaxString; AlreadyReported : BOOL; END_VAR]]> @@ -3564,7 +3564,7 @@ AssertResults.ReportResult(ExpectedSize := SIZEOF(Expected), TestInstancePath := TestInstancePath, AlreadyReported => AlreadyReported); -IF NOT AlreadyReported AND (Tc2_Standard.WLEN(STR := Expected) <> Tc2_Standard.WLEN(STR := Actual) OR (Expected <> Actual)) THEN +IF NOT AlreadyReported AND (WLEN(STR := Expected) <> WLEN(STR := Actual) OR (Expected <> Actual)) THEN SetTestFailed(AssertionType := E_AssertionType.Type_WSTRING, AssertionMessage := Message); @@ -3582,7 +3582,7 @@ END_IF]]> METHOD PUBLIC AssertFalse VAR_INPUT Condition : BOOL; // Condition to be checked - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR]]> @@ -3595,7 +3595,7 @@ END_VAR]]> METHOD PUBLIC AssertTrue VAR_INPUT Condition : BOOL; // Condition to be checked - Message : Tc2_System.T_MaxString; // The identifying message for the assertion error + Message : T_MaxString; // The identifying message for the assertion error END_VAR]]> @@ -3604,10 +3604,10 @@ END_VAR]]> +METHOD PRIVATE FindTestSuiteInstancePath : T_MaxString]]> @@ -3674,7 +3674,7 @@ METHOD PRIVATE FindTestSuiteInstancePath : Tc2_System.T_MaxString]]> - @@ -3745,7 +3745,7 @@ GetNumberOfSkippedTests := SkippedTestsCount;]]> *) METHOD INTERNAL SetTestFinished : BOOL; VAR_INPUT - TestName : Tc2_System.T_MaxString; + TestName : T_MaxString; FinishedAt : LWORD; END_VAR VAR diff --git a/TcUnit/TcUnit/POUs/FB_XmlControl.TcPOU b/TcUnit/TcUnit/POUs/FB_XmlControl.TcPOU index 4780adc..5eca0d7 100644 --- a/TcUnit/TcUnit/POUs/FB_XmlControl.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_XmlControl.TcPOU @@ -9,11 +9,11 @@ FUNCTION_BLOCK FB_XmlControl VAR XmlBuffer : FB_StreamBuffer; TagListBuffer : FB_StreamBuffer; - Tags : Tc2_System.T_MaxString; + Tags : T_MaxString; TagListSeekBuffer : FB_StreamBuffer; TagsSeek : STRING; TagBuffer : FB_StreamBuffer; - Tag : Tc2_System.T_MaxString; + Tag : T_MaxString; TagOpen: BOOL; Select : UDINT; SearchPosition : UDINT; @@ -63,9 +63,9 @@ Tag := '';]]> Method: XML.CloseTag(); *) -METHOD PUBLIC CloseTag : Tc2_System.T_MaxString +METHOD PUBLIC CloseTag : T_MaxString VAR - ClosedTag : Tc2_System.T_MaxString; + ClosedTag : T_MaxString; END_VAR]]> *) METHOD PUBLIC NewComment VAR_INPUT - Comment : Tc2_System.T_MaxString; + Comment : T_MaxString; END_VAR]]> *) METHOD PUBLIC NewParameter VAR_INPUT - Name : Tc2_System.T_MaxString; - Value : Tc2_System.T_MaxString; + Name : T_MaxString; + Value : T_MaxString; END_VAR]]> *) METHOD PUBLIC NewTag VAR_INPUT - Name : Tc2_System.T_MaxString; + Name : T_MaxString; END_VAR]]> *) METHOD PUBLIC WriteDocumentHeader VAR_INPUT - Header : Tc2_System.T_MaxString; + Header : T_MaxString; END_VAR]]> diff --git a/TcUnit/TcUnit/POUs/FB_xUnitXmlPublisher.TcPOU b/TcUnit/TcUnit/POUs/FB_xUnitXmlPublisher.TcPOU index d3a8877..500bc11 100644 --- a/TcUnit/TcUnit/POUs/FB_xUnitXmlPublisher.TcPOU +++ b/TcUnit/TcUnit/POUs/FB_xUnitXmlPublisher.TcPOU @@ -17,7 +17,7 @@ VAR BufferInitialised : BOOL := FALSE; Buffer : ARRAY [0..(GVL_Param_TcUnit.XUnitBufferSize - 1)] OF BYTE; WritingTestSuiteResultNumber : UINT(1..GVL_Param_TcUnit.MaxNumberOfTestSuites); - PublishTrigger : Tc2_Standard.R_TRIG; + PublishTrigger : R_TRIG; END_VAR]]> @@ -162,15 +162,15 @@ IF PublishTrigger.Q THEN Xml.ClearBuffer(); (* Inform user *) - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, msgFmtStr := '%s', strArg := '| ==========TEST RESULTS EXPORTED==========='); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, msgFmtStr := '| Location: %s ', strArg := GVL_Param_TcUnit.xUnitFilePath); - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_HINT, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_HINT, MsgFmtStr := '%s', StrArg := '| ======================================'); END_IF]]> diff --git a/TcUnit/TcUnit/POUs/Functions/F_AnyToUnionValue.TcPOU b/TcUnit/TcUnit/POUs/Functions/F_AnyToUnionValue.TcPOU index b3cf0d0..e0a8c0b 100644 --- a/TcUnit/TcUnit/POUs/Functions/F_AnyToUnionValue.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/F_AnyToUnionValue.TcPOU @@ -10,114 +10,114 @@ END_VAR]]> (* None *) IBaseLibrary.TypeClass.TYPE_LTIME : - Tc2_System.MEMCPY(destaddr := ADR(F_AnyToUnionValue.ltimeExpectedOrActual), + MEMCPY(destaddr := ADR(F_AnyToUnionValue.ltimeExpectedOrActual), srcAddr := AnyValue, n := AnySize); diff --git a/TcUnit/TcUnit/POUs/Functions/F_AssertionTypeToString.TcPOU b/TcUnit/TcUnit/POUs/Functions/F_AssertionTypeToString.TcPOU index 9e04060..1d803d9 100644 --- a/TcUnit/TcUnit/POUs/Functions/F_AssertionTypeToString.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/F_AssertionTypeToString.TcPOU @@ -3,7 +3,7 @@ diff --git a/TcUnit/TcUnit/POUs/Functions/F_GetCpuCounterAs64bit.TcPOU b/TcUnit/TcUnit/POUs/Functions/F_GetCpuCounterAs64bit.TcPOU index 52b0124..7ca674f 100644 --- a/TcUnit/TcUnit/POUs/Functions/F_GetCpuCounterAs64bit.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/F_GetCpuCounterAs64bit.TcPOU @@ -2,14 +2,13 @@ + CpuCounter : GETCPUCOUNTER; +END_VAR]]> diff --git a/TcUnit/TcUnit/POUs/Functions/F_GetTestSuiteNameFromTestInstancePath.TcPOU b/TcUnit/TcUnit/POUs/Functions/F_GetTestSuiteNameFromTestInstancePath.TcPOU index 7ac3e2b..99bab11 100644 --- a/TcUnit/TcUnit/POUs/Functions/F_GetTestSuiteNameFromTestInstancePath.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/F_GetTestSuiteNameFromTestInstancePath.TcPOU @@ -1,19 +1,19 @@  - diff --git a/TcUnit/TcUnit/POUs/Functions/F_RemoveInstancePathAndProjectNameFromTestInstancePath.TcPOU b/TcUnit/TcUnit/POUs/Functions/F_RemoveInstancePathAndProjectNameFromTestInstancePath.TcPOU index 82a211f..ed038db 100644 --- a/TcUnit/TcUnit/POUs/Functions/F_RemoveInstancePathAndProjectNameFromTestInstancePath.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/F_RemoveInstancePathAndProjectNameFromTestInstancePath.TcPOU @@ -1,35 +1,35 @@  - 0 THEN - TestInstancePath := Tc2_Standard.DELETE(STR := TestInstancePath, - LEN := CharacterPositionOfProjectName-1 + Tc2_Standard.LEN(ProjectNameWithDot), + TestInstancePath := DELETE(STR := TestInstancePath, + LEN := CharacterPositionOfProjectName-1 + LEN(ProjectNameWithDot), POS := 1); END_IF (* Check if the project name happens to be the same as namespace, and in that case, remove that as well *) -CharacterPositionOfProjectName := Tc2_Standard.FIND(STR1 := TestInstancePath, +CharacterPositionOfProjectName := FIND(STR1 := TestInstancePath, STR2 := ProjectNameWithDot); IF CharacterPositionOfProjectName > 0 THEN - TestInstancePath := Tc2_Standard.DELETE(STR := TestInstancePath, + TestInstancePath := DELETE(STR := TestInstancePath, LEN := CharacterPositionOfProjectName - 1 + - Tc2_Standard.LEN(STR := ProjectNameWithDot), + LEN(STR := ProjectNameWithDot), POS := 1); END_IF diff --git a/TcUnit/TcUnit/POUs/Functions/IS_TEST_FINISHED.TcPOU b/TcUnit/TcUnit/POUs/Functions/IS_TEST_FINISHED.TcPOU index 5e3ddd3..0d51bde 100644 --- a/TcUnit/TcUnit/POUs/Functions/IS_TEST_FINISHED.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/IS_TEST_FINISHED.TcPOU @@ -4,7 +4,7 @@ - diff --git a/TcUnit/TcUnit/POUs/Functions/TEST_FINISHED_NAMED.TcPOU b/TcUnit/TcUnit/POUs/Functions/TEST_FINISHED_NAMED.TcPOU index 98f1448..a8121b4 100644 --- a/TcUnit/TcUnit/POUs/Functions/TEST_FINISHED_NAMED.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/TEST_FINISHED_NAMED.TcPOU @@ -5,7 +5,7 @@ a TestName that has been previously defined in this test suite. *) FUNCTION TEST_FINISHED_NAMED VAR_INPUT - TestName : Tc2_System.T_MaxString; + TestName : T_MaxString; END_VAR VAR Counter : UINT := 0; @@ -32,14 +32,14 @@ FOR Counter := 1 TO GVL_TcUnit.NumberOfInitializedTestSuites BY 1 DO FoundTestName := GVL_TcUnit.TestSuiteAddresses[Counter]^.SetTestFinished(TestName := TestName, FinishedAt := FinishedAt); IF NOT FoundTestName THEN IF FailedLookupCounter < MaxNumberOfNonExistentTestNamesFailedLookups THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := 'Failed to find test $'%s$'', StrArg := TestName); FailedLookupCounter := FailedLookupCounter + 1; (* Abort TcUnit *) GVL_TcUnit.TcUnitRunner.AbortRunningTestSuiteTests(); ELSIF NOT AlreadyPrintedFinalWarning THEN - GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := Tc2_System.ADSLOG_MSGTYPE_ERROR, + GVL_TcUnit.AdsMessageQueue.WriteLog(MsgCtrlMask := ADSLOG_MSGTYPE_ERROR, MsgFmtStr := 'Excess failed attempts to mark test finished, failed. Further warnings will be suppressed', StrArg := TestName); AlreadyPrintedFinalWarning := TRUE; diff --git a/TcUnit/TcUnit/POUs/Functions/TEST_ORDERED.TcPOU b/TcUnit/TcUnit/POUs/Functions/TEST_ORDERED.TcPOU index f0e5f8c..b2d093f 100644 --- a/TcUnit/TcUnit/POUs/Functions/TEST_ORDERED.TcPOU +++ b/TcUnit/TcUnit/POUs/Functions/TEST_ORDERED.TcPOU @@ -24,7 +24,7 @@ *) FUNCTION TEST_ORDERED : BOOL VAR_INPUT - TestName : Tc2_System.T_MaxString; + TestName : T_MaxString; END_VAR VAR CounterTestSuiteAddress : UINT;