#1224 crw-test.sh refactored to use test/functions.source, no long reference sample program crwparse and avoid crash in crwimage.cpp
parent
9ff2224fd7
commit
c7bca0ce00
@ -1,75 +1,50 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Test driver for CRW file operations
|
# Test driver for CRW file operations
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
source ./functions.source
|
||||||
# Setup
|
|
||||||
results="./tmp/crw-test.out"
|
( cd "$testdir"
|
||||||
good="./data/crw-test.out"
|
|
||||||
diffargs="--strip-trailing-cr"
|
crwfile=exiv2-canon-powershot-s40.crw
|
||||||
tmpfile=tmp/ttt
|
|
||||||
touch $tmpfile
|
# ----------------------------------------------------------------------
|
||||||
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
|
# Testcases: Add and modify tags
|
||||||
if [ $? -ne 0 ] ; then
|
cmdfile=cmdfile1
|
||||||
diffargs=""
|
( echo set Exif.Photo.ColorSpace 65535
|
||||||
fi
|
echo set Exif.Canon.OwnerName Different owner
|
||||||
|
echo set Exif.Canon.FirmwareVersion Whatever version
|
||||||
# ----------------------------------------------------------------------
|
echo set Exif.Canon.SerialNumber 1
|
||||||
# Main routine
|
echo add Exif.Canon.SerialNumber 2
|
||||||
(
|
echo set Exif.Photo.ISOSpeedRatings 155
|
||||||
if [ -z "$EXIV2_BINDIR" ] ; then
|
echo set Exif.Photo.DateTimeOriginal 2007:11:11 09:10:11
|
||||||
bin="$VALGRIND ../../bin"
|
) > $cmdfile
|
||||||
else
|
|
||||||
bin="$VALGRIND $EXIV2_BINDIR"
|
copyTestFile $crwfile
|
||||||
fi
|
runTest exiv2 -v -pt $crwfile
|
||||||
cmdfile=cmdfile
|
runTest exiv2 -v -m $cmdfile $crwfile
|
||||||
crwfile=exiv2-canon-powershot-s40.crw
|
# runTest crwparse $crwfile
|
||||||
|
runTest exiv2 -v -pt $crwfile
|
||||||
cd ./tmp
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
# ----------------------------------------------------------------------
|
# Testcases: Delete tags
|
||||||
# Testcases: Add and modify tags
|
cmdfile=cmdfile2
|
||||||
|
( echo del Exif.Canon.OwnerName
|
||||||
cat > $cmdfile <<EOF
|
) > $cmdfile2
|
||||||
set Exif.Photo.ColorSpace 65535
|
|
||||||
set Exif.Canon.OwnerName Somebody else's Camera
|
copyTestFile $crwfile
|
||||||
set Exif.Canon.FirmwareVersion Whatever version
|
runTest exiv2 -v -pt $crwfile
|
||||||
set Exif.Canon.SerialNumber 1
|
runTest exiv2 -v -m $cmdfile $crwfile
|
||||||
add Exif.Canon.SerialNumber 2
|
# runTest crwparse $crwfile
|
||||||
set Exif.Photo.ISOSpeedRatings 155
|
runTest exiv2 -v -pt $crwfile
|
||||||
set Exif.Photo.DateTimeOriginal 2007:11:11 09:10:11
|
|
||||||
EOF
|
) 3>&1 > $results 2>&1
|
||||||
|
|
||||||
cp -f ../data/$crwfile .
|
printf "\n"
|
||||||
$bin/exiv2 -v -pt $crwfile
|
|
||||||
|
|
||||||
$bin/exiv2 -v -m $cmdfile $crwfile
|
|
||||||
$bin/crwparse $crwfile
|
|
||||||
|
|
||||||
$bin/exiv2 -v -pt $crwfile
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Testcases: Delete tags
|
|
||||||
|
|
||||||
cat > $cmdfile <<EOF
|
|
||||||
del Exif.Canon.OwnerName
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cp -f ../data/$crwfile .
|
|
||||||
$bin/exiv2 -v -pt $crwfile
|
|
||||||
|
|
||||||
$bin/exiv2 -v -m $cmdfile $crwfile
|
|
||||||
$bin/crwparse $crwfile
|
|
||||||
|
|
||||||
$bin/exiv2 -v -pt $crwfile
|
|
||||||
|
|
||||||
) > $results 2>&1
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Evaluate results
|
# Evaluate results
|
||||||
diff -q $diffargs $results $good
|
cat $results | sed 's/\x0d$//' > $results-stripped
|
||||||
rc=$?
|
reportTest $results-stripped $good
|
||||||
if [ $rc -eq 0 ] ; then
|
|
||||||
echo "All testcases passed."
|
# That's all Folks!
|
||||||
else
|
##
|
||||||
diff $diffargs $results $good
|
|
||||||
fi
|
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue