Improved XMP value toLong, toFloat and toRational using new functions parseLong, parseFloat and parseRational. (Vladimir Nadvornik)

This commit is contained in:
Andreas Huggel
2008-03-05 07:45:16 +00:00
parent d8e6b51c69
commit e878166f0d
12 changed files with 376 additions and 19 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ SHELL = /bin/sh
# Add test drivers to this list
TESTS = addmoddel.sh bugfixes-test.sh crw-test.sh exifdata-test.sh \
exiv2-test.sh ifd-test.sh imagetest.sh iotest.sh iptctest.sh \
makernote-test.sh modify-test.sh path-test.sh write-test.sh \
write2-test.sh xmpparser-test.sh
makernote-test.sh modify-test.sh path-test.sh stringto-test.sh \
write-test.sh write2-test.sh xmpparser-test.sh
test:
@list='$(TESTS)'; for p in $$list; do \
+24
View File
@@ -0,0 +1,24 @@
string long float Rational
True 1 1 1/1
False 0 0 0/1
t 1 1 1/1
f 0 0 0/1
-1 -1 -1 -1/1
0 0 0 0/1
1 1 1 1/1
0.0 0 0 0/1
0.1 0 0.1 1/10
0.01 0 0.01 1/100
0.001 0 0.001 1/1000
-1.49999 -1 -1.49999 -149999/100000
-1.5 -1 -1.5 -3/2
1.49999 1 1.49999 149999/100000
1.5 1 1.5 3/2
0/1 0 0 0/1
1/1 1 1 1/1
1/3 0 0.333333 1/3
-1/3 0 -0.333333 -1/3
4/3 1 1.33333 4/3
-4/3 -1 -1.33333 -4/3
0/0 nok nok 0/0
text nok nok nok
+2 -2
View File
@@ -287,7 +287,7 @@ Xmp.dc.two XmpText 6 3.1415
Xmp.dc.three XmpText 3 5/7
Xmp.dc.four XmpText 3 255
Xmp.dc.five XmpText 3 256
Xmp.dc.six XmpText 5 false
Xmp.dc.six XmpText 5 False
Xmp.dc.seven XmpText 5 Seven
Xmp.dc.format XmpText 10 image/jpeg
Xmp.dc.creator XmpSeq 3 1) The first creator, 2) The second creator, 3) And another one
@@ -322,7 +322,7 @@ Xmp.xmpBJ.JobRef[2]/stJob:role XmpText 8 Best man
dc:three="5/7"
dc:four="255"
dc:five="256"
dc:six="false"
dc:six="False"
dc:seven="Seven"
dc:format="image/jpeg"
ns:myProperty="myValue">
+24
View File
@@ -0,0 +1,24 @@
#! /bin/sh
# Test driver for tests of stringToLong/Float/Rational
results="./tmp/stringto-test.out"
good="./data/stringto-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
(
binpath="$VALGRIND ../../samples"
cd ./tmp
$binpath/stringto-test
) > $results
diff -q $diffargs $results $good
rc=$?
if [ $rc -eq 0 ] ; then
echo "All testcases passed."
else
diff $diffargs $results $good
fi