summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-03-03 13:39:05 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-03-03 13:39:05 +0000
commita5cbac4c52ef00e167a63e165ecf0e2a21d3e08d (patch)
treefa8a133372e41f1154bea50804a3a119693faaaa
parentDon't use auto in traits binder, difficult to specialize (diff)
downloadlibdbpp-a5cbac4c52ef00e167a63e165ecf0e2a21d3e08d.tar.bz2
libdbpp-a5cbac4c52ef00e167a63e165ecf0e2a21d3e08d.tar.xz
libdbpp-a5cbac4c52ef00e167a63e165ecf0e2a21d3e08d.zip
More clang tidy fixes
-rw-r--r--libdbpp/unittests/Jamfile.jam4
m---------libdbpp/unittests/libdbpp-mysql0
m---------libdbpp/unittests/libdbpp-postgresql0
-rw-r--r--libdbpp/unittests/testParse.cpp2
-rw-r--r--libdbpp/unittests/testUtils.cpp9
5 files changed, 8 insertions, 7 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 : : <name>sqlite3 ;
lib odbc ;
lib boost_date_time ;
lib boost_system ;
-lib boost_utf : : <name>boost_unit_test_framework : : <toolset>tidy:<xcheckxx>hicpp-* ;
+lib boost_utf : : <name>boost_unit_test_framework : :
+ <toolset>tidy:<xcheckxx>hicpp-vararg
+ ;
lib Ice++11 ;
run
diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql
-Subproject 34800459e7645fea3640214b5f7f6d7de183d33
+Subproject 3a21e866ac46c33733b3a72d0fdfbce2d3cc72d
diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql
-Subproject 1423b078638884f8956a5cdc9d7f37d3bae7f02
+Subproject f988df5245cfb59e893bbe262aac8d6260196ba
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<int64_t>, std::optional<std::string>>()) {
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<T, boost::posix_time::time_duration>::value) {
#else
if constexpr (true) {