[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:46:53 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=c7bca0c
The following commit has been merged in the master branch:
commit c7bca0ce004c693cb12747fb351a829a1ab36c05
Author: Robin Mills <robin at clanmills.com>
Date: Sun Sep 11 15:47:47 2016 +0000
#1224 crw-test.sh refactored to use test/functions.source, no long reference sample program crwparse and avoid crash in crwimage.cpp
---
src/crwimage.cpp | 5 ++-
test/crw-test.sh | 113 +++++++++++++++++++------------------------------
test/data/crw-test.out | Bin 29694 -> 10314 bytes
test/functions.source | 6 +--
4 files changed, 51 insertions(+), 73 deletions(-)
diff --git a/src/crwimage.cpp b/src/crwimage.cpp
index 5d231ef..8059ce7 100644
--- a/src/crwimage.cpp
+++ b/src/crwimage.cpp
@@ -791,7 +791,10 @@ namespace Exiv2 {
assert(rootDirectory == 0x0000);
crwDirs.pop();
if (!pRootDir_) pRootDir_ = new CiffDirectory;
- if ( pRootDir_) pRootDir_->add(crwDirs, crwTagId)->setValue(buf);
+ if ( pRootDir_) {
+ CiffComponent* child = pRootDir_->add(crwDirs, crwTagId);
+ if ( child ) child->setValue(buf);
+ }
} // CiffHeader::add
CiffComponent* CiffComponent::add(CrwDirs& crwDirs, uint16_t crwTagId)
diff --git a/test/crw-test.sh b/test/crw-test.sh
index e1996f4..ffd9825 100755
--- a/test/crw-test.sh
+++ b/test/crw-test.sh
@@ -1,75 +1,50 @@
#! /bin/sh
# Test driver for CRW file operations
-# ----------------------------------------------------------------------
-# Setup
-results="./tmp/crw-test.out"
-good="./data/crw-test.out"
-diffargs="--strip-trailing-cr"
-tmpfile=tmp/ttt
-touch $tmpfile
-diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
-if [ $? -ne 0 ] ; then
- diffargs=""
-fi
-
-# ----------------------------------------------------------------------
-# Main routine
-(
-if [ -z "$EXIV2_BINDIR" ] ; then
- bin="$VALGRIND ../../bin"
-else
- bin="$VALGRIND $EXIV2_BINDIR"
-fi
-cmdfile=cmdfile
-crwfile=exiv2-canon-powershot-s40.crw
-
-cd ./tmp
-
-# ----------------------------------------------------------------------
-# Testcases: Add and modify tags
-
-cat > $cmdfile <<EOF
-set Exif.Photo.ColorSpace 65535
-set Exif.Canon.OwnerName Somebody else's Camera
-set Exif.Canon.FirmwareVersion Whatever version
-set Exif.Canon.SerialNumber 1
-add Exif.Canon.SerialNumber 2
-set Exif.Photo.ISOSpeedRatings 155
-set Exif.Photo.DateTimeOriginal 2007:11:11 09:10:11
-EOF
-
-cp -f ../data/$crwfile .
-$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
+source ./functions.source
+
+( cd "$testdir"
+
+ crwfile=exiv2-canon-powershot-s40.crw
+
+ # ----------------------------------------------------------------------
+ # Testcases: Add and modify tags
+ cmdfile=cmdfile1
+ ( echo set Exif.Photo.ColorSpace 65535
+ echo set Exif.Canon.OwnerName Different owner
+ echo set Exif.Canon.FirmwareVersion Whatever version
+ echo set Exif.Canon.SerialNumber 1
+ echo add Exif.Canon.SerialNumber 2
+ echo set Exif.Photo.ISOSpeedRatings 155
+ echo set Exif.Photo.DateTimeOriginal 2007:11:11 09:10:11
+ ) > $cmdfile
+
+ copyTestFile $crwfile
+ runTest exiv2 -v -pt $crwfile
+ runTest exiv2 -v -m $cmdfile $crwfile
+ # runTest crwparse $crwfile
+ runTest exiv2 -v -pt $crwfile
+
+ # ----------------------------------------------------------------------
+ # Testcases: Delete tags
+ cmdfile=cmdfile2
+ ( echo del Exif.Canon.OwnerName
+ ) > $cmdfile2
+
+ copyTestFile $crwfile
+ runTest exiv2 -v -pt $crwfile
+ runTest exiv2 -v -m $cmdfile $crwfile
+ # runTest crwparse $crwfile
+ runTest exiv2 -v -pt $crwfile
+
+) 3>&1 > $results 2>&1
+
+printf "
"
# ----------------------------------------------------------------------
# Evaluate results
-diff -q $diffargs $results $good
-rc=$?
-if [ $rc -eq 0 ] ; then
- echo "All testcases passed."
-else
- diff $diffargs $results $good
-fi
+cat $results | sed 's/\x0d$//' > $results-stripped
+reportTest $results-stripped $good
+
+# That's all Folks!
+##
diff --git a/test/data/crw-test.out b/test/data/crw-test.out
index c959542..6b53da1 100644
Binary files a/test/data/crw-test.out and b/test/data/crw-test.out differ
diff --git a/test/functions.source b/test/functions.source
index d406655..3e3a630 100644
--- a/test/functions.source
+++ b/test/functions.source
@@ -407,9 +407,9 @@ copyVideoFiles ()
fi
# http://stackoverflow.com/questions/7442417/how-to-sort-an-array-in-bash
- readarray -t sorted < <(printf '%s
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list