diff options
| author | Jan Sucan <jan@jansucan.com> | 2025-01-18 07:57:57 +0100 |
|---|---|---|
| committer | Ján Sučan <jan@jansucan.com> | 2025-01-18 12:44:04 +0100 |
| commit | 8b51499900e125a55dcdc425d29550b98a8064b4 (patch) | |
| tree | 938545b3b612bcacd3599785be3f4a23ec08bea7 /tests/300-incorrect_reference_file.sh | |
| parent | a7e8d00f5140d250e339736eb49e20609bffa47f (diff) | |
Initial implementation of diff file format v2
Diffstat (limited to 'tests/300-incorrect_reference_file.sh')
| -rw-r--r-- | tests/300-incorrect_reference_file.sh | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/300-incorrect_reference_file.sh b/tests/300-incorrect_reference_file.sh deleted file mode 100644 index c250541..0000000 --- a/tests/300-incorrect_reference_file.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -source ./assert.sh - -PROGRAM_EXEC="$1" - -rm -f diff out -touch diff out -assert "" "diff file is empty" 1 $PROGRAM_EXEC restore -d diff -o 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 -d diff -o 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=diff bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1 -# The first offset will be 2 -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=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 -d diff -o 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=diff bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1 -# The first offset will be 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 -d diff -o out - -rm -f diff out - -exit 0 |
