Skip to content

Commit da7a183

Browse files
committed
Make absoluetly sure the FATSTAT unit test gives mformat a zeroed-out file to format and that it returns non-zero when an a mismatch occurs.
1 parent 669eb8b commit da7a183

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/FATSTAT/test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ INTERP=${INTERP:-lua}
44
TEST="FATSTAT"
55
SCRIPT="FATSTAT.LUA"
66

7-
mformat -i test.ima -C -f 160
7+
dd if=/dev/zero of=test.ima bs=512 count=320 status=none
8+
mformat -i test.ima -f 160
89
CHASH=$(sha256sum test.ima)
910
# Insert junk data to wipe
1011
dd if=/dev/random of=test.ima bs=512 count=2 seek=300 status=none
@@ -13,4 +14,4 @@ if [ "$CHASH" = "$RHASH" ]; then die; fi
1314
$INTERP $SCRIPT -z test.ima
1415
ZHASH=$(sha256sum test.ima)
1516
rm test.ima
16-
if [ "$CHASH" = "$ZHASH" ]; then echo "$TEST: PASS"; else echo "$TEST: FAIL"; fi
17+
if [ "$CHASH" = "$ZHASH" ]; then echo "$TEST: PASS"; else echo "$TEST: FAIL"; exit 1; fi

0 commit comments

Comments
 (0)