summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:22:40 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:22:40 +0000
commit121630cb0dafd7187bb66a8c0f1201744f1e163c (patch)
tree7d595e83fb38cafb9e4201b979815fae85560ee9 /testsuite
parentAdding debian version 1.14~rc2-1. (diff)
downloadlziprecover-121630cb0dafd7187bb66a8c0f1201744f1e163c.tar.xz
lziprecover-121630cb0dafd7187bb66a8c0f1201744f1e163c.zip
Merging upstream version 1.14~rc3.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/check.sh11
-rw-r--r--testsuite/fox5_bad.lzbin0 -> 400 bytes
-rw-r--r--testsuite/fox5_bad.txt4
3 files changed, 13 insertions, 2 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index f208067..ea6e768 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -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
diff --git a/testsuite/fox5_bad.lz b/testsuite/fox5_bad.lz
new file mode 100644
index 0000000..8bfd314
--- /dev/null
+++ b/testsuite/fox5_bad.lz
Binary files differ
diff --git a/testsuite/fox5_bad.txt b/testsuite/fox5_bad.txt
new file mode 100644
index 0000000..813a71f
--- /dev/null
+++ b/testsuite/fox5_bad.txt
@@ -0,0 +1,4 @@
+The quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.
+The quick brown fox c††zzzzzzzzzzzzzzzzzzzzzzThe quick brown fox jumps over the lazy dog.
+The quick brown fox jumps over the lazy dog.