Lasse Collin wrote:

> The fix looks OK. The test suite addition needs minor changes.

Thanks.  Here is a patch for squashing in.

Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
---
 tests/test_scripts.sh |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/tests/test_scripts.sh b/tests/test_scripts.sh
index 6e83d397..891fc76a 100755
--- a/tests/test_scripts.sh
+++ b/tests/test_scripts.sh
@@ -19,23 +19,14 @@ if test -z "$XZ" || test -z "$XZDIFF"; then
        exit 77
 fi
 
-temporaries="tmp_preimage.xz tmp_samepostimage.xz tmp_otherpostimage.xz"
-rm -f $temporaries
-trap "rm -f $temporaries" 0
+PATH=`pwd`/../src/xz:$PATH
+export PATH
 
-PATH=$(pwd)/../src/xz:$PATH
+preimage=$srcdir/files/good-1-check-crc32.xz
+samepostimage=$srcdir/files/good-1-check-crc64.xz
+otherpostimage=$srcdir/files/good-1-lzma2-1.xz
 
-if echo unchanged | "$XZ" > tmp_preimage.xz &&
-   echo unchanged | "$XZ" > tmp_samepostimage.xz &&
-   echo changed | "$XZ" > tmp_otherpostimage.xz ; then
-       :
-else
-       echo "Compressing preimage or postimage failed"
-       (exit 1)
-       exit 1
-fi
-
-sh "$XZDIFF" tmp_preimage.xz tmp_samepostimage.xz >/dev/null
+sh "$XZDIFF" "$preimage" "$samepostimage" >/dev/null
 status=$?
 if test "$status" != 0 ; then
        echo "xzdiff with no changes exited with status $status != 0"
@@ -43,7 +34,7 @@ if test "$status" != 0 ; then
        exit 1
 fi
 
-sh "$XZDIFF" tmp_preimage.xz tmp_otherpostimage.xz >/dev/null
+sh "$XZDIFF" "$preimage" "$otherpostimage" >/dev/null
 status=$?
 if test "$status" != 1 ; then
        echo "xzdiff with changes exited with status $status != 1"
@@ -51,7 +42,7 @@ if test "$status" != 1 ; then
        exit 1
 fi
 
-sh "$XZDIFF" tmp_preimage.xz tmp_missingpostimage.xz >/dev/null 2>&1
+sh "$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1
 status=$?
 if test "$status" != 2 ; then
        echo "xzdiff with missing operand exited with status $status != 2"
-- 
1.7.6


Reply via email to