Add a testcase for issue #10.

This commit is contained in:
Moinak Ghosh 2013-05-12 14:19:26 +05:30
parent cbc0c84b12
commit d89c95225a

View file

@ -32,7 +32,7 @@ then
fi fi
unset PCOMPRESS_CHUNK_HASH_GLOBAL unset PCOMPRESS_CHUNK_HASH_GLOBAL
for feat in "-L" "-L -D" "-L -D -E" "-L -B5" "-L -D -E -B2" "-F" "-F -L" for feat in "-L" "-L -D" "-L -D -E -M -C" "-L -B5" "-L -D -E -B2" "-F" "-F -L"
do do
cmd="../../pcompress -c dummy -l4 -s1m $feat $tstf" cmd="../../pcompress -c dummy -l4 -s1m $feat $tstf"
echo "Running $cmd" echo "Running $cmd"
@ -43,6 +43,12 @@ do
rm -f ${tstf}.pz rm -f ${tstf}.pz
break break
fi fi
if [ -f core* ]
then
echo "FATAL: Compression crashed"
rm -f ${tstf}.pz
break
fi
rm -f ${tstf}.pz rm -f ${tstf}.pz
done done
@ -63,6 +69,46 @@ do
done done
done done
#
# Create a file larger than 2GB
#
if [ ! -f ${tstf}.1 ]
then
echo -n "Creating a file approximately 2GB in size "
cp ${tstf} ${tstf}.1
t_sz=$tsz
while [ $t_sz -lt 2147480000 ]
do
cat ${tstf} >> ${tstf}.1
echo -n "."
t_sz=$((t_sz + tsz))
done
echo ""
echo "Done"
fi
#
# Try to compress with segment sizes larger than what some compression algos allow.
#
for feat in "-E -M -C -s 2147480000" "-D -E -M -C -L -P -B 2 -s 2147480000"
do
for algo in lz4 libbsc
do
cmd="../../pcompress -c $algo $feat ${tstf}.1"
echo "Running $cmd"
eval $cmd
if [ $? -eq 0 ]
then
echo "FATAL: Compression DID NOT ERROR where expected"
rm -f ${tstf}.1.pz
break
fi
rm -f ${tstf}.1.pz
done
done
rm -f ${tstf}.1.pz
rm -f ${tstf}.1
for feat in "-S CRC64" "-S BLAKE256" "-S BLAKE512" "-S SHA256" "-S SHA512" "-S KECCAK256" "-S KECCAK512" for feat in "-S CRC64" "-S BLAKE256" "-S BLAKE512" "-S SHA256" "-S SHA512" "-S KECCAK256" "-S KECCAK512"
do do
rm -f ${tstf}.* rm -f ${tstf}.*