2011-07-31 08:01:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# Author: Jonathan Nieder
|
|
|
|
#
|
|
|
|
# This file has been put into the public domain.
|
|
|
|
# You can do whatever you want with this file.
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# If scripts weren't built, this test is skipped.
|
|
|
|
XZ=../src/xz/xz
|
|
|
|
XZDIFF=../src/scripts/xzdiff
|
|
|
|
test -x "$XZ" || XZ=
|
2011-08-06 17:37:28 +00:00
|
|
|
test -x "$XZDIFF" || XZDIFF=
|
2011-07-31 08:01:47 +00:00
|
|
|
if test -z "$XZ" || test -z "$XZDIFF"; then
|
|
|
|
(exit 77)
|
|
|
|
exit 77
|
|
|
|
fi
|
|
|
|
|
|
|
|
PATH=`pwd`/../src/xz:$PATH
|
|
|
|
export 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
|
|
|
|
|
2011-08-06 17:37:28 +00:00
|
|
|
"$XZDIFF" "$preimage" "$samepostimage" >/dev/null
|
2011-07-31 08:01:47 +00:00
|
|
|
status=$?
|
|
|
|
if test "$status" != 0 ; then
|
|
|
|
echo "xzdiff with no changes exited with status $status != 0"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2011-08-06 17:37:28 +00:00
|
|
|
"$XZDIFF" "$preimage" "$otherpostimage" >/dev/null
|
2011-07-31 08:01:47 +00:00
|
|
|
status=$?
|
|
|
|
if test "$status" != 1 ; then
|
|
|
|
echo "xzdiff with changes exited with status $status != 1"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2011-08-06 17:37:28 +00:00
|
|
|
"$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1
|
2011-07-31 08:01:47 +00:00
|
|
|
status=$?
|
|
|
|
if test "$status" != 2 ; then
|
|
|
|
echo "xzdiff with missing operand exited with status $status != 2"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
(exit 0)
|
|
|
|
exit 0
|