diff --git a/tests/common-cleanup.hpp b/tests/common-cleanup.hpp index 171a97263..46a1dbe5d 100644 --- a/tests/common-cleanup.hpp +++ b/tests/common-cleanup.hpp @@ -26,7 +26,8 @@ namespace testing::cleanup { class file_t { public: - file_t(std::string const &filename, bool remove_on_construct = true) + explicit file_t(std::string const &filename, + bool remove_on_construct = true) : m_filename(filename) { if (remove_on_construct) { diff --git a/tests/common-import.hpp b/tests/common-import.hpp index 532d84a7c..901df7e9c 100644 --- a/tests/common-import.hpp +++ b/tests/common-import.hpp @@ -111,7 +111,7 @@ class data_t static std::pair get_type_id(std::string const &str) { - std::string ti(str, 0, str.find(' ')); + std::string const ti(str, 0, str.find(' ')); return osmium::string_to_object_id(ti.c_str(), osmium::osm_entity_bits::nwr); } diff --git a/tests/common-pg.hpp b/tests/common-pg.hpp index 999c686dd..d48628499 100644 --- a/tests/common-pg.hpp +++ b/tests/common-pg.hpp @@ -37,7 +37,7 @@ namespace testing::pg { class conn_t : public pg_conn_t { public: - conn_t(connection_params_t const &connection_params) + explicit conn_t(connection_params_t const &connection_params) : pg_conn_t(connection_params, "test") { } @@ -105,7 +105,7 @@ class tempdb_t try { connection_params_t connection_params; connection_params.set("dbname", "postgres"); - conn_t conn{connection_params}; + conn_t const conn{connection_params}; m_db_name = fmt::format("osm2pgsql-test-{}-{}", getpid(), time(nullptr)); @@ -113,7 +113,7 @@ class tempdb_t conn.exec(R"(CREATE DATABASE "{}" WITH ENCODING 'UTF8')", m_db_name); - conn_t local = connect(); + conn_t const local = connect(); local.exec("CREATE EXTENSION postgis"); local.exec("CREATE EXTENSION hstore"); init_database_capabilities(local); @@ -145,7 +145,7 @@ class tempdb_t try { connection_params_t connection_params; connection_params.set("dbname", "postgres"); - conn_t conn{connection_params}; + conn_t const conn{connection_params}; conn.exec(R"(DROP DATABASE IF EXISTS "{}")", m_db_name); } catch (...) { fprintf(stderr, "DROP DATABASE failed. Ignored.\n");