diff options
| author | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
| commit | 059831534c7e884f0a607ed86b582fd00d821731 (patch) | |
| tree | 76bcb67a78f8aa2654fd34c2ad801a62136b0170 /tests/unit/packjt77/test_encode77.cmake | |
| parent | d83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff) | |
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'tests/unit/packjt77/test_encode77.cmake')
| -rw-r--r-- | tests/unit/packjt77/test_encode77.cmake | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/packjt77/test_encode77.cmake b/tests/unit/packjt77/test_encode77.cmake new file mode 100644 index 00000000..f614241a --- /dev/null +++ b/tests/unit/packjt77/test_encode77.cmake @@ -0,0 +1,39 @@ +execute_process( + COMMAND "${ENCODE77}" "CQ K1ABC FN42" + RESULT_VARIABLE valid_result + OUTPUT_VARIABLE valid_output + ERROR_VARIABLE valid_error +) +if (NOT valid_result EQUAL 0) + message(FATAL_ERROR "Valid message failed (${valid_result}):\n${valid_output}${valid_error}") +endif () +if (NOT valid_output MATCHES "1[ ]+OK[ ]+CQ K1ABC FN42[ ]+CQ K1ABC FN42") + message(FATAL_ERROR "Valid message output was unexpected:\n${valid_output}") +endif () + +execute_process( + COMMAND "${ENCODE77}" "THIS FREE TEXT IS TOO LONG" + RESULT_VARIABLE rejected_result + OUTPUT_VARIABLE rejected_output + ERROR_VARIABLE rejected_error +) +if (rejected_result EQUAL 0) + message(FATAL_ERROR "Rejected message returned success:\n${rejected_output}") +endif () +if (NOT rejected_output MATCHES "REJECTED[ ]+THIS FREE TEXT IS TOO LONG[ ]+free text too long") + message(FATAL_ERROR "Rejected message output was unexpected:\n${rejected_output}${rejected_error}") +endif () + +execute_process( + COMMAND "${ENCODE77}" -f "${INPUT_FILE}" + WORKING_DIRECTORY "${INPUT_DIR}" + RESULT_VARIABLE batch_result + OUTPUT_VARIABLE batch_output + ERROR_VARIABLE batch_error +) +if (batch_result EQUAL 0) + message(FATAL_ERROR "Batch with a rejection returned success:\n${batch_output}") +endif () +if (NOT batch_output MATCHES "Summary: 2 encoded, 1 rejected, 0 unpack failures, 0 differences") + message(FATAL_ERROR "Batch summary was unexpected:\n${batch_output}${batch_error}") +endif () |
