X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/blobdiff_plain/94cc6656cd266c2f0d8eb5bc1201fa091744c46c..ca9488ce89bd4895db0341db393ec03696b4ebd3:/tests/engine-pcx-rlencode.sh diff --git a/tests/engine-pcx-rlencode.sh b/tests/engine-pcx-rlencode.sh new file mode 100644 index 0000000..3a05444 --- /dev/null +++ b/tests/engine-pcx-rlencode.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check corner cases of the PCX run-length encoder. +# Copyright © 2012 Nick Bowler +# +# License WTFPL2: Do What The Fuck You Want To Public License, version 2. +# This is free software: you are free to do what the fuck you want to. +# There is NO WARRANTY, to the extent permitted by law. + +pcxrle=test/pcxrle$EXEEXT + +$pcxrle 00 || exit 1 +$pcxrle 0000 || exit 1 +$pcxrle c100 || exit 1 + +# Test RLE rollover +t1=00 +t2=$t1$t1 +t4=$t2$t2 +t8=$t4$t4 +t16=$t8$t8 +t32=$t16$t16 +t64=$t32$t32 + +$pcxrle "$t32$t16$t8$t4$t2$t1" || exit 1 # maximum possible run +$pcxrle "$t64" || exit 1 +$pcxrle "$t64$t64$t64" || exit 1