case7 808 Bytes
#!/bin/bash

TESTFILE=testfile.$$

./mkcart > $TESTFILE
. ./testlib.sh

export BBC_BAD_BLKS=
export BBC_READ_DBE_BLKS=
export BBC_WRITE_ERR_BLKS=

echo "Test (7) Read $1 with DBE"

##### Add file first (already tested in case 1)
sk=$(($RANDOM % 256))
dd if=common/rdata of=tmp.$$ bs=1 count=16384 skip=$sk >$OUTPUT 2>&1
emsh << END_OF_FILE >$OUTPUT 2>&1
u ./$TESTFILE
B
F
A
P$2 tmp.$$
END_OF_FILE

cp ./$TESTFILE bkup.$$
export BBC_READ_DBE_BLKS=4079

emsh << END_OF_FILE >out7.$$ 2>err7.$$
u ./$TESTFILE
B
A
G$2 tmp1.$$
END_OF_FILE

check_log 7 out
check_log 7 err

if [ -f tmp1.$$ ]; then
   echo "Failed (7): GC should not create file"
   exit
fi

if ! cmp bkup.$$ ./$TESTFILE; then 
   echo "Failed (7): card data change during GC"
   exit
fi

rm -rf  ./$TESTFILE err7.$$ out.$$ tmp*.$$  bkup.$$

exit 0