@@ -122,7 +122,7 @@ class tempdb_t
122
122
" Test database cannot be created: {}\n "
123
123
" Did you mean to run 'pg_virtualenv ctest'?\n " ,
124
124
e.what ());
125
- std::exit (1 );
125
+ std::exit (1 ); // NOLINT(concurrency-mt-unsafe)
126
126
}
127
127
}
128
128
@@ -134,22 +134,25 @@ class tempdb_t
134
134
135
135
~tempdb_t () noexcept
136
136
{
137
- if (!m_db_name.empty ()) {
138
- // Disable removal of the test database by setting the environment
139
- // variable OSM2PGSQL_KEEP_TEST_DB to anything. This can be useful
140
- // when debugging tests.
141
- char const *const keep_db = std::getenv (" OSM2PGSQL_KEEP_TEST_DB" );
142
- if (keep_db != nullptr ) {
143
- return ;
144
- }
145
- try {
146
- connection_params_t connection_params;
147
- connection_params.set (" dbname" , " postgres" );
148
- conn_t const conn{connection_params};
149
- conn.exec (R"( DROP DATABASE IF EXISTS "{}")" , m_db_name);
150
- } catch (...) {
151
- fprintf (stderr, " DROP DATABASE failed. Ignored.\n " );
152
- }
137
+ if (m_db_name.empty ()) {
138
+ return ;
139
+ }
140
+
141
+ // Disable removal of the test database by setting the environment
142
+ // variable OSM2PGSQL_KEEP_TEST_DB to anything. This can be useful
143
+ // when debugging tests.
144
+ // NOLINTNEXTLINE(concurrency-mt-unsafe)
145
+ char const *const keep_db = std::getenv (" OSM2PGSQL_KEEP_TEST_DB" );
146
+ if (keep_db != nullptr ) {
147
+ return ;
148
+ }
149
+ try {
150
+ connection_params_t connection_params;
151
+ connection_params.set (" dbname" , " postgres" );
152
+ conn_t const conn{connection_params};
153
+ conn.exec (R"( DROP DATABASE IF EXISTS "{}")" , m_db_name);
154
+ } catch (...) {
155
+ fmt::print (stderr, " DROP DATABASE failed. Ignored.\n " );
153
156
}
154
157
}
155
158
0 commit comments