# HG changeset patch # User Edouard Tisserant # Date 1679905154 -7200 # Node ID fda6c1a37662763a47ed0330c84a24d632990b4e # Parent a811e1ff718a5c5afb25e29033b23d0d746f2b84 Tests: Add preliminary IEC-61131 language test, to be continued. Test sets BEREMIZ_TEST_CYCLES in order to speed-up TON duration test. diff -r a811e1ff718a -r fda6c1a37662 tests/cli_tests/iec61131_lang_test.bash --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/cli_tests/iec61131_lang_test.bash Mon Mar 27 10:19:14 2023 +0200 @@ -0,0 +1,15 @@ +#!/bin/bash + +# Run IEC61131 language test through command line, and check for success in output + +coproc setsid $BEREMIZPYTHONPATH $BEREMIZPATH/Beremiz_cli.py -k --project-home $BEREMIZPATH/tests/projects/iec61131_lang_test build transfer run; + +while read -t 5 -u ${COPROC[0]} line; do + echo "$line" + if [[ "$line" == *ALL\ TESTS\ OK* ]]; then + pkill INT -s $COPROC_PID + exit 0 + fi +done + +exit 42 diff -r a811e1ff718a -r fda6c1a37662 tests/projects/iec61131_lang_test/beremiz.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/projects/iec61131_lang_test/beremiz.xml Mon Mar 27 10:19:14 2023 +0200 @@ -0,0 +1,6 @@ + + + + + + diff -r a811e1ff718a -r fda6c1a37662 tests/projects/iec61131_lang_test/gen_conversion.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/projects/iec61131_lang_test/gen_conversion.py Mon Mar 27 10:19:14 2023 +0200 @@ -0,0 +1,37 @@ + +# Naive code generator for type convesion function XX_TO_YY testing + + +types = [ + ("BOOL", "TRUE"), + ("SINT", "42"), + ("USINT", "42"), + ("BYTE", "42"), + ("STRING", "'42'"), + ("INT", "42"), + ("UINT", "42"), + ("WORD", "42"), + ("DINT", "42"), + ("UDINT", "42"), + ("DWORD", "42"), + ("LINT", "42"), + ("ULINT", "42"), + ("LWORD", "42"), + ("REAL", "42.0"), + ("LREAL", "42.0"), + #("TIME", "42"), + #("TOD", "42"), + #("DATE", "42"), + #("DT", "42"), +] + +for tsrc, src_literal in types: + for tdest, dest_literal in types: + if tsrc == tdest: continue + s = f""" +RESULT := '{tsrc}_TO_{tdest}'; +IF {tsrc}_TO_{tdest}({tsrc}#{src_literal}) <> {tdest}#{dest_literal} THEN RETURN; END_IF; +""" + print(s) + + diff -r a811e1ff718a -r fda6c1a37662 tests/projects/iec61131_lang_test/plc.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/projects/iec61131_lang_test/plc.xml Mon Mar 27 10:19:14 2023 +0200 @@ -0,0 +1,2183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_USINT'; +IF BOOL_TO_USINT(BOOL#TRUE) <> USINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_BYTE'; +IF BOOL_TO_BYTE(BOOL#TRUE) <> BYTE#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_STRING'; +IF BOOL_TO_STRING(BOOL#TRUE) <> 'TRUE' THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_INT'; +IF BOOL_TO_INT(BOOL#TRUE) <> INT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_UINT'; +IF BOOL_TO_UINT(BOOL#TRUE) <> UINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_WORD'; +IF BOOL_TO_WORD(BOOL#TRUE) <> WORD#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_DINT'; +IF BOOL_TO_DINT(BOOL#TRUE) <> DINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_UDINT'; +IF BOOL_TO_UDINT(BOOL#TRUE) <> UDINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_DWORD'; +IF BOOL_TO_DWORD(BOOL#TRUE) <> DWORD#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_LINT'; +IF BOOL_TO_LINT(BOOL#TRUE) <> LINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_ULINT'; +IF BOOL_TO_ULINT(BOOL#TRUE) <> ULINT#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_LWORD'; +IF BOOL_TO_LWORD(BOOL#TRUE) <> LWORD#1 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_REAL'; +IF BOOL_TO_REAL(BOOL#TRUE) <> REAL#1.0 THEN RETURN; END_IF; + + +RESULT := 'BOOL_TO_LREAL'; +IF BOOL_TO_LREAL(BOOL#TRUE) <> LREAL#1.0 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_BOOL'; +IF SINT_TO_BOOL(SINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_USINT'; +IF SINT_TO_USINT(SINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_BYTE'; +IF SINT_TO_BYTE(SINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_STRING'; +IF SINT_TO_STRING(SINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_INT'; +IF SINT_TO_INT(SINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_UINT'; +IF SINT_TO_UINT(SINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_WORD'; +IF SINT_TO_WORD(SINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_DINT'; +IF SINT_TO_DINT(SINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_UDINT'; +IF SINT_TO_UDINT(SINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_DWORD'; +IF SINT_TO_DWORD(SINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_LINT'; +IF SINT_TO_LINT(SINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_ULINT'; +IF SINT_TO_ULINT(SINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_LWORD'; +IF SINT_TO_LWORD(SINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_REAL'; +IF SINT_TO_REAL(SINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'SINT_TO_LREAL'; +IF SINT_TO_LREAL(SINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_BOOL'; +IF USINT_TO_BOOL(USINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_SINT'; +IF USINT_TO_SINT(USINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_BYTE'; +IF USINT_TO_BYTE(USINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_STRING'; +IF USINT_TO_STRING(USINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_INT'; +IF USINT_TO_INT(USINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_UINT'; +IF USINT_TO_UINT(USINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_WORD'; +IF USINT_TO_WORD(USINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_DINT'; +IF USINT_TO_DINT(USINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_UDINT'; +IF USINT_TO_UDINT(USINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_DWORD'; +IF USINT_TO_DWORD(USINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_LINT'; +IF USINT_TO_LINT(USINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_ULINT'; +IF USINT_TO_ULINT(USINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_LWORD'; +IF USINT_TO_LWORD(USINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_REAL'; +IF USINT_TO_REAL(USINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'USINT_TO_LREAL'; +IF USINT_TO_LREAL(USINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_BOOL'; +IF BYTE_TO_BOOL(BYTE#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_SINT'; +IF BYTE_TO_SINT(BYTE#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_USINT'; +IF BYTE_TO_USINT(BYTE#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_STRING'; +IF BYTE_TO_STRING(BYTE#42) <> '16#2a' THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_INT'; +IF BYTE_TO_INT(BYTE#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_UINT'; +IF BYTE_TO_UINT(BYTE#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_WORD'; +IF BYTE_TO_WORD(BYTE#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_DINT'; +IF BYTE_TO_DINT(BYTE#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_UDINT'; +IF BYTE_TO_UDINT(BYTE#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_DWORD'; +IF BYTE_TO_DWORD(BYTE#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_LINT'; +IF BYTE_TO_LINT(BYTE#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_ULINT'; +IF BYTE_TO_ULINT(BYTE#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_LWORD'; +IF BYTE_TO_LWORD(BYTE#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_REAL'; +IF BYTE_TO_REAL(BYTE#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'BYTE_TO_LREAL'; +IF BYTE_TO_LREAL(BYTE#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_BOOL'; +IF STRING_TO_BOOL('42') <> BOOL#FALSE THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_SINT'; +IF STRING_TO_SINT('42') <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_USINT'; +IF STRING_TO_USINT('42') <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_BYTE'; +IF STRING_TO_BYTE('42') <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_INT'; +IF STRING_TO_INT('42') <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_UINT'; +IF STRING_TO_UINT('42') <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_WORD'; +IF STRING_TO_WORD('42') <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_DINT'; +IF STRING_TO_DINT('42') <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_UDINT'; +IF STRING_TO_UDINT('42') <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_DWORD'; +IF STRING_TO_DWORD('42') <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_LINT'; +IF STRING_TO_LINT('42') <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_ULINT'; +IF STRING_TO_ULINT('42') <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_LWORD'; +IF STRING_TO_LWORD('42') <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_REAL'; +IF STRING_TO_REAL('42') <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'STRING_TO_LREAL'; +IF STRING_TO_LREAL('42') <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_BOOL'; +IF INT_TO_BOOL(INT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'INT_TO_SINT'; +IF INT_TO_SINT(INT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_USINT'; +IF INT_TO_USINT(INT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_BYTE'; +IF INT_TO_BYTE(INT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_STRING'; +IF INT_TO_STRING(INT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'INT_TO_UINT'; +IF INT_TO_UINT(INT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_WORD'; +IF INT_TO_WORD(INT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_DINT'; +IF INT_TO_DINT(INT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_UDINT'; +IF INT_TO_UDINT(INT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_DWORD'; +IF INT_TO_DWORD(INT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_LINT'; +IF INT_TO_LINT(INT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_ULINT'; +IF INT_TO_ULINT(INT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_LWORD'; +IF INT_TO_LWORD(INT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_REAL'; +IF INT_TO_REAL(INT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'INT_TO_LREAL'; +IF INT_TO_LREAL(INT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_BOOL'; +IF UINT_TO_BOOL(UINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_SINT'; +IF UINT_TO_SINT(UINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_USINT'; +IF UINT_TO_USINT(UINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_BYTE'; +IF UINT_TO_BYTE(UINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_STRING'; +IF UINT_TO_STRING(UINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_INT'; +IF UINT_TO_INT(UINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_WORD'; +IF UINT_TO_WORD(UINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_DINT'; +IF UINT_TO_DINT(UINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_UDINT'; +IF UINT_TO_UDINT(UINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_DWORD'; +IF UINT_TO_DWORD(UINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_LINT'; +IF UINT_TO_LINT(UINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_ULINT'; +IF UINT_TO_ULINT(UINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_LWORD'; +IF UINT_TO_LWORD(UINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_REAL'; +IF UINT_TO_REAL(UINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'UINT_TO_LREAL'; +IF UINT_TO_LREAL(UINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_BOOL'; +IF WORD_TO_BOOL(WORD#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_SINT'; +IF WORD_TO_SINT(WORD#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_USINT'; +IF WORD_TO_USINT(WORD#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_BYTE'; +IF WORD_TO_BYTE(WORD#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_STRING'; +IF WORD_TO_STRING(WORD#42) <> '16#2a' THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_INT'; +IF WORD_TO_INT(WORD#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_UINT'; +IF WORD_TO_UINT(WORD#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_DINT'; +IF WORD_TO_DINT(WORD#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_UDINT'; +IF WORD_TO_UDINT(WORD#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_DWORD'; +IF WORD_TO_DWORD(WORD#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_LINT'; +IF WORD_TO_LINT(WORD#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_ULINT'; +IF WORD_TO_ULINT(WORD#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_LWORD'; +IF WORD_TO_LWORD(WORD#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_REAL'; +IF WORD_TO_REAL(WORD#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'WORD_TO_LREAL'; +IF WORD_TO_LREAL(WORD#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_BOOL'; +IF DINT_TO_BOOL(DINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_SINT'; +IF DINT_TO_SINT(DINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_USINT'; +IF DINT_TO_USINT(DINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_BYTE'; +IF DINT_TO_BYTE(DINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_STRING'; +IF DINT_TO_STRING(DINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_INT'; +IF DINT_TO_INT(DINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_UINT'; +IF DINT_TO_UINT(DINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_WORD'; +IF DINT_TO_WORD(DINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_UDINT'; +IF DINT_TO_UDINT(DINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_DWORD'; +IF DINT_TO_DWORD(DINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_LINT'; +IF DINT_TO_LINT(DINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_ULINT'; +IF DINT_TO_ULINT(DINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_LWORD'; +IF DINT_TO_LWORD(DINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_REAL'; +IF DINT_TO_REAL(DINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'DINT_TO_LREAL'; +IF DINT_TO_LREAL(DINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_BOOL'; +IF UDINT_TO_BOOL(UDINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_SINT'; +IF UDINT_TO_SINT(UDINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_USINT'; +IF UDINT_TO_USINT(UDINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_BYTE'; +IF UDINT_TO_BYTE(UDINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_STRING'; +IF UDINT_TO_STRING(UDINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_INT'; +IF UDINT_TO_INT(UDINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_UINT'; +IF UDINT_TO_UINT(UDINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_WORD'; +IF UDINT_TO_WORD(UDINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_DINT'; +IF UDINT_TO_DINT(UDINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_DWORD'; +IF UDINT_TO_DWORD(UDINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_LINT'; +IF UDINT_TO_LINT(UDINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_ULINT'; +IF UDINT_TO_ULINT(UDINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_LWORD'; +IF UDINT_TO_LWORD(UDINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_REAL'; +IF UDINT_TO_REAL(UDINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'UDINT_TO_LREAL'; +IF UDINT_TO_LREAL(UDINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_BOOL'; +IF DWORD_TO_BOOL(DWORD#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_SINT'; +IF DWORD_TO_SINT(DWORD#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_USINT'; +IF DWORD_TO_USINT(DWORD#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_BYTE'; +IF DWORD_TO_BYTE(DWORD#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_STRING'; +IF DWORD_TO_STRING(DWORD#42) <> '16#2a' THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_INT'; +IF DWORD_TO_INT(DWORD#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_UINT'; +IF DWORD_TO_UINT(DWORD#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_WORD'; +IF DWORD_TO_WORD(DWORD#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_DINT'; +IF DWORD_TO_DINT(DWORD#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_UDINT'; +IF DWORD_TO_UDINT(DWORD#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_LINT'; +IF DWORD_TO_LINT(DWORD#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_ULINT'; +IF DWORD_TO_ULINT(DWORD#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_LWORD'; +IF DWORD_TO_LWORD(DWORD#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_REAL'; +IF DWORD_TO_REAL(DWORD#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'DWORD_TO_LREAL'; +IF DWORD_TO_LREAL(DWORD#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_BOOL'; +IF LINT_TO_BOOL(LINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_SINT'; +IF LINT_TO_SINT(LINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_USINT'; +IF LINT_TO_USINT(LINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_BYTE'; +IF LINT_TO_BYTE(LINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_STRING'; +IF LINT_TO_STRING(LINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_INT'; +IF LINT_TO_INT(LINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_UINT'; +IF LINT_TO_UINT(LINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_WORD'; +IF LINT_TO_WORD(LINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_DINT'; +IF LINT_TO_DINT(LINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_UDINT'; +IF LINT_TO_UDINT(LINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_DWORD'; +IF LINT_TO_DWORD(LINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_ULINT'; +IF LINT_TO_ULINT(LINT#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_LWORD'; +IF LINT_TO_LWORD(LINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_REAL'; +IF LINT_TO_REAL(LINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'LINT_TO_LREAL'; +IF LINT_TO_LREAL(LINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_BOOL'; +IF ULINT_TO_BOOL(ULINT#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_SINT'; +IF ULINT_TO_SINT(ULINT#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_USINT'; +IF ULINT_TO_USINT(ULINT#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_BYTE'; +IF ULINT_TO_BYTE(ULINT#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_STRING'; +IF ULINT_TO_STRING(ULINT#42) <> '42' THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_INT'; +IF ULINT_TO_INT(ULINT#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_UINT'; +IF ULINT_TO_UINT(ULINT#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_WORD'; +IF ULINT_TO_WORD(ULINT#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_DINT'; +IF ULINT_TO_DINT(ULINT#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_UDINT'; +IF ULINT_TO_UDINT(ULINT#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_DWORD'; +IF ULINT_TO_DWORD(ULINT#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_LINT'; +IF ULINT_TO_LINT(ULINT#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_LWORD'; +IF ULINT_TO_LWORD(ULINT#42) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_REAL'; +IF ULINT_TO_REAL(ULINT#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'ULINT_TO_LREAL'; +IF ULINT_TO_LREAL(ULINT#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_BOOL'; +IF LWORD_TO_BOOL(LWORD#42) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_SINT'; +IF LWORD_TO_SINT(LWORD#42) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_USINT'; +IF LWORD_TO_USINT(LWORD#42) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_BYTE'; +IF LWORD_TO_BYTE(LWORD#42) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_STRING'; +IF LWORD_TO_STRING(LWORD#42) <> '16#2a' THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_INT'; +IF LWORD_TO_INT(LWORD#42) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_UINT'; +IF LWORD_TO_UINT(LWORD#42) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_WORD'; +IF LWORD_TO_WORD(LWORD#42) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_DINT'; +IF LWORD_TO_DINT(LWORD#42) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_UDINT'; +IF LWORD_TO_UDINT(LWORD#42) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_DWORD'; +IF LWORD_TO_DWORD(LWORD#42) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_LINT'; +IF LWORD_TO_LINT(LWORD#42) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_ULINT'; +IF LWORD_TO_ULINT(LWORD#42) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_REAL'; +IF LWORD_TO_REAL(LWORD#42) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'LWORD_TO_LREAL'; +IF LWORD_TO_LREAL(LWORD#42) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_BOOL'; +IF REAL_TO_BOOL(REAL#42.0) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_SINT'; +IF REAL_TO_SINT(REAL#42.0) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_USINT'; +IF REAL_TO_USINT(REAL#42.0) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_BYTE'; +IF REAL_TO_BYTE(REAL#42.0) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_STRING'; +IF REAL_TO_STRING(REAL#42.0) <> '42' THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_INT'; +IF REAL_TO_INT(REAL#42.0) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_UINT'; +IF REAL_TO_UINT(REAL#42.0) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_WORD'; +IF REAL_TO_WORD(REAL#42.0) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_DINT'; +IF REAL_TO_DINT(REAL#42.0) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_UDINT'; +IF REAL_TO_UDINT(REAL#42.0) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_DWORD'; +IF REAL_TO_DWORD(REAL#42.0) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_LINT'; +IF REAL_TO_LINT(REAL#42.0) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_ULINT'; +IF REAL_TO_ULINT(REAL#42.0) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_LWORD'; +IF REAL_TO_LWORD(REAL#42.0) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'REAL_TO_LREAL'; +IF REAL_TO_LREAL(REAL#42.0) <> LREAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_BOOL'; +IF LREAL_TO_BOOL(LREAL#42.0) <> BOOL#TRUE THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_SINT'; +IF LREAL_TO_SINT(LREAL#42.0) <> SINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_USINT'; +IF LREAL_TO_USINT(LREAL#42.0) <> USINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_BYTE'; +IF LREAL_TO_BYTE(LREAL#42.0) <> BYTE#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_STRING'; +IF LREAL_TO_STRING(LREAL#42.0) <> '42' THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_INT'; +IF LREAL_TO_INT(LREAL#42.0) <> INT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_UINT'; +IF LREAL_TO_UINT(LREAL#42.0) <> UINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_WORD'; +IF LREAL_TO_WORD(LREAL#42.0) <> WORD#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_DINT'; +IF LREAL_TO_DINT(LREAL#42.0) <> DINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_UDINT'; +IF LREAL_TO_UDINT(LREAL#42.0) <> UDINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_DWORD'; +IF LREAL_TO_DWORD(LREAL#42.0) <> DWORD#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_LINT'; +IF LREAL_TO_LINT(LREAL#42.0) <> LINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_ULINT'; +IF LREAL_TO_ULINT(LREAL#42.0) <> ULINT#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_LWORD'; +IF LREAL_TO_LWORD(LREAL#42.0) <> LWORD#42 THEN RETURN; END_IF; + + +RESULT := 'LREAL_TO_REAL'; +IF LREAL_TO_REAL(LREAL#42.0) <> REAL#42.0 THEN RETURN; END_IF; + + +RESULT := 'OK'; + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'CONVERSION: ' + + + + + + + DEBUG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'TEMPO: ' + + + + + + + DEBUG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'OK' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'OK' + + + + + + + DEBUG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'ALL TESTS OK' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RUN + + + + + + + RUN + + + + + + + TIME#10s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + START_TIME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + START_TIME + + + + + + + + + + + + + + + + + VALID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TIME#1s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'OK' + + + + + + + 'BAD' + + + + + + + + + + + RESULT + + + + + + + + + + + + + + + + + +