Skip to content

Commit

Permalink
Fixed tests, test.sh now passes
Browse files Browse the repository at this point in the history
1) converted test-images/short-ascii-{II,MM}-.jpg.expected to use
   \n, it was \r\n
2) updated test-images/*.exepected to match actual result
   from ./demo, see diff for details
3) extended test.sh to work on windows under cygwin - test.sh looks
   if demo.exe does exist by any chance
  • Loading branch information
graywolf committed May 4, 2015
1 parent 2cb3920 commit a827a91
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
Binary file removed demo
Binary file not shown.
Binary file modified test-images/short-ascii-II.jpg.expected
Binary file not shown.
Binary file modified test-images/short-ascii-MM.jpg.expected
Binary file not shown.
2 changes: 1 addition & 1 deletion test-images/test1.jpg.expected
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Camera make : Apple
Camera model : iPhone 4S
Software :
Software : 6.1
Bits per sample : 0
Image width : 3264
Image height : 2448
Expand Down
14 changes: 13 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@

make

DEMONAME=./demo

if [ ! -e ./demo ]; then
# check if demo.exe exists, needed on windows
if [ -e ./demo.exe ]; then
DEMONAME=./demo.exe
else
echo Cannot find executable.
exit 1
fi
fi

for jpeg in `ls test-images/*.jpg`; do
./demo $jpeg > /tmp/`basename $jpeg`.actual
$DEMONAME $jpeg > /tmp/`basename $jpeg`.actual
diff $jpeg.expected /tmp/`basename $jpeg`.actual > /tmp/diff.out
if [[ -s /tmp/diff.out ]] ; then
echo "FAILED ON $jpeg"
Expand Down

0 comments on commit a827a91

Please sign in to comment.