stamp-h1
vbig
*~
-debian/*.log
debian/files
debian/*substvars
+*.trs
+*.log
bin_PROGRAMS=vbig
vbig_SOURCES=vbig.cc Arcfour.h Arcfour.cc
man_MANS=vbig.1
-EXTRA_DIST=${man_MANS} README.md
+TESTS=t-both t-seeded t-separate t-corrupt t-truncated t-extended
+EXTRA_DIST=${man_MANS} README.md ${TESTS}
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --both testfile 65536
+rm -f testfile
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --seed chahthaiquiyouto --create testfile 65536
+dd if=/dev/zero of=testfile bs=256 count=1 seek=1 conv=nocreat,notrunc status=none
+if ./vbig --seed chahthaiquiyouto --verify testfile 65536 2>testoutput; then
+ echo >&2 ERROR: verify unexpectedly succeeded
+ exit 1
+fi
+echo 'ERROR: testfile: corrupted at 256/65536 bytes (expected 132 got 0)' > testexpect
+diff -u testexpect testoutput
+rm -f testfile testoutput testexpect
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --seed chahthaiquiyouto --create testfile 65536
+dd if=/dev/zero of=testfile bs=256 count=1 seek=1 conv=nocreat,notrunc oflag=append status=none
+if ./vbig --seed chahthaiquiyouto --verify testfile 65536 2>testoutput; then
+ echo >&2 ERROR: verify unexpectedly succeeded
+ exit 1
+fi
+echo 'ERROR: testfile: extended beyond 65536 bytes' > testexpect
+diff -u testexpect testoutput
+rm -f testfile testoutput testexpect
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --seed chahthaiquiyouto --create testfile 65536
+./vbig --seed chahthaiquiyouto --verify testfile 65536
+rm -f testfile
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --create testfile 65536
+./vbig --verify testfile 65536
+rm -f testfile
--- /dev/null
+#! /bin/sh
+set -e
+rm -f testfile
+./vbig --seed chahthaiquiyouto --create testfile 65536
+truncate --size=32768 testfile
+if ./vbig --seed chahthaiquiyouto --verify testfile 65536 2>testoutput; then
+ echo >&2 ERROR: verify unexpectedly succeeded
+ exit 1
+fi
+echo 'ERROR: testfile: truncated at 32768/65536 bytes' > testexpect
+diff -u testexpect testoutput
+rm -f testfile testoutput testexpect