Assert_LInt_LessEqual (FUN) ¶ FUNCTION Assert_LInt_LessEqual : BOOL Assertion function to check that a value of LINT is less or equal the given threshold InOut: Scope Name Type Initial Comment Return Assert_LInt_LessEqual BOOL TRUE if the assertion passes succesfully, FALSE otherwise Input context IBaseIecUnitTest The instance of the test function block calling this function. This instance can be provided by using THIS^ . referenceValue LINT The value indicating the threshold actualValue LINT The value to check wsErrorMsg WSTRING(Constants.WSTRING_LENGTH) “” A custom error message, that is added to the error message of the assertion itself. If this parameter is used, it is recommended to adapt the value of the library parameter Constants.WSTRING_LENGTH .
CreateAssertionErrorMessageForStandardDatatype (FUN) ¶ FUNCTION CreateAssertionErrorMessageForStandardDatatype Helper function to create an error message for failed assertions of standard datatypes. Hint: if wsErrorMsg is used, it is recommended to change the value of the library parameter Constants.WSTRING_LENGTH . InOut: Scope Name Type Comment Inout wsAssertError WSTRING(Constants.WSTRING_LENGTH) Inout Const wsActualValue WSTRING(Constants.WSTRING_LENGTH) The actual value as WSTRING wsReferenceValue WSTRING(Constants.WSTRING_LENGTH) The reference value as WSTRING wsAssertOperator WSTRING(Constants.WSTRING_LENGTH) The assert operator e.g. Strings.EQUAL or Strings.CONTAINS wsErrorMsg WSTRING(Constants.WSTRING_LENGTH) A custom error message that should be appended. If no message is provided the “Additional information” part will not be added to the returned error.
CreateAssertionErrorMessageForStandardDatatypeSingleValue (FUN) ¶ FUNCTION CreateAssertionErrorMessageForStandardDatatypeSingleValue Helper function to create an error message for failed assertions of standard datatypes that only expect an actual value. Hint: if wsErrorMsg is used, it is recommended to change the value of the library parameter Constants.WSTRING_LENGTH . InOut: Scope Name Type Comment Inout wsAssertError WSTRING(Constants.WSTRING_LENGTH) Inout Const wsActualValue WSTRING(Constants.WSTRING_LENGTH) The actual value as WSTRING wsAssertOperator WSTRING(Constants.WSTRING_LENGTH) The assert operator e.g. Strings.IS_TRUE wsErrorMsg WSTRING(Constants.WSTRING_LENGTH) A custom error message that should be appended. If no message is provided the “Additional information” part will not be added to the returned error.
CreateAssertionErrorMessageNonEqualArrayBounds (FUN) ¶ FUNCTION CreateAssertionErrorMessageNonEqualArrayBounds Helper function to create an error message for non-equal bounds of an array. InOut: Scope Name Type Comment Inout wsAssertError WSTRING(Constants.WSTRING_LENGTH) Input diExpectedBound DINT the upper or lower bound of the reference array diActualBound DINT the upper or lower bound of the actual array xIsLowerBound BOOL if set to TRUE the error message contains Lower bounds otherwise Upper bounds diDimension DINT the dimension in which the bounds differ
Interfaces ¶ IBaseIecUnitTest (Interface) HandleAssertResult (Method) HasError (Method)
IBaseIecUnitTest (ITF) ¶ INTERFACE IBaseIecUnitTest This interface is required to use the assertion functionality for IecUnitTests Methods: HandleAssertResult HasError Structure: HandleAssertResult (Method) HasError (Method)
IBaseIecUnitTest.HandleAssertResult (METH) ¶ METHOD HandleAssertResult : BOOL This method should handle the error outputs used to evalutate the success of the unittest The default implementation should look like: CASE eAssertion_Result OF ASSERTION_RESULT.ASSERTION_FAILED: xError := TRUE; iError := 1; sInfo := wsErrorMsg; wsInfo := wsErrorMsg; wsError := wsErrorMsg; ELSE RETURN; END_CASE InOut: Scope Name Type Return HandleAssertResult BOOL Input eAssertion_Result ASSERTION_RESULT wsErrorMsg WSTRING(Constants.WSTRING_LENGTH)
IBaseIecUnitTest.HasError (METH) ¶ METHOD HasError : BOOL This method should only return xError = TRUE InOut: Scope Name Type Return HasError BOOL
Strings (GVL) ¶ Attributes: qualified_only InOut: Scope Name Type Initial Constant LEFT WSTRING “’ “ RIGHT WSTRING “ ‘” LEFT_DOT WSTRING “’.” DOT WSTRING “.” KOMMA_LEFT WSTRING “, “ TUPLE_END WSTRING “): ‘” ASSERTION_FAILED WSTRING “Assertion failed: ‘” ASSERTION_FAILED_VALUE_INDEX WSTRING “Assertion failed for value at index (” ASSERTION_FAILED_VALUE_MISMATCH_CONDITION WSTRING “Assertion failed: The given value(s) is/are not matching the condition ‘” ADDITIONAL_INFORMATION WSTRING “ Additional information: “ UNEQUAL WSTRING “<>” EQUAL WSTRING “=” GREATER_THEN WSTRING “>” LESS_THEN WSTRING “<” GREATER_EQUAL WSTRING “>=” LESS_EQUAL WSTRING “<=” CONTAINS WSTRING “CONTAINS” CONTAINS_NOT WSTRING “CONTAINS NOT” IS_FALSE WSTRING “IS FALSE” IS_TRUE WSTRING “IS TRUE” ENDS_WITH WSTRING “ENDS WITH” STARTS_WITH WSTRING “STARTS WITH” LOWER WSTRING “Lower” UPPER WSTRING “Upper”
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 28.09.2023, 12:04:38 companyName string 3S-Smart Software Solutions GmbH libraryFile Test Manager IEC Unit Test.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile Test Manager IEC Unit Test.clean.json version version 2.0.0.0 ProjectInformation IsEndUserLibrary bool False Released True LastModificationDateTime date 28.09.2023, 12:04:33 LibraryCategories library-category-list Intern|TestManager Author string 3S - Smart Software Solutions GmbH Company Intern CompiledLibraryCompatibilityVersion CODESYS V3.5 SP16 Patch 3 DefaultNamespace TM Description See: Description DocFormat reStructuredText LanguageModelAttribute qualified-access-only Placeholder TestManager Project Test Manager IEC Unit Test Title Test Manager IEC Unit Test Version version 5.1.0.0