summaryrefslogtreecommitdiff
path: root/tests/unit/q65/test_q65code.cmake
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /tests/unit/q65/test_q65code.cmake
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'tests/unit/q65/test_q65code.cmake')
-rw-r--r--tests/unit/q65/test_q65code.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/q65/test_q65code.cmake b/tests/unit/q65/test_q65code.cmake
new file mode 100644
index 00000000..cfbb9939
--- /dev/null
+++ b/tests/unit/q65/test_q65code.cmake
@@ -0,0 +1,25 @@
+execute_process(
+ COMMAND "${Q65CODE}" "THIS FREE TEXT IS TOO LONG"
+ RESULT_VARIABLE fallback_result
+ OUTPUT_VARIABLE fallback_output
+ ERROR_VARIABLE fallback_error
+)
+if (NOT fallback_result EQUAL 0)
+ message(FATAL_ERROR "Legacy fallback failed (${fallback_result}):\n${fallback_output}${fallback_error}")
+endif ()
+if (NOT fallback_output MATCHES "Message sent:[ ]+THIS FREE TEX")
+ message(FATAL_ERROR "Fallback output was unexpected:\n${fallback_output}")
+endif ()
+
+execute_process(
+ COMMAND "${Q65CODE}" "HELLO@WORLD"
+ RESULT_VARIABLE rejected_result
+ OUTPUT_VARIABLE rejected_output
+ ERROR_VARIABLE rejected_error
+)
+if (rejected_result EQUAL 0)
+ message(FATAL_ERROR "Unrepresentable message returned success:\n${rejected_output}")
+endif ()
+if (NOT rejected_output MATCHES "Cannot encode message:[ ]+HELLO@WORLD")
+ message(FATAL_ERROR "Rejected message output was unexpected:\n${rejected_output}${rejected_error}")
+endif ()