From c49848b05a1fc68b9e7f41b4469ba3c96599fcf4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 15 Feb 2019 21:41:07 +0000 Subject: Basic clang tidy fixes --- libdbpp/unittests/libdbpp-mysql | 2 +- libdbpp/unittests/libdbpp-postgresql | 2 +- libdbpp/unittests/mockdb.cpp | 2 +- libdbpp/unittests/testUtils.cpp | 12 ++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql index a84a696..f4a4a32 160000 --- a/libdbpp/unittests/libdbpp-mysql +++ b/libdbpp/unittests/libdbpp-mysql @@ -1 +1 @@ -Subproject commit a84a696a3812446a33761cc0b1669d0f5bbf9335 +Subproject commit f4a4a323588410d083dd9ec1145de922db43f803 diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql index bfb66f1..283047d 160000 --- a/libdbpp/unittests/libdbpp-postgresql +++ b/libdbpp/unittests/libdbpp-postgresql @@ -1 +1 @@ -Subproject commit bfb66f180a0e0c9efbfb708194079e491a63dcbb +Subproject commit 283047d0db99da4579c54ac50bbc71ff358360d4 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 & 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, std::string, std::optional, std::optional, 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()) { testExtractT(row); } - for (const auto & row : sel->as>()) { 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::value) { +#else + if constexpr (true) { +#endif + for (const auto & row : sel->as>()) { testExtractT(row); } + } } BOOST_AUTO_TEST_CASE( testExtractTypes ) -- cgit v1.2.3