59 Commits (cc4d56dec1f8dba1fd38c331567dfee22d85e6bb)

Author SHA1 Message Date
clanmills 63a13e8620 Adding option -DEXIV2_BUILD_USE_C++11 5 years ago
Robin Mills df04671976 Enforce cxx_std_98 in samples, unit_tests, and exiv2 application (to eliminate 2305 GCC unique_ptr warnings) 5 years ago
Luis Diaz Mas 235087af4e Do not call tell() in File::eof() - Fix tests & performance 5 years ago
Luis Diaz Mas 2732c10a86 Add unit tests for FileIO: canSeekBeyondEOF fails 5 years ago
Robin Mills 2034c41957 Fix #1164 (unit test failures on various platforms) 5 years ago
Luis Diaz Mas 48d68c8271 Fix sign-compare warnings & use gtestwrapper.h 6 years ago
Kevin Backhouse edb4bf78ca Add bounds check to MemIo::seek(). (#944)
- Regression test for missing bounds check in MemIo::seek()
- Add bounds check to MemIo::seek(), this fixes CVE-2019-13504

(cherry picked from commit bd0afe0390439b2c424d881c8c6eb0c5624e31d9)

Additional fixes for 0.27:
- Add fix for the linux variant of MemIo::seek
- Change type of variable from unsigned to signed
6 years ago
Luis Díaz Más 0058dd1099 Use compile definitions only if they are available 6 years ago
Robin Mills 0c282f8373 Looking better all the time, Gentlemen. I believe the only changes between the patches are in unitTests/CMakeLists.txt.
This build passes the test suite and jens.cpp on MacOS-X.  I'll submit and see what the CI has to say.  With the changes only relating to unitTests (which I didn't run on FreeBSD), we should not have disturbed Linux/FreeBSD/jens.cpp.
6 years ago
Luis Díaz Más 4ed5bdc78b CMake: Supress MSVC PDB warnings 7 years ago
Luis Díaz Más 4d47b08a16 CMake: Move gtest finding to unitTests folder 7 years ago
Luis Díaz Más 7485bb54d7 Create function getProcessPath and add unit test for it
Debugging: Relative and Absolute path alternatives
7 years ago
Luis Díaz Más 244f00bf3a CMake: Do not add conan global compiler flags
+ Add conan-gtest compile definitions for the unit_tests target
7 years ago
Dan Čermák fec6535ae8 [binaryToString] Reimplement using Slices
- reimplement binaryToString:
  - it now accepts a Slice and nothing else
  - it does not return a std::string but instead a proxy object that implements
    operator<< (this should be more efficient, as we do not need to touch the
    heap in most cases)
- addapt unit tests
- replace all occurences with the new API
7 years ago
Dan Čermák 30787e6f1e [binaryToString] Add unit tests 7 years ago
Dan Čermák 98bca06592 Add Slices: views of STL containers & C-arrays and add unit tests
This commit adds a very simple implementation of std::span but with
mandatory range checks and only the most essential functionality.
7 years ago
Luis Díaz Más c5d46ac440 Expect std::exception instead of Exiv2::Error 7 years ago
Luis Díaz Más b9f913d5af Move implementation to .cpp files. Fix more issues related to visibility settings 7 years ago
Luis Díaz Más e3f975137c Use STATIC_DEFINE to solve issues with OBJECT library 7 years ago
Luis Díaz Más 6ba4081f95 Use CMake-GenerateExportHeader to generate a macro to export symbols
- Delete the hardcoded macros in config.h taking care of that.
7 years ago
Luis Díaz Más 94375034e6 Fix -Wsign-compare issues 7 years ago
Luis Díaz Más 24be5a514e [Appveyor] Build exiv2 with Visual Studio 2012 and 2013
- Integration tests had to be disabled with 2012 and 2013. There were
few (4) tests failing for these cases.
- Only bring libiconv with conan when a windows subsystem is detected.
- libiconv can be enabled now with a conan option.
- Use infinity instead of INFINITY
- Use conan_basic_setup(). Fixes a problem with gtest is VS2012
- call vcvarsall.bat for each compiler version so that nmake can be
found.
7 years ago
Luis Díaz Más 4161099b91 Fix warnings reported by MSVC 7 years ago
Luis Diaz Mas 0cf7d4fad8 Add unit tests for the TimeValue class 7 years ago
Dan Čermák e705f1ef5b Add unit test for floatToRationalCast 7 years ago
Dan Čermák 2dacb19933 [safe_op] Add Safe::abs(), calculates absoulte value without UB
Add a drop-in replacement for std::abs which never produces
negative values and thereby never invokes undefined behavior.
7 years ago
Luis Diaz Mas eb306fdbae Substitute malloc/free with new/delete 7 years ago
Luis Diaz Mas 669ab49c43 New tests for Uri class 7 years ago
Luis Diaz Mas ca290d870f New tests for base64 encode & decode 7 years ago
Luis Diaz Mas 5d76036af5 Add more tests for decoding and encoding URL functions 7 years ago
Luis Diaz Mas 0bc6fbcea7 Add stdexcept header in unit test files 7 years ago
Luis Diaz Mas ad004498a2 Cleanup 'comparison between signed & unsigned integer' warning 7 years ago
Dan Čermák 088986e5fa [unit_tests] Remove a memory leak from test_XmpKey.cpp
XmpProperties::registerNs allocates strings on the heap that must be freed
manually via XmpProperties::unregisterNs().
=> do this in TearDownTestCase()
7 years ago
Dan Čermák dd52b1a832 Add helper_functions.cpp/hpp & unit tests
- add function which constructs a new std::string from a potentially not null
  terminated char *
- add unit tests
7 years ago
Luis Diaz Mas 4713336c93 Add more unit tests for TiffHeader 7 years ago
Luis Diaz Mas 59493d1edc Fix bug in Cr2Header::read 7 years ago
Luis Diaz Mas b1c34ee11f Add unit tests for Cr2Header 7 years ago
Luis Díaz Más 794fea2639 Replaced way to check buffer after calling DateValue::copy 7 years ago
Luis Diaz Mas bf0b7affaa Add few basic unit tests for DateValue
I feel more confortable doing changes in a code that I do not know by
having some unit tests around it. These characterisation tests will
also be useful as documentation.
7 years ago
Luis Díaz Más b545605d25 Add characterisation tests for XmpKey 7 years ago
Dan Čermák 8b7941b733 [cmake] Add EXTRA_COMPILE_FLAGS to samples & unitTests
Add the additional compiler flags added by -DEXIV2_TEAM_EXTRA_WARNINGS=ON to
the targets in samples/ & unitTests/
This fixes #204
7 years ago
Dan Čermák 842dd4cecc Add a unit tests for enforce() 7 years ago
Dan Čermák 06ec1e6984 [safe_op] Refactored addition overflow checks using functions only
- templated structs were not required, SFINAE works for functions too
  => use instead, removes some unneeded code
- fix non-usage of builtins with clang
- adjust unit tests
7 years ago
Dan Čermák 1de633ad37 Reset errno to 0 before unit test probing strerror(errno)
errno can be set to a non-zero value from a previously failed system
call, it is not reset by successful ones
=> have to do that manually or the unit test fails because it detects
   an "outdated" error message
8 years ago
Dan Čermák 3b3283e37d Added unit tests for new overflow checking addition functions 8 years ago
Luis Díaz Más 39377b8c02 Fix strError tests on Mac 8 years ago
Luis Díaz Más 9b463708a4 Test runner return the gtest return value 8 years ago
Luis Díaz Más f36bea3801 exiv2::getEnv throws std::out_of_range on unexpected EnVar
This change define explicitly the behavior that exiv2::getEnv should have
on response to unexpected inputs.

There are some other minor changes:

- Use _putenv_s for the unit tests on Windows
- Add todo comment
- Remove deprecated note about freeing memory
8 years ago
Luis Díaz Más 8b049922d7 Change exiv2::urlencode signature to return std::string
The goal of this change is to remove the responsibility from the client code to
free the memory of the returned string.
8 years ago
Luis Díaz Más fd5f131f4e Add characterisation test for exiv2::urlencode 8 years ago