#922. Adding to the test suite.

This commit is contained in:
Robin Mills 2015-05-01 08:08:15 +00:00
parent f343a21e21
commit 2f375e8f02
6 changed files with 11 additions and 6 deletions

View File

@ -360,14 +360,14 @@ namespace Exiv2 {
{
std::string result;
int need = (int) std::strlen(format)*2; // initial guess
int need = (int) std::strlen(format)*4; // initial guess
char* buffer = NULL;
int again = 4;
int rc = -1;
while (rc < 0 && again--) {
if ( buffer ) delete[] buffer;
need *= 2 ;
need *= 2 ;
buffer = new char[need];
if ( buffer ) {
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
return result;
}

View File

@ -268,11 +268,16 @@ source ./functions.source
filename=exiv2-bug$num.jpg
printf "$num " >&3
echo '------>' Bug $num '<-------' >&2
copyTestFile $filename
runTest exiv2 -pX $filename
copyTestFile $filename
runTest exiv2 -pX $filename ; echo '' # add a lf after the XMP/xml
filename=iptc-psAPP13-wIPTCempty-psAPP13-wIPTC.jpg
copyTestFile $filename
copyTestFile $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
filename=exiv2-bug$num.jpg

Binary file not shown.

BIN
test/data/exiv2-bug922.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
test/data/exiv2-bug922.tif Executable file

Binary file not shown.

BIN
test/data/exiv2-bug922a.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB