Skip to content

Commit

Permalink
add test12 to check Parchive#29, reading beyond eof
Browse files Browse the repository at this point in the history
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
  • Loading branch information
BlackIkeEagle committed May 2, 2014
1 parent 06dc9db commit c62e093
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ EXTRA_DIST = PORTING ROADMAP par2cmdline.sln par2cmdline.vcproj \
tests/smallsubdirdata.tar.gz \
tests/smallsubdirdata-par2files.tar.gz \
tests/100blocks.tar.gz \
tests/readbeyondeof.tar.gz \
tests/test1 \
tests/test2 \
tests/test3 \
Expand All @@ -70,7 +71,8 @@ EXTRA_DIST = PORTING ROADMAP par2cmdline.sln par2cmdline.vcproj \
tests/test8 \
tests/test9 \
tests/test10 \
tests/test11
tests/test11 \
tests/test12

TESTS = tests/test1 \
tests/test2 \
Expand All @@ -82,7 +84,8 @@ TESTS = tests/test1 \
tests/test8 \
tests/test9 \
tests/test10 \
tests/test11
tests/test11 \
tests/test12

install-exec-hook :
ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT)
Expand Down
Binary file added tests/readbeyondeof.tar.gz
Binary file not shown.
28 changes: 28 additions & 0 deletions tests/test12
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

cd $(dirname $0)

testname=$(basename $0)
rm -f $testname.log

mkdir run$testname && cd run$testname || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2

tar -xf ../readbeyondeof.tar.gz || { echo "ERROR: Could not extract data test files" ; exit 1; } >&2

banner="repair files where the filesize got changed"
dashes=`echo "$banner" | sed s/./-/g`

echo $dashes
echo $banner
echo $dashes

mv test.data test.data-correct
head -c 113579 test.data-correct > test.data

../../par2 r test.par2 > ../$testname.log || { echo "ERROR: repair files using PAR 2.0 failed" ; exit 1; } >&2

cd ..
rm -rf run$testname

exit 0;

0 comments on commit c62e093

Please sign in to comment.