summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathis Rosenhauer <rosenhauer@dkrz.de>2014-02-04 14:58:13 +0100
committerMathis Rosenhauer <rosenhauer@dkrz.de>2014-02-05 11:20:36 +0100
commit01287457c84a66d04c21a353c8f80332905fc9f4 (patch)
tree5e7ddc35af529926eec253b3775b0b2bbb281b8d /tests
parent1be8ed91a4f17cb71c8ac14e3506936a3d30e0b8 (diff)
downloadlibaec-01287457c84a66d04c21a353c8f80332905fc9f4.tar.gz
libaec-01287457c84a66d04c21a353c8f80332905fc9f4.tar.bz2
libaec-01287457c84a66d04c21a353c8f80332905fc9f4.zip
test with NASA's sample data
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rwxr-xr-xtests/sampledata.sh68
2 files changed, 70 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 790971c..ee0eba7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = color-tests
AM_CPPFLAGS = -I$(top_srcdir)/src
-TESTS = check_code_options check_buffer_sizes
+TESTS = check_code_options check_buffer_sizes sampledata.sh
check_LTLIBRARIES = libcheck_aec.la
libcheck_aec_la_SOURCES = check_aec.c check_aec.h
check_PROGRAMS = check_code_options check_buffer_sizes
@@ -11,3 +11,4 @@ check_buffer_sizes_SOURCES = check_buffer_sizes.c check_aec.h \
$(top_builddir)/src/libaec.h
LDADD = libcheck_aec.la $(top_builddir)/src/libaec.la
+EXTRA_DIST = sampledata.sh
diff --git a/tests/sampledata.sh b/tests/sampledata.sh
new file mode 100755
index 0000000..f6d952d
--- /dev/null
+++ b/tests/sampledata.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+set -e
+AEC=../src/aec
+CCSDS_DATA=121B2TestData
+ALLO=${CCSDS_DATA}/AllOptions
+EXTP=${CCSDS_DATA}/ExtendedParameters
+LOWE=${CCSDS_DATA}/LowEntropyOptions
+archive=121B2TestData.zip
+
+if [ ! -f $archive ]; then
+ wget http://cwe.ccsds.org/sls/docs/SLS-DC/BB121B2TestData/$archive
+fi
+unzip -oq $archive
+
+echo All Options
+ln -f ${ALLO}/test_P512n22.dat ${ALLO}/test_p512n22.dat
+for i in 01 02 03 04
+do
+ $AEC -c -d -n$i -j16 -r16 $ALLO/test_p256n${i}-basic.rz > test.dat
+ ref=$ALLO/test_p256n${i}.dat
+ refsize=$(stat -c "%s" $ref)
+ cmp -n $refsize $ref test.dat
+ $AEC -c -d -n$i -j16 -r16 -t $ALLO/test_p256n${i}-restricted.rz > test.dat
+ cmp -n $refsize $ref test.dat
+done
+for i in 05 06 07 08 09 10 11 12 13 14 15 16
+do
+ $AEC -c -d -n$i -j16 -r16 $ALLO/test_p256n${i}.rz > test.dat
+ cmp $ALLO/test_p256n${i}.dat test.dat
+done
+for i in 17 18 19 20 21 22 23 24
+do
+ $AEC -c -d -n$i -j16 -r32 $ALLO/test_p512n${i}.rz > test.dat
+ cmp $ALLO/test_p512n${i}.dat test.dat
+done
+
+echo Low Entropy Options
+for i in 1 2 3
+do
+ for j in 01 02 03 04
+ do
+ $AEC -c -d -n$j -j16 -r64 $LOWE/Lowset${i}_8bit.n${j}-basic.rz \
+ > test.dat
+ ref=$LOWE/Lowset${i}_8bit.dat
+ refsize=$(stat -c "%s" $ref)
+ cmp -n $refsize $ref test.dat
+ $AEC -c -d -n$j -j16 -r64 -t $LOWE/Lowset${i}_8bit.n${j}-restricted.rz \
+ > test.dat
+ cmp -n $refsize $ref test.dat
+ done
+ for j in 05 06 07 08
+ do
+ $AEC -c -d -n$j -j16 -r64 $LOWE/Lowset${i}_8bit.n${j}.rz \
+ > test.dat
+ ref=$LOWE/Lowset${i}_8bit.dat
+ refsize=$(stat -c "%s" $ref)
+ cmp -n $refsize $ref test.dat
+ done
+done
+
+echo Extended Parameters
+
+$AEC -c -d -n32 -j16 -r256 -p $EXTP/sar32bit.j16.r256.rz > test.dat
+ref=$EXTP/sar32bit.dat
+refsize=$(stat -c "%s" $ref)
+cmp -n $refsize $ref test.dat
+$AEC -c -d -n32 -j64 -r4096 -p $EXTP/sar32bit.j64.r4096.rz > test.dat
+cmp -n $refsize $ref test.dat