#!/bin/sh out=test.out if test ! -d $out then mkdir $out fi for f in `ls -1 $srcdir/dat/q* $srcdir/htscodecs-corpus/dat/q* 2>/dev/null` do comp=${f%/*/*}/dat/r4x16/${f##*/} cut -f 1 < $f | tr -d '\012' > $out/r4x16-nl for o in 0 1 64 65 128 129 192 193 8 9 do if [ ! -e "$comp.$o" ] then continue fi printf 'Testing rans4x16 -r -o%s on %s\t' $o "$f" # Round trip ./rans4x16pr -r -o$o $out/r4x16-nl $out/r4x16.comp 2>>$out/r4x16.stderr || exit 1 wc -c < $out/r4x16.comp ./rans4x16pr -r -d $out/r4x16.comp $out/r4x16.uncomp 2>>$out/r4x16.stderr || exit 1 cmp $out/r4x16-nl $out/r4x16.uncomp || exit 1 # Precompressed data ./rans4x16pr -r -d $comp.$o $out/r4x16.uncomp 2>>$out/r4x16.stderr || exit 1 cmp $out/r4x16-nl $out/r4x16.uncomp || exit 1 done done