aboutsummaryrefslogtreecommitdiff
path: root/stm32/unittest/scripts/tst_codec2_enc_check
diff options
context:
space:
mode:
authorAuthor Name <[email protected]>2023-07-07 12:20:59 +0930
committerDavid Rowe <[email protected]>2023-07-07 12:29:06 +0930
commitac7c48b4dee99d4c772f133d70d8d1b38262fcd2 (patch)
treea2d0ace57a9c0e2e5b611c4987f6fed1b38b81e7 /stm32/unittest/scripts/tst_codec2_enc_check
shallow zip-file copy from codec2 e9d726bf20
Diffstat (limited to 'stm32/unittest/scripts/tst_codec2_enc_check')
-rwxr-xr-xstm32/unittest/scripts/tst_codec2_enc_check59
1 files changed, 59 insertions, 0 deletions
diff --git a/stm32/unittest/scripts/tst_codec2_enc_check b/stm32/unittest/scripts/tst_codec2_enc_check
new file mode 100755
index 0000000..d95bd18
--- /dev/null
+++ b/stm32/unittest/scripts/tst_codec2_enc_check
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# tst_codec2_enc_check
+#
+# Setup input and reference data for one of several versions of this test.
+
+# Find the scripts directory
+SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Setup common variables
+source $SCRIPTS/run_tests_common.sh
+
+# RUN_DIR - Directory where test will be run
+RUN_DIR="${UNITTEST_BASE}/test_run/${FULL_TEST_NAME}"
+
+# Call common setup function to make the directory
+setup_common "${RUN_DIR}"
+
+# Change to test directory
+cd "${RUN_DIR}"
+
+
+#####################################################################
+## Test CHECK actions:
+
+declare -i Fails=0
+
+case "${TEST_OPT}" in
+ 1300)
+ echo -e "\nCompare output binary data"
+ compare_ints -b1 -c ref_enc.raw stm_out.raw
+ error_count=$?
+ if [[ $error_count -le 2 ]]; then
+ echo "Passed"
+ else
+ echo "Failed"
+ let Fails=($Fails + 1)
+ fi
+ ;;
+ 700C)
+ echo -e "\nCompare output binary data"
+ if compare_ints -b1 ref_enc.raw stm_out.raw; then
+ echo "Passed"
+ else
+ echo "Failed"
+ let Fails=($Fails + 1)
+ fi
+ ;;
+ esac
+
+
+if (( $Fails == 0 )); then
+ echo -e "\nTest PASSED"
+else
+ echo -e "\nTest FAILED!"
+fi
+
+
+exit $Fails