Replace existing use of std::cout and std::cerr with fmt::print[ln]():
this is simpler and more convenient and also faster to compile.
Also configure all CI jobs to clone submodules, as fmt submodule is
required now.
This allows to compile them once, instead of doing it for every backend:
while this doesn't matter for the CI builds, recompiling common-tests.h
a dozen times enormously slowed down local builds using all backends.
Now it is compiled only once, as test-common.cpp, and all the other
tests (except for the "empty" one) just link with the resulting library.
Also extract some parts of this file into separate headers, that can be
included only by the tests that actually need them.
Note that the entire test-common.cpp probably ought to be split into
multiple files, to speed up its build too, but this can be done later.
Convert to the requested type if lossless conversion is possible to make
the behaviour more compatible with the previous SOCI versions and more
useful.
See #1127.
This activates the workaround for -Wpedantic in MySQL-specific header
that we need in order to build successfully on the systems with a broken
version of this header.
Don't redefine the same variables in a couple of tests.
In other places, use artificially different names to avoid clashes with
the existing variables in outer scope.
No real changes.
SQLite, MySQL and PostgreSQL backends used the same but slightly
different code for parsing the contents of a buffer into std::tm struct.
Replace all these different versions with a single version, copied from
the PostgreSQL variant, which seems like the most complete, in the
common code.
Update MySQL-specific test to not expect parsing a string containing
time without date to yield year 2000, this didn't make any sense at all
and PostgreSQL default of year 1900 makes at least slightly more sense.
Currently prepared statements do _not_ survive session::reconnect() due
to the issue #136, so running this test simply results in crashes.
Disable it for now, it should be reenabled when #156 or another solution
is applied.
Fix warnings by changing the code whenever possible, in particular remove
firebird_rowid_backend class and src/backends/firebird/row-id.cpp file in
which it was defined entirely as it only resulted in "unreachable code"
warnings but was otherwise unused.
Also avoid implicit conversions by either using the correct types or by making
the casts explicit using static_cast<> in places where the casts are really
needed.
Add helpful SOCI_NOT_COPYABLE, SOCI_NOT_ASSIGNABLE and SOCI_UNUSED macros and
use them to suppress the corresponding warnings.
Finally, combine soci-config.h and soci-platform.h in a single file, always
include the latter as the first header and keep the former as a wrapper for
the latter just for compatibility.
Remove the MSVC "#pragma warning(disable: *)" as they are not needed any more.
Closes#355.
This should solve compilation errors on OSX where struct session defined in
global namespace in /usr/include/sys/proc.h conflicts with unqualified uses of
soci::session.
Fixes#340
This should solve compilation errors on OSX where struct session defined in
global namespace in /usr/include/sys/proc.h conflicts with unqualified uses of
soci::session.
Fixes#340
This makes it possible to reuse various MySQL-specific workarounds for both
tests without duplicating the not always trivial code.
As a side effect, fixes ODBC MySQL test which didn't pass any more since the
addition of exact double equality checks, making it use the same has_fp_bug()
as the MySQL test skips the failing test for it too now.
This will only become useful after the upcoming commits which will extend
what() to return more information about the exception, but commit this
separately as there are only trivial changes in this commit: just use
std::string returned by get_error_message() instead of char* returned by
what() in the tests.
"assert" in the name of the directory doesn't make any sense any more as we
don't use asserts in the test code now that we use CATCH.
Also extend the tests description in the README.md.