From a5cbac4c52ef00e167a63e165ecf0e2a21d3e08d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Mar 2019 13:39:05 +0000 Subject: More clang tidy fixes --- libdbpp/unittests/Jamfile.jam | 4 +++- libdbpp/unittests/libdbpp-mysql | 2 +- libdbpp/unittests/libdbpp-postgresql | 2 +- libdbpp/unittests/testParse.cpp | 2 +- libdbpp/unittests/testUtils.cpp | 9 ++++----- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libdbpp/unittests/Jamfile.jam b/libdbpp/unittests/Jamfile.jam index 805863e..a3f22cf 100644 --- a/libdbpp/unittests/Jamfile.jam +++ b/libdbpp/unittests/Jamfile.jam @@ -11,7 +11,9 @@ lib libsqlite : : sqlite3 ; lib odbc ; lib boost_date_time ; lib boost_system ; -lib boost_utf : : boost_unit_test_framework : : tidy:hicpp-* ; +lib boost_utf : : boost_unit_test_framework : : + tidy:hicpp-vararg + ; lib Ice++11 ; run diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql index 3480045..3a21e86 160000 --- a/libdbpp/unittests/libdbpp-mysql +++ b/libdbpp/unittests/libdbpp-mysql @@ -1 +1 @@ -Subproject commit 34800459e7645fea3640214b5f7f6d7de183d332 +Subproject commit 3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2 diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql index 1423b07..f988df5 160000 --- a/libdbpp/unittests/libdbpp-postgresql +++ b/libdbpp/unittests/libdbpp-postgresql @@ -1 +1 @@ -Subproject commit 1423b078638884f8956a5cdc9d7f37d3bae7f024 +Subproject commit f988df5245cfb59e893bbe262aac8d6260196bac diff --git a/libdbpp/unittests/testParse.cpp b/libdbpp/unittests/testParse.cpp index d63925b..3764f43 100644 --- a/libdbpp/unittests/testParse.cpp +++ b/libdbpp/unittests/testParse.cpp @@ -14,7 +14,7 @@ BOOST_TEST_SPECIALIZED_COLLECTION_COMPARE(SQLs); class RecordingParser : std::fstream, public DB::SqlParse { public: - RecordingParser(const std::filesystem::path & p) : + explicit RecordingParser(const std::filesystem::path & p) : std::fstream(p), DB::SqlParse(*this, p.parent_path()) { diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index 67c1751..a05c831 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -240,12 +240,12 @@ BOOST_AUTO_TEST_CASE( charStarBindNull ) db->modify("DELETE FROM forEachRow")->execute(); auto ins = db->modify("INSERT INTO forEachRow(a, c) VALUES(?, ?)"); char * cs = nullptr; - char * cs2 = strdup("a thing"); + std::string cs2("a thing"); ins->bindParamS(0, cs); - ins->bindParamS(1, cs2); + ins->bindParamS(1, cs2.c_str()); ins->execute(); const char * ccs = cs; - const char * ccs2 = cs2; + const char * ccs2 = cs2.c_str(); ins->bindParamS(0, ccs); ins->bindParamS(1, ccs2); ins->execute(); @@ -254,7 +254,6 @@ BOOST_AUTO_TEST_CASE( charStarBindNull ) ins->bindParamS(0, ccsc); ins->bindParamS(1, ccsc2); ins->execute(); - free(cs2); auto sel = db->select("SELECT a, c FROM forEachRow"); for (const auto & row : sel->as, std::optional>()) { BOOST_REQUIRE(row[0].isNull()); @@ -430,7 +429,7 @@ testExtractT(const DB::SelectCommandPtr & sel) { #ifdef __clang__ // Clang cannot compile this for reasons largely todo with ambiguousness in the spec // Fixed when we move to std::chrono - // NOLINTNEXTLINE(bugprone-suspicious-semicolon) + // NOLINTNEXTLINE(bugprone-suspicious-semicolon,hicpp-braces-around-statements) if constexpr (!std::is_same::value) { #else if constexpr (true) { -- cgit v1.2.3