Skip to content

Commit 70ee2ce

Browse files
authored
Merge pull request #2398 from joto/clang-tidy-in-headers
Small fixes in headers found by clang-tidy
2 parents 3a12fb3 + 9b0a5dd commit 70ee2ce

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

tests/common-cleanup.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ namespace testing::cleanup {
2626
class file_t
2727
{
2828
public:
29-
file_t(std::string const &filename, bool remove_on_construct = true)
29+
explicit file_t(std::string const &filename,
30+
bool remove_on_construct = true)
3031
: m_filename(filename)
3132
{
3233
if (remove_on_construct) {

tests/common-import.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class data_t
111111
static std::pair<osmium::item_type, osmium::object_id_type>
112112
get_type_id(std::string const &str)
113113
{
114-
std::string ti(str, 0, str.find(' '));
114+
std::string const ti(str, 0, str.find(' '));
115115
return osmium::string_to_object_id(ti.c_str(),
116116
osmium::osm_entity_bits::nwr);
117117
}

tests/common-pg.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace testing::pg {
3737
class conn_t : public pg_conn_t
3838
{
3939
public:
40-
conn_t(connection_params_t const &connection_params)
40+
explicit conn_t(connection_params_t const &connection_params)
4141
: pg_conn_t(connection_params, "test")
4242
{
4343
}
@@ -105,15 +105,15 @@ class tempdb_t
105105
try {
106106
connection_params_t connection_params;
107107
connection_params.set("dbname", "postgres");
108-
conn_t conn{connection_params};
108+
conn_t const conn{connection_params};
109109

110110
m_db_name =
111111
fmt::format("osm2pgsql-test-{}-{}", getpid(), time(nullptr));
112112
conn.exec(R"(DROP DATABASE IF EXISTS "{}")", m_db_name);
113113
conn.exec(R"(CREATE DATABASE "{}" WITH ENCODING 'UTF8')",
114114
m_db_name);
115115

116-
conn_t local = connect();
116+
conn_t const local = connect();
117117
local.exec("CREATE EXTENSION postgis");
118118
local.exec("CREATE EXTENSION hstore");
119119
init_database_capabilities(local);
@@ -145,7 +145,7 @@ class tempdb_t
145145
try {
146146
connection_params_t connection_params;
147147
connection_params.set("dbname", "postgres");
148-
conn_t conn{connection_params};
148+
conn_t const conn{connection_params};
149149
conn.exec(R"(DROP DATABASE IF EXISTS "{}")", m_db_name);
150150
} catch (...) {
151151
fprintf(stderr, "DROP DATABASE failed. Ignored.\n");

0 commit comments

Comments
 (0)