#922. Adding to the test suite.

v0.27.3
Robin Mills 10 years ago
parent f343a21e21
commit 2f375e8f02

@ -360,14 +360,14 @@ namespace Exiv2 {
{ {
std::string result; std::string result;
int need = (int) std::strlen(format)*2; // initial guess int need = (int) std::strlen(format)*4; // initial guess
char* buffer = NULL; char* buffer = NULL;
int again = 4; int again = 4;
int rc = -1; int rc = -1;
while (rc < 0 && again--) { while (rc < 0 && again--) {
if ( buffer ) delete[] buffer; if ( buffer ) delete[] buffer;
need *= 2 ; need *= 2 ;
buffer = new char[need]; buffer = new char[need];
if ( buffer ) { if ( buffer ) {
va_list args; // variable arg list va_list args; // variable arg list
@ -377,7 +377,7 @@ namespace Exiv2 {
} }
} }
if ( rc > 0 ) result = std::string(buffer) ; if ( buffer && rc > 0 ) result = std::string(buffer); // save the result
if ( buffer ) delete[] buffer; // free buffer if ( buffer ) delete[] buffer; // free buffer
return result; return result;
} }

@ -268,11 +268,16 @@ source ./functions.source
filename=exiv2-bug$num.jpg filename=exiv2-bug$num.jpg
printf "$num " >&3 printf "$num " >&3
echo '------>' Bug $num '<-------' >&2 echo '------>' Bug $num '<-------' >&2
copyTestFile $filename copyTestFile $filename
runTest exiv2 -pX $filename runTest exiv2 -pX $filename ; echo '' # add a lf after the XMP/xml
filename=iptc-psAPP13-wIPTCempty-psAPP13-wIPTC.jpg filename=iptc-psAPP13-wIPTCempty-psAPP13-wIPTC.jpg
copyTestFile $filename copyTestFile $filename
runTest exiv2 -pX $filename runTest exiv2 -pX $filename
for filename in exiv2-bug$num.png exiv2-bug$num.tif exiv2-bug${num}a.jpg; do
copyTestFile $filename ;
runTest exiv2 -pX $filename ; echo ''
runTest exiv2 -pS $filename
done
num=937 num=937
filename=exiv2-bug$num.jpg filename=exiv2-bug$num.jpg

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Loading…
Cancel
Save