[Tile-serving] [openstreetmap/osm2pgsql] Move declaration of static `db` into tests (#1012)

Jochen Topf notifications at github.com
Tue Dec 3 14:46:47 UTC 2019


`pg::tempdb_t db` or `testing::db::import_t db` is defined as static in many test files. This is problematic, because the class may throw errors which we can't catch and the testing framework can't report correctly then.

This is caught by clang-tidy with error messages like this:
"warning: initialization of 'db' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]"

This commit fixes all these cases.

This commit also adds a bunch of `const`s.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1012

-- Commit Summary --

  * Move declaration of static `db` into tests

-- File Changes --

    M tests/test-db-copy-mgr.cpp (51)
    M tests/test-db-copy-thread.cpp (6)
    M tests/test-middle.cpp (4)
    M tests/test-options-projection.cpp (6)
    M tests/test-output-gazetteer.cpp (4)
    M tests/test-output-multi-line-storage.cpp (15)
    M tests/test-output-multi-line.cpp (10)
    M tests/test-output-multi-point-multi-table.cpp (10)
    M tests/test-output-multi-point.cpp (10)
    M tests/test-output-multi-poly-trivial.cpp (8)
    M tests/test-output-multi-polygon.cpp (10)
    M tests/test-output-multi-tags.cpp (14)
    M tests/test-output-pgsql-area.cpp (18)
    M tests/test-output-pgsql-hstore-match-only.cpp (6)
    M tests/test-output-pgsql-int4.cpp (6)
    M tests/test-output-pgsql-schema.cpp (6)
    M tests/test-output-pgsql-tablespace.cpp (8)
    M tests/test-output-pgsql-validgeom.cpp (6)
    M tests/test-output-pgsql-z_order.cpp (6)
    M tests/test-output-pgsql.cpp (18)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1012.patch
https://github.com/openstreetmap/osm2pgsql/pull/1012.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1012
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20191203/d7531b64/attachment.html>


More information about the Tile-serving mailing list