summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-15 21:41:07 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-16 12:44:18 +0000
commitc49848b05a1fc68b9e7f41b4469ba3c96599fcf4 (patch)
tree331232c42c3e863661045bbc8216a7c35b9887bf
parentParallel lto only with gcc (diff)
downloadlibdbpp-c49848b05a1fc68b9e7f41b4469ba3c96599fcf4.tar.bz2
libdbpp-c49848b05a1fc68b9e7f41b4469ba3c96599fcf4.tar.xz
libdbpp-c49848b05a1fc68b9e7f41b4469ba3c96599fcf4.zip
Basic clang tidy fixes
m---------libdbpp/unittests/libdbpp-mysql0
m---------libdbpp/unittests/libdbpp-postgresql0
-rw-r--r--libdbpp/unittests/mockdb.cpp2
-rw-r--r--libdbpp/unittests/testUtils.cpp12
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 )