aboutsummaryrefslogtreecommitdiff
path: root/tests/300-incorrect_reference_file.sh
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2024-12-28 12:41:18 +0100
committerJán Sučan <jan@jansucan.com>2024-12-28 12:47:08 +0100
commit9280ff2c747a5a59f0a6e0cc6335b24de62cacc9 (patch)
tree1d1b33ba93e2926124cfecf890c8bb2a4236a12e /tests/300-incorrect_reference_file.sh
parent217a6b905d46ee355373b2de60f0f36be828202c (diff)
Rename in file to diff file for restore
Diffstat (limited to 'tests/300-incorrect_reference_file.sh')
-rw-r--r--tests/300-incorrect_reference_file.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/300-incorrect_reference_file.sh b/tests/300-incorrect_reference_file.sh
index ea52ab2..b15ee12 100644
--- a/tests/300-incorrect_reference_file.sh
+++ b/tests/300-incorrect_reference_file.sh
@@ -4,34 +4,34 @@ source ./assert.sh
PROGRAM_EXEC="$1"
-rm -f ref out
-touch ref out
-assert "" "input file is empty" 1 $PROGRAM_EXEC restore ref out
+rm -f diff out
+touch diff out
+assert "" "diff file is empty" 1 $PROGRAM_EXEC restore diff out
-dd if=/dev/zero of=ref bs=513 count=1 1>/dev/null 2>&1
-assert "" "input file has size that cannot contain valid diff data" \
- 1 $PROGRAM_EXEC restore -s 512 ref out
+dd if=/dev/zero of=diff bs=513 count=1 1>/dev/null 2>&1
+assert "" "diff file has size that cannot contain valid diff data" \
+ 1 $PROGRAM_EXEC restore -s 512 diff out
-rm -f ref out
+rm -f diff out
dd if=/dev/zero of=out bs=512 count=2 1>/dev/null 2>&1
# Create a two-sector backup file
-dd if=/dev/zero of=ref bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1
+dd if=/dev/zero of=diff bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1
# The first offset will be 2
-printf '\x02' | dd of=ref bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1
+printf '\x02' | dd of=diff bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1
# The second offset will be 1
-printf '\x01' | dd of=ref bs=1 count=1 seek=520 conv=notrunc 1>/dev/null 2>&1
+printf '\x01' | dd of=diff bs=1 count=1 seek=520 conv=notrunc 1>/dev/null 2>&1
assert "" "a sector offset points behind the previous offset" \
- 1 $PROGRAM_EXEC restore -s 512 ref out
+ 1 $PROGRAM_EXEC restore -s 512 diff out
-rm -f ref out
+rm -f diff out
dd if=/dev/zero of=out bs=512 count=1 1>/dev/null 2>&1
# Create a one-sector backup file
-dd if=/dev/zero of=ref bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1
+dd if=/dev/zero of=diff bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1
# The first offset will be 1
-printf '\x01' | dd of=ref bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1
+printf '\x01' | dd of=diff bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1
assert "" "a sector offset points past the end of the output file" \
- 1 $PROGRAM_EXEC restore -s 512 ref out
+ 1 $PROGRAM_EXEC restore -s 512 diff out
-rm -f ref out
+rm -f diff out
exit 0