chiark / gitweb /
415a306f1c242700387bbb85785962888a137ab2
[vbig.git] / t-corrupt
1 #! /bin/sh
2 set -e
3 rm -f testfile
4 ./vbig --seed chahthaiquiyouto --create testfile 65536
5 dd if=/dev/zero of=testfile bs=256 count=1 seek=1 conv=nocreat,notrunc status=noxfer
6 if ./vbig --seed chahthaiquiyouto --verify testfile 65536 2>testoutput; then
7   echo >&2 ERROR: verify unexpectedly succeeded
8   exit 1
9 fi
10 echo 'ERROR: testfile: corrupted at 256/65536 bytes (expected 132 got 0)' > testexpect
11 diff -u testexpect testoutput
12 rm -f testfile testoutput testexpect