1
0
Fork 0

Merging upstream version 1.14~rc3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:13:34 +01:00
parent fab5d40dce
commit 090aac16e8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
17 changed files with 152 additions and 74 deletions

View file

@ -25,6 +25,8 @@ cd "${objdir}"/tmp
in="${testdir}"/test.txt
in_lz="${testdir}"/test_v1.lz
inD="${testdir}"/test921-1921.txt
fox5="${testdir}"/fox5_bad.txt
fox5_lz="${testdir}"/fox5_bad.lz
bad1_lz="${testdir}"/test_bad1.lz
bad2_lz="${testdir}"/test_bad2.lz
bad3_lz="${testdir}"/test_bad3.lz
@ -33,6 +35,7 @@ bad5_lz="${testdir}"/test_bad5.lz
fail=0
# Description of test files for lziprecover:
# fox5_bad.lz: byte at offset 188 changed from 0x34 to 0x33
# test_bad1.lz: byte at offset 67 changed from 0xCC to 0x33
# test_bad2.lz: [ 34- 66) --> copy of bytes [ 68- 100)
# test_bad3.lz: [ 512-1536) --> zeroed; [2560-3584) --> zeroed
@ -68,9 +71,13 @@ printf .
"${LZIPRECOVER}" -D 921,1000 "${in_lz}" > copy || fail=1
cmp "${inD}" copy || fail=1
printf .
"${LZIPRECOVER}" -D0 -iq -fo copy "${fox5_lz}"
if [ $? = 2 ] && cmp "${fox5}" copy ; then printf . ; else fail=1 ; printf - ; fi
"${LZIPRECOVER}" -D0 -iq "${fox5_lz}" > copy
if [ $? = 2 ] && cmp "${fox5}" copy ; then printf . ; else fail=1 ; printf - ; fi
"${LZIPRECOVER}" -m -o copy.lz "${bad1_lz}" "${bad2_lz}" "${bad1_lz}" -q
if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi
if [ $? != 2 ] ; then fail=1 ; printf - ; else printf . ; fi
"${LZIPRECOVER}" -m -o copy.lz "${bad1_lz}" "${bad2_lz}" || fail=1
"${LZIPRECOVER}" -df copy.lz || fail=1
cmp "${in}" copy || fail=1
@ -119,7 +126,7 @@ cat "${in_lz}" "${in_lz}" "${in_lz}" > copy || framework_failure
printf "garbage" >> copy || fail=1
"${LZIPRECOVER}" -s -o copy.lz copy || fail=1
for i in 1 2 3 ; do
"${LZIPRECOVER}" -cd rec0000${i}copy.lz > copy || fail=1
"${LZIPRECOVER}" -cd rec${i}copy.lz > copy || fail=1
cmp "${in}" copy || fail=1
printf .
done