Skip to content
Snippets Groups Projects
Commit 1d973fff authored by Mathis Rosenhauer's avatar Mathis Rosenhauer
Browse files

Fix quoting in tests with CCSDS data

parent 477a055c
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
#
# This test uses CCSDS sample data to check decoding and re-encoding.
# Encoded size checks are performed where same size results are to be
# expected.
#
set -e set -e
AEC=../src/aec AEC="../src/aec"
if [ -n "$1" ]; then if [ -n "$1" ]; then
srcdir=$1 srcdir=$1
fi fi
CCSDS_DATA=${srcdir}/../data/121B2TestData CCSDS_DATA="${srcdir}/../data/121B2TestData"
ALLO=${CCSDS_DATA}/AllOptions ALLO="${CCSDS_DATA}/AllOptions"
EXTP=${CCSDS_DATA}/ExtendedParameters EXTP="${CCSDS_DATA}/ExtendedParameters"
LOWE=${CCSDS_DATA}/LowEntropyOptions LOWE="${CCSDS_DATA}/LowEntropyOptions"
filesize () { filesize () {
wc -c $1 | awk '{print $1}' wc -c "$1" | awk '{print $1}'
} }
decode () { decode () {
$AEC -d $3 $1 test.dat "$AEC" -d $3 "$1" test.dat
dd if=test.dat bs=1 count=$(filesize $2) | cmp $2 - dd if=test.dat bs=1 count=$(filesize "$2") | cmp "$2" -
} }
code () { code () {
$AEC $3 $2 test.rz "$AEC" $3 "$2" test.rz
cmp $1 test.rz cmp "$1" test.rz
} }
code_size () { code_size () {
$AEC $3 $2 test.rz "$AEC" $3 "$2" test.rz
if [ ! $(filesize test.rz) -eq $(filesize $1) ]; then if [ ! $(filesize test.rz) -eq $(filesize "$1") ]; then
echo "$1 size mismatch" echo "$1 size mismatch"
exit 1 exit 1
fi fi
...@@ -44,18 +49,18 @@ cosdec () { ...@@ -44,18 +49,18 @@ cosdec () {
echo All Options echo All Options
for i in 01 02 03 04 for i in 01 02 03 04
do do
uf=$ALLO/test_p256n${i}.dat uf="${ALLO}/test_p256n${i}.dat"
codec $ALLO/test_p256n${i}-basic.rz $uf "-n$i -j16 -r16" codec "${ALLO}/test_p256n${i}-basic.rz" "${uf}" "-n$i -j16 -r16"
codec $ALLO/test_p256n${i}-restricted.rz $uf "-n$i -j16 -r16 -t" codec "${ALLO}/test_p256n${i}-restricted.rz" "${uf}" "-n$i -j16 -r16 -t"
done done
for i in 05 06 07 08 09 10 11 12 13 14 15 16 for i in 05 06 07 08 09 10 11 12 13 14 15 16
do do
cosdec $ALLO/test_p256n${i}.rz $ALLO/test_p256n${i}.dat \ cosdec "${ALLO}/test_p256n${i}.rz" "$ALLO/test_p256n${i}.dat" \
"-n$i -j16 -r16" "-n$i -j16 -r16"
done done
for i in 17 18 19 20 21 22 23 24 for i in 17 18 19 20 21 22 23 24
do do
cosdec $ALLO/test_p512n${i}.rz $ALLO/test_p512n${i}.dat \ cosdec "${ALLO}/test_p512n${i}.rz" "$ALLO/test_p512n${i}.dat" \
"-n$i -j16 -r32" "-n$i -j16 -r32"
done done
...@@ -64,17 +69,20 @@ for i in 1 2 3 ...@@ -64,17 +69,20 @@ for i in 1 2 3
do do
for j in 01 02 03 04 for j in 01 02 03 04
do do
uf=$LOWE/Lowset${i}_8bit.dat uf="${LOWE}/Lowset${i}_8bit.dat"
codec $LOWE/Lowset${i}_8bit.n${j}-basic.rz $uf "-n$j -j16 -r64" codec "${LOWE}/Lowset${i}_8bit.n${j}-basic.rz" "${uf}" "-n$j -j16 -r64"
codec $LOWE/Lowset${i}_8bit.n${j}-restricted.rz $uf "-n$j -j16 -r64 -t" codec "${LOWE}/Lowset${i}_8bit.n${j}-restricted.rz" "${uf}" \
"-n$j -j16 -r64 -t"
done done
for j in 05 06 07 08 for j in 05 06 07 08
do do
codec $LOWE/Lowset${i}_8bit.n${j}.rz $LOWE/Lowset${i}_8bit.dat \ codec "${LOWE}/Lowset${i}_8bit.n${j}.rz" "$LOWE/Lowset${i}_8bit.dat" \
"-n$j -j16 -r64" "-n$j -j16 -r64"
done done
done done
echo Extended Parameters echo Extended Parameters
decode $EXTP/sar32bit.j16.r256.rz $EXTP/sar32bit.dat "-n32 -j16 -r256 -p" decode "${EXTP}/sar32bit.j16.r256.rz" "${EXTP}/sar32bit.dat" \
decode $EXTP/sar32bit.j64.r4096.rz $EXTP/sar32bit.dat "-n32 -j64 -r4096 -p" "-n32 -j16 -r256 -p"
decode "${EXTP}/sar32bit.j64.r4096.rz" "${EXTP}/sar32bit.dat" \
"-n32 -j64 -r4096 -p"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment