13 Commits (b51b6fc52da6005fe7a6095ed85810d41cdcf9db)

Author SHA1 Message Date
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 b1c34ee11f Add unit tests for Cr2Header 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 3b3283e37d Added unit tests for new overflow checking addition functions 8 years ago
Luis Diaz Mas ec09c98adb add few characterisation tests for exiv2::strError 8 years ago
Luis Díaz Más cc7ff4122d Export all symbols when running unit tests. Add dummy test for private code.
I tried to use directly the private OBJECT library (exiv2lib_int) in the unit_tests targets, but the private objects have dependencies on the public symbols (circular dependency)
and therefore it is impossible to test the private code with that approach with the current design of the library.

Starting from CMake 3.3 we can use the variable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to export all the symbols of a shared library:
https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/

Even having the opportunity to use this variable (that will be only used when EXIV2_BUILD_UNIT_TESTS is enabled) the previous commits are still valid.
It is interesting to clearly differentiate between the public and private code of the library. Enforcing this, make us think twice before putting code in the public
part of the library.
8 years ago
Luis Díaz Más cfe614d8c3 Provide a gtestWrapper header to skip useless warnings 8 years ago
Luis Diaz Mas 2e8376dccc Do not use Gtest imported target (Not available in minimum CMake version required) 8 years ago
Luis Díaz Más 2bad771834 (CMake) Add GTEST_LINKED_AS_SHARED_LIBRARY definition 8 years ago
Luis Díaz Más 26189ad287 (CMake) Add a new CMake option to enable the new Unit Tests 8 years ago