diff options
m--------- | libdbpp/unittests/libdbpp-mysql | 0 | ||||
m--------- | libdbpp/unittests/libdbpp-postgresql | 0 | ||||
-rw-r--r-- | libdbpp/unittests/mockdb.cpp | 2 | ||||
-rw-r--r-- | libdbpp/unittests/testUtils.cpp | 12 |
4 files changed, 11 insertions, 3 deletions
diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql -Subproject a84a696a3812446a33761cc0b1669d0f5bbf933 +Subproject f4a4a323588410d083dd9ec1145de922db43f80 diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql -Subproject bfb66f180a0e0c9efbfb708194079e491a63dcb +Subproject 283047d0db99da4579c54ac50bbc71ff358360d diff --git a/libdbpp/unittests/mockdb.cpp b/libdbpp/unittests/mockdb.cpp index ea85294..54c1e3a 100644 --- a/libdbpp/unittests/mockdb.cpp +++ b/libdbpp/unittests/mockdb.cpp @@ -61,7 +61,7 @@ MockDb::modify(const std::string &, const DB::CommandOptionsCPtr &) MockMock::MockMock(const std::string &, const std::string &, const std::vector<std::filesystem::path> & ss) : DB::MockDatabase() { - CreateNewDatabase(); + MockMock::CreateNewDatabase(); PlaySchemaScripts(ss); } diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index 8c6a1bd..4c28538 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE( forEachRowNulls ) auto db = DB::MockDatabase::openConnectionTo("pqmock"); auto sel = db->select("SELECT a, b, c, d, e, f FROM forEachRow ORDER BY a DESC LIMIT 1"); sel->forEachRow<int64_t, std::optional<double>, std::string, std::optional<boost::posix_time::ptime>, std::optional<boost::posix_time::time_duration>, bool>( - [](auto a, auto b, auto c, auto d, auto e, auto f) { + [](auto && a, auto b, auto c, auto d, auto && e, auto f) { BOOST_REQUIRE_EQUAL(2, a); BOOST_REQUIRE(b); BOOST_REQUIRE_CLOSE(4.3, *b, 0.001); @@ -378,7 +378,15 @@ testExtractT(DB::SelectCommandPtr sel) { T test; (void)test; for (const auto & row : sel->as<T>()) { testExtractT(row); } - for (const auto & row : sel->as<std::optional<T>>()) { testExtractT(row); } +#ifdef __clang__ + // Clang cannot compile this for reasons largely todo with ambiguousness in the spec + // Fixed when we move to std::chrono + if constexpr (!std::is_same<T, boost::posix_time::time_duration>::value) { +#else + if constexpr (true) { +#endif + for (const auto & row : sel->as<std::optional<T>>()) { testExtractT(row); } + } } BOOST_AUTO_TEST_CASE( testExtractTypes ) |