#1230. Rollback 4604. I knew webp-test was sometimes failing. Fixed. Always use runTest exiv2 to be sure of executing the hot build of exiv2(.exe).

This commit is contained in:
Robin Mills
2016-10-04 15:16:56 +00:00
parent 7b0b8f36c6
commit bea89ba81a
3 changed files with 40 additions and 63 deletions
+7 -22
View File
@@ -138,9 +138,6 @@ int main(int argc, char* const argv[])
// Handle command line arguments
Params& params = Params::instance();
params.argc_=argc;
params.argv_=argv;
if (params.getopt(argc, argv)) {
params.usage();
return 1;
@@ -606,9 +603,8 @@ int Params::evalPrint(const std::string& optarg)
case 'S': action_ = Action::print; printMode_ = pmStructure ; break;
case 'X': action_ = Action::print; printMode_ = pmXMP ; break;
default:
std::cerr << progname() << ": " << _("Unrecognized print mode ")
<< "'"<< optarg<<"'" << std::endl;
verboseDump();
std::cerr << progname() << ": " << _("Unrecognized print mode") << " `"
<< optarg << "'\n";
rc = 1;
break;
}
@@ -881,17 +877,6 @@ int Params::nonoption(const std::string& argv)
return rc;
} // Params::nonoption
void Params::verboseDump()
{
//if ( verbose_ ) {
std::cerr << "argc = " << argc_ << std::endl;
if ( argv_ )
for ( int a = 0 ; a < argc_ ; a++)
std::cerr << "argv[" <<a<< "] =" << argv_[a] << std::endl;
// Exiv2::dumpLibraryInfo(std::cerr,greps_);
//}
}
static int readFileToBuf(FILE* f,Exiv2::DataBuf& buf)
{
const int buff_size = 4*1028;
@@ -921,7 +906,7 @@ static int readFileToBuf(FILE* f,Exiv2::DataBuf& buf)
void Params::getStdin(Exiv2::DataBuf& buf)
{
// copy stdin to stdinBuf
if ( stdinBuf_.size_ == 0 ) {
if ( stdinBuf.size_ == 0 ) {
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW__) || defined(_MSC_VER)
DWORD fdwMode;
_setmode(fileno(stdin), O_BINARY);
@@ -940,7 +925,7 @@ void Params::getStdin(Exiv2::DataBuf& buf)
#ifdef DEBUG
std::cerr << "stdin has data" << std::endl;
#endif
readFileToBuf(stdin,stdinBuf_);
readFileToBuf(stdin,stdinBuf);
}
#ifdef DEBUG
// this is only used to simulate reading from stdin when debugging
@@ -962,9 +947,9 @@ void Params::getStdin(Exiv2::DataBuf& buf)
}
// copy stdinBuf to buf
if ( stdinBuf_.size_ ) {
buf.alloc(stdinBuf_.size_);
memcpy(buf.pData_,stdinBuf_.pData_,buf.size_);
if ( stdinBuf.size_ ) {
buf.alloc(stdinBuf.size_);
memcpy(buf.pData_,stdinBuf.pData_,buf.size_);
}
#ifdef DEBUG
std::cerr << "getStdin stdinBuf.size_ = " << stdinBuf.size_ << std::endl;
+1 -8
View File
@@ -256,9 +256,7 @@ public:
Keys keys_; //!< List of keys to match from the metadata
std::string charset_; //!< Charset to use for UNICODE Exif user comment
Exiv2::DataBuf stdinBuf_; //! < DataBuf with the binary bytes from stdin
int argc_; //! < command-line arg count
char* const* argv_; //! < command-line arg vector
Exiv2::DataBuf stdinBuf; //! < DataBuf with the binary bytes from stdin
private:
//! Pointer to the global Params object.
@@ -295,8 +293,6 @@ private:
formatSet_(false),
first_(true)
{
argc_=0;
argv_=NULL;
yodAdjust_[yodYear] = emptyYodAdjust_[yodYear];
yodAdjust_[yodMonth] = emptyYodAdjust_[yodMonth];
yodAdjust_[yodDay] = emptyYodAdjust_[yodDay];
@@ -359,9 +355,6 @@ public:
*/
void getStdin(Exiv2::DataBuf& buf);
//! verboseDump is used to debug the command line
void verboseDump();
}; // class Params
#endif // #ifndef EXIV2APP_HPP_
+32 -33
View File
@@ -7,78 +7,77 @@ source ./functions.source
num=1199 # WebPImage
printf "WebP " >&3
# verbose=--verbose
filename=exiv2-bug$num.webp # http://dev.exiv2.org/attachments/download/1033/Stonehenge-with-icc.webp
icc_name=exiv2-bug$num.icc
exv_name=exiv2-bug$num.exv
xmp_name=exiv2-bug$num.xmp
copyTestFile $filename
runTest exiv2 $verbose -pS $filename
runTest exiv2 $verbose -pR $filename
runTest exiv2 $verbose -pX $filename | xmllint --format -
runTest exiv2 -pS $filename
runTest exiv2 -pR $filename
runTest exiv2 -pX $filename | xmllint --format -
printf "delete " >&3
# test deleting metadata
for option in -dC -de -dx -dCe -dCx -dCxe; do
copyTestFile $filename
runTest exiv2 $verbose -pS $filename
runTest exiv2 -pS $filename
runTest exiv2 $option $filename
runTest exiv2 $verbose -pS $filename
runTest exiv2 -pS $filename
done
printf "insert " >&3
printf "ICC " >&3
copyTestFile $filename
exiv2 $verbose -pS $filename
runTest exiv2 -pS $filename
copyTestFile Reagan.tiff
exiv2 $verbose -pC Reagan.tiff > $icc_name
exiv2 $verbose -iC $filename
exiv2 -pS $filename
runTest exiv2 -pC Reagan.tiff > $icc_name
runTest exiv2 -iC $filename
runTest exiv2 -pS $filename
printf "XMP " >&3
# copy the XMP from the test file
copyTestFile $filename
exiv2 $verbose -pX $filename > $xmp_name;
exiv2 $verbose -ea --force $filename
runTest exiv2 -pX $filename > $xmp_name;
runTest exiv2 -ea --force $filename
copyTestFile $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -iXX $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -ix $filename
runTest exiv2 -pS $filename
runTest exiv2 -iXX $filename
runTest exiv2 -pS $filename
runTest exiv2 -ix $filename
# copy the XMP from Reagan.tiff to test file
copyTestFile Reagan.tiff
exiv2 $verbose -pX Reagan.tiff > $xmp_name;
exiv2 $verbose -ea --force Reagan.tiff
runTest exiv2 -pX Reagan.tiff > $xmp_name;
runTest exiv2 -ea --force Reagan.tiff
mv Reagan.exv $exv_name
copyTestFile $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -iXX $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -ix $filename
runTest exiv2 -pS $filename
runTest exiv2 -iXX $filename
runTest exiv2 -pS $filename
runTest exiv2 -ix $filename
# copy the XMP from exiv2-bug922.jpg to test file
copyTestFile exiv2-bug922.jpg
exiv2 $verbose -pX exiv2-bug922.jpg > $xmp_name
exiv2 $verbose -ea --force exiv2-bug922.jpg 2>/dev/null
runTest exiv2 -pX exiv2-bug922.jpg > $xmp_name
runTest exiv2 -ea --force exiv2-bug922.jpg 2>/dev/null
mv exiv2-bug922.exv $exv_name
copyTestFile $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -ix $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -iXX $filename
exiv2 $verbose -pS $filename
runTest exiv2 -pS $filename
runTest exiv2 -ix $filename
runTest exiv2 -pS $filename
runTest exiv2 -iXX $filename
runTest exiv2 -pS $filename
printf "EXIF " >&3
copyTestFile exiv2-bug922.jpg $filename
exiv2 $verbose --force -ea $filename
runTest exiv2 --force -ea $filename
copyTestFile $filename
exiv2 $verbose -pS $filename
exiv2 $verbose -ie $filename
exiv2 $verbose -pS $filename
runTest exiv2 -pS $filename
runTest exiv2 -ie $filename
runTest exiv2 -pS $filename
) 3>&1 > $results 2>&1