diff --git a/src/flex-table-column.cpp b/src/flex-table-column.cpp index 57ed471ff..9fea319bc 100644 --- a/src/flex-table-column.cpp +++ b/src/flex-table-column.cpp @@ -31,7 +31,7 @@ struct column_type_lookup char const *name() const noexcept { return m_name; } }; -std::vector const column_types = { +std::vector const COLUMN_TYPES = { {{"text", table_column_type::text}, {"boolean", table_column_type::boolean}, {"bool", table_column_type::boolean}, @@ -60,7 +60,7 @@ std::vector const column_types = { table_column_type get_column_type_from_string(std::string const &type) { - auto const *column_type = util::find_by_name(column_types, type); + auto const *column_type = util::find_by_name(COLUMN_TYPES, type); if (!column_type) { throw fmt_error("Unknown column type '{}'.", type); } diff --git a/src/geom-area-assembler.cpp b/src/geom-area-assembler.cpp index 332bd83c3..c2163b841 100644 --- a/src/geom-area-assembler.cpp +++ b/src/geom-area-assembler.cpp @@ -13,10 +13,10 @@ namespace geom { -osmium::area::AssemblerConfig const area_config; +osmium::area::AssemblerConfig const AREA_CONFIG; area_assembler_t::area_assembler_t(osmium::memory::Buffer *buffer) -: osmium::area::detail::BasicAssembler(area_config), m_buffer(buffer) +: osmium::area::detail::BasicAssembler(AREA_CONFIG), m_buffer(buffer) { } diff --git a/tests/test-expire-from-geometry.cpp b/tests/test-expire-from-geometry.cpp index 0260a7533..90623ae68 100644 --- a/tests/test-expire-from-geometry.cpp +++ b/tests/test-expire-from-geometry.cpp @@ -25,14 +25,14 @@ std::shared_ptr defproj{ // We are using zoom level 12 here, because at that level a tile is about // 10,000 units wide/high which gives us easy numbers to work with. -constexpr uint32_t zoom = 12; +constexpr uint32_t ZOOM = 12; } // anonymous namespace TEST_CASE("expire null geometry does nothing", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("geom") { @@ -53,7 +53,7 @@ TEST_CASE("expire null geometry does nothing", "[NoDB]") TEST_CASE("expire point at tile boundary", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::point_t const pt{0.0, 0.0}; @@ -74,16 +74,16 @@ TEST_CASE("expire point at tile boundary", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 4); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2047, 2047}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2047, 2048}); - CHECK(tile_t::from_quadkey(tiles[3], zoom) == tile_t{zoom, 2048, 2048}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2047, 2047}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2047, 2048}); + CHECK(tile_t::from_quadkey(tiles[3], ZOOM) == tile_t{ZOOM, 2048, 2048}); } TEST_CASE("expire point away from tile boundary", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::point_t const pt{5000.0, 5000.0}; @@ -104,13 +104,13 @@ TEST_CASE("expire point away from tile boundary", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 1); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2047}); } TEST_CASE("expire linestring away from tile boundary", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("line") { @@ -135,13 +135,13 @@ TEST_CASE("expire linestring away from tile boundary", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 1); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2047}); } TEST_CASE("expire linestring crossing tile boundary", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("line") { @@ -166,14 +166,14 @@ TEST_CASE("expire linestring crossing tile boundary", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 2); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2046}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2046}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2048, 2047}); } TEST_CASE("expire small polygon", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("polygon") { @@ -210,7 +210,7 @@ TEST_CASE("expire small polygon", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 1); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2047}); } TEST_CASE("expire large polygon as bbox", "[NoDB]") @@ -218,7 +218,7 @@ TEST_CASE("expire large polygon as bbox", "[NoDB]") expire_config_t expire_config; expire_config.mode = expire_mode::hybrid; expire_config.full_area_limit = 40000; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("polygon") { @@ -255,17 +255,17 @@ TEST_CASE("expire large polygon as bbox", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 9); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2045}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2049, 2045}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2050, 2045}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2045}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2049, 2045}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2050, 2045}); - CHECK(tile_t::from_quadkey(tiles[3], zoom) == tile_t{zoom, 2048, 2046}); - CHECK(tile_t::from_quadkey(tiles[4], zoom) == tile_t{zoom, 2049, 2046}); - CHECK(tile_t::from_quadkey(tiles[7], zoom) == tile_t{zoom, 2050, 2046}); + CHECK(tile_t::from_quadkey(tiles[3], ZOOM) == tile_t{ZOOM, 2048, 2046}); + CHECK(tile_t::from_quadkey(tiles[4], ZOOM) == tile_t{ZOOM, 2049, 2046}); + CHECK(tile_t::from_quadkey(tiles[7], ZOOM) == tile_t{ZOOM, 2050, 2046}); - CHECK(tile_t::from_quadkey(tiles[5], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[6], zoom) == tile_t{zoom, 2049, 2047}); - CHECK(tile_t::from_quadkey(tiles[8], zoom) == tile_t{zoom, 2050, 2047}); + CHECK(tile_t::from_quadkey(tiles[5], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[6], ZOOM) == tile_t{ZOOM, 2049, 2047}); + CHECK(tile_t::from_quadkey(tiles[8], ZOOM) == tile_t{ZOOM, 2050, 2047}); } TEST_CASE("expire large polygon as boundary", "[NoDB]") @@ -273,7 +273,7 @@ TEST_CASE("expire large polygon as boundary", "[NoDB]") expire_config_t expire_config; expire_config.mode = expire_mode::hybrid; expire_config.full_area_limit = 10000; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; SECTION("polygon") { @@ -320,22 +320,22 @@ TEST_CASE("expire large polygon as boundary", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 8); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2048, 2045}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2049, 2045}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2050, 2045}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2048, 2045}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2049, 2045}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2050, 2045}); - CHECK(tile_t::from_quadkey(tiles[3], zoom) == tile_t{zoom, 2048, 2046}); - CHECK(tile_t::from_quadkey(tiles[6], zoom) == tile_t{zoom, 2050, 2046}); + CHECK(tile_t::from_quadkey(tiles[3], ZOOM) == tile_t{ZOOM, 2048, 2046}); + CHECK(tile_t::from_quadkey(tiles[6], ZOOM) == tile_t{ZOOM, 2050, 2046}); - CHECK(tile_t::from_quadkey(tiles[4], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[5], zoom) == tile_t{zoom, 2049, 2047}); - CHECK(tile_t::from_quadkey(tiles[7], zoom) == tile_t{zoom, 2050, 2047}); + CHECK(tile_t::from_quadkey(tiles[4], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[5], ZOOM) == tile_t{ZOOM, 2049, 2047}); + CHECK(tile_t::from_quadkey(tiles[7], ZOOM) == tile_t{ZOOM, 2050, 2047}); } TEST_CASE("expire multipoint geometry", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::point_t const p1{0.0, 0.0}; geom::point_t const p2{15000.0, 15000.0}; @@ -369,17 +369,17 @@ TEST_CASE("expire multipoint geometry", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 5); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2047, 2047}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2049, 2046}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[3], zoom) == tile_t{zoom, 2047, 2048}); - CHECK(tile_t::from_quadkey(tiles[4], zoom) == tile_t{zoom, 2048, 2048}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2047, 2047}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2049, 2046}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[3], ZOOM) == tile_t{ZOOM, 2047, 2048}); + CHECK(tile_t::from_quadkey(tiles[4], ZOOM) == tile_t{ZOOM, 2048, 2048}); } TEST_CASE("expire multilinestring geometry", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::linestring_t l1{{2000.0, 2000.0}, {3000.0, 3000.0}}; geom::linestring_t l2{{15000.0, 15000.0}, {25000.0, 15000.0}}; @@ -397,9 +397,9 @@ TEST_CASE("expire multilinestring geometry", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 3); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2049, 2046}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2050, 2046}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2049, 2046}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2050, 2046}); } TEST_CASE("expire multipolygon geometry", "[NoDB]") @@ -407,7 +407,7 @@ TEST_CASE("expire multipolygon geometry", "[NoDB]") expire_config_t expire_config; expire_config.mode = expire_mode::hybrid; expire_config.full_area_limit = 10000; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::polygon_t p1{{{2000.0, 2000.0}, {2000.0, 3000.0}, @@ -447,11 +447,11 @@ TEST_CASE("expire multipolygon geometry", "[NoDB]") } std::set expected; - expected.insert(tile_t{zoom, 2048, 2047}.quadkey()); // p1 + expected.insert(tile_t{ZOOM, 2048, 2047}.quadkey()); // p1 for (uint32_t x = 2049; x <= 2052; ++x) { for (uint32_t y = 2043; y <= 2046; ++y) { - expected.insert(tile_t{zoom, x, y}.quadkey()); // p2 + expected.insert(tile_t{ZOOM, x, y}.quadkey()); // p2 } } REQUIRE(expected == result); @@ -460,7 +460,7 @@ TEST_CASE("expire multipolygon geometry", "[NoDB]") TEST_CASE("expire geometry collection", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::collection_t collection; collection.add_geometry(geom::geometry_t{geom::point_t{0.0, 0.0}}); @@ -472,18 +472,18 @@ TEST_CASE("expire geometry collection", "[NoDB]") auto const tiles = et.get_tiles(); REQUIRE(tiles.size() == 6); - CHECK(tile_t::from_quadkey(tiles[0], zoom) == tile_t{zoom, 2047, 2047}); - CHECK(tile_t::from_quadkey(tiles[1], zoom) == tile_t{zoom, 2049, 2046}); - CHECK(tile_t::from_quadkey(tiles[2], zoom) == tile_t{zoom, 2048, 2047}); - CHECK(tile_t::from_quadkey(tiles[3], zoom) == tile_t{zoom, 2050, 2046}); - CHECK(tile_t::from_quadkey(tiles[4], zoom) == tile_t{zoom, 2047, 2048}); - CHECK(tile_t::from_quadkey(tiles[5], zoom) == tile_t{zoom, 2048, 2048}); + CHECK(tile_t::from_quadkey(tiles[0], ZOOM) == tile_t{ZOOM, 2047, 2047}); + CHECK(tile_t::from_quadkey(tiles[1], ZOOM) == tile_t{ZOOM, 2049, 2046}); + CHECK(tile_t::from_quadkey(tiles[2], ZOOM) == tile_t{ZOOM, 2048, 2047}); + CHECK(tile_t::from_quadkey(tiles[3], ZOOM) == tile_t{ZOOM, 2050, 2046}); + CHECK(tile_t::from_quadkey(tiles[4], ZOOM) == tile_t{ZOOM, 2047, 2048}); + CHECK(tile_t::from_quadkey(tiles[5], ZOOM) == tile_t{ZOOM, 2048, 2048}); } TEST_CASE("expire works if in 3857", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::geometry_t geom{geom::point_t{0.0, 0.0}}; geom.set_srid(PROJ_SPHERE_MERC); @@ -496,7 +496,7 @@ TEST_CASE("expire works if in 3857", "[NoDB]") TEST_CASE("expire doesn't do anything if not in 3857", "[NoDB]") { expire_config_t const expire_config; - expire_tiles et{zoom, defproj}; + expire_tiles et{ZOOM, defproj}; geom::geometry_t geom{geom::point_t{0.0, 0.0}}; geom.set_srid(1234); diff --git a/tests/test-output-flex-example-configs.cpp b/tests/test-output-flex-example-configs.cpp index 3d1bcfba3..f5da24111 100644 --- a/tests/test-output-flex-example-configs.cpp +++ b/tests/test-output-flex-example-configs.cpp @@ -23,7 +23,7 @@ namespace { testing::db::import_t db; -char const *const data_file = "liechtenstein-2013-08-03.osm.pbf"; +char const *const DATA_FILE = "liechtenstein-2013-08-03.osm.pbf"; std::vector get_files() { // NOLINTNEXTLINE(concurrency-mt-unsafe) @@ -43,7 +43,7 @@ TEST_CASE("minimal test for flex example configs") auto const conf_file = "../../flex-config/" + file + ".lua"; options_t const options = testing::opt_t().flex(conf_file.c_str()); - REQUIRE_NOTHROW(db.run_file(options, data_file)); + REQUIRE_NOTHROW(db.run_file(options, DATA_FILE)); auto conn = db.db().connect(); } diff --git a/tests/test-output-flex-multi-input.cpp b/tests/test-output-flex-multi-input.cpp index 3f6b8fd4e..63b8a08e3 100644 --- a/tests/test-output-flex-multi-input.cpp +++ b/tests/test-output-flex-multi-input.cpp @@ -16,15 +16,15 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex.lua"; -char const *const points = "osm2pgsql_test_point"; -char const *const lines = "osm2pgsql_test_line"; +char const *const CONF_FILE = "test_output_flex.lua"; +char const *const POINT_TABLE = "osm2pgsql_test_point"; +char const *const LINE_TABLE = "osm2pgsql_test_line"; } // anonymous namespace TEST_CASE("with three input files") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, {"n10 v1 dV x10.0 y10.0\n" @@ -36,26 +36,26 @@ TEST_CASE("with three input files") auto conn = db.db().connect(); - CHECK(1 == conn.get_count(points)); - CHECK(2 == conn.get_count(lines)); - CHECK(1 == conn.get_count(lines, "tags->'highway' = 'primary'")); - CHECK(1 == conn.get_count(lines, "tags->'highway' = 'secondary'")); - CHECK(1 == conn.get_count(lines, "ST_NumPoints(geom) = 3")); - CHECK(1 == conn.get_count(lines, "ST_NumPoints(geom) = 2")); + CHECK(1 == conn.get_count(POINT_TABLE)); + CHECK(2 == conn.get_count(LINE_TABLE)); + CHECK(1 == conn.get_count(LINE_TABLE, "tags->'highway' = 'primary'")); + CHECK(1 == conn.get_count(LINE_TABLE, "tags->'highway' = 'secondary'")); + CHECK(1 == conn.get_count(LINE_TABLE, "ST_NumPoints(geom) = 3")); + CHECK(1 == conn.get_count(LINE_TABLE, "ST_NumPoints(geom) = 2")); options.append = true; REQUIRE_NOTHROW(db.run_import(options, "n10 v2 dV x11.0 y11.0\n")); - CHECK(1 == conn.get_count(points)); - CHECK(2 == conn.get_count(lines)); - CHECK(1 == conn.get_count(lines, "ST_NumPoints(geom) = 3")); - CHECK(1 == conn.get_count(lines, "ST_NumPoints(geom) = 2")); + CHECK(1 == conn.get_count(POINT_TABLE)); + CHECK(2 == conn.get_count(LINE_TABLE)); + CHECK(1 == conn.get_count(LINE_TABLE, "ST_NumPoints(geom) = 3")); + CHECK(1 == conn.get_count(LINE_TABLE, "ST_NumPoints(geom) = 2")); } TEST_CASE("should use newest version of any object") { - options_t const options = testing::opt_t().slim().flex(conf_file); + options_t const options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, {"n10 v1 dV x10.0 y10.0 Ta=10.1\n" @@ -68,10 +68,10 @@ TEST_CASE("should use newest version of any object") auto conn = db.db().connect(); - CHECK(4 == conn.get_count(points)); - CHECK(1 == conn.get_count(points, "tags->'a' = '10.1'")); // both the same - CHECK(1 == conn.get_count(points, "tags->'a' = '11.2'")); - CHECK(1 == conn.get_count(points, "tags->'a' = '12.1'")); // only one - CHECK(1 == conn.get_count(points, "tags->'a' = '13.2'")); + CHECK(4 == conn.get_count(POINT_TABLE)); + CHECK(1 == conn.get_count(POINT_TABLE, "tags->'a' = '10.1'")); // both the same + CHECK(1 == conn.get_count(POINT_TABLE, "tags->'a' = '11.2'")); + CHECK(1 == conn.get_count(POINT_TABLE, "tags->'a' = '12.1'")); // only one + CHECK(1 == conn.get_count(POINT_TABLE, "tags->'a' = '13.2'")); } diff --git a/tests/test-output-flex-nodes.cpp b/tests/test-output-flex-nodes.cpp index 9ffbf85ae..f4a8ed9ae 100644 --- a/tests/test-output-flex-nodes.cpp +++ b/tests/test-output-flex-nodes.cpp @@ -16,13 +16,13 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_nodes.lua"; +char const *const CONF_FILE = "test_output_flex_nodes.lua"; } // anonymous namespace TEST_CASE("add nodes") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "n10 v1 dV x10.0 y10.0\n" @@ -73,7 +73,7 @@ using node_rel_in_relation = node_rel; TEMPLATE_TEST_CASE("change nodes", "", node_rel_none, node_rel_in_way, node_rel_in_relation) { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "n10 v1 dV x10.0 y10.0\n" @@ -160,7 +160,7 @@ TEMPLATE_TEST_CASE("change nodes", "", node_rel_none, node_rel_in_way, TEMPLATE_TEST_CASE("delete nodes", "", node_rel_none, node_rel_in_way, node_rel_in_relation) { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "n10 v1 dV x10.0 y10.0\n" diff --git a/tests/test-output-flex-relation-combinations.cpp b/tests/test-output-flex-relation-combinations.cpp index 42ec81e9f..c05ce9414 100644 --- a/tests/test-output-flex-relation-combinations.cpp +++ b/tests/test-output-flex-relation-combinations.cpp @@ -16,13 +16,13 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_relation_combinations.lua"; +char const *const CONF_FILE = "test_output_flex_relation_combinations.lua"; } // anonymous namespace TEST_CASE("adding common way to relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "n10 v1 dV x10.0 y10.0\n" "n11 v1 dV x10.0 y10.1\n" @@ -50,7 +50,7 @@ TEST_CASE("adding common way to relation") TEST_CASE("remove common way from relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "w20 v1 dV Nn10,n11\n" "w21 v1 dV Nn12,n13\n" @@ -74,7 +74,7 @@ TEST_CASE("remove common way from relation") TEST_CASE("change common way in relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "w20 v1 dV Nn10,n11\n" "w21 v1 dV Nn12,n13\n" diff --git a/tests/test-output-flex-relations.cpp b/tests/test-output-flex-relations.cpp index 0482523e2..0a57b6b2a 100644 --- a/tests/test-output-flex-relations.cpp +++ b/tests/test-output-flex-relations.cpp @@ -16,13 +16,13 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_relations.lua"; +char const *const CONF_FILE = "test_output_flex_relations.lua"; } // anonymous namespace TEST_CASE("add relations") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "r30 v1 dV\n" "r31 v1 dV Tt1=yes\n" @@ -53,7 +53,7 @@ TEST_CASE("add relations") TEST_CASE("change relations") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "r30 v1 dV\n" "r31 v1 dV Tt1=yes\n" @@ -127,7 +127,7 @@ TEST_CASE("change relations") TEST_CASE("delete relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "r30 v1 dV\n" "r31 v1 dV Tt1=yes\n" diff --git a/tests/test-output-flex-schema.cpp b/tests/test-output-flex-schema.cpp index bb6cef9c1..7ae5b5604 100644 --- a/tests/test-output-flex-schema.cpp +++ b/tests/test-output-flex-schema.cpp @@ -16,20 +16,20 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_schema.lua"; -char const *const data_file = "liechtenstein-2013-08-03.osm.pbf"; +char const *const CONF_FILE = "test_output_flex_schema.lua"; +char const *const DATA_FILE = "liechtenstein-2013-08-03.osm.pbf"; } // anonymous namespace TEST_CASE("config with schema should work") { - options_t const options = testing::opt_t().slim().flex(conf_file); + options_t const options = testing::opt_t().slim().flex(CONF_FILE); auto conn = db.db().connect(); conn.exec("CREATE SCHEMA IF NOT EXISTS myschema;"); init_database_capabilities(conn); - REQUIRE_NOTHROW(db.run_file(options, data_file)); + REQUIRE_NOTHROW(db.run_file(options, DATA_FILE)); REQUIRE(1 == conn.get_count("pg_catalog.pg_namespace", "nspname = 'myschema'")); diff --git a/tests/test-output-flex-stage2.cpp b/tests/test-output-flex-stage2.cpp index 2e370bddd..d53853dba 100644 --- a/tests/test-output-flex-stage2.cpp +++ b/tests/test-output-flex-stage2.cpp @@ -16,13 +16,13 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_stage2.lua"; +char const *const CONF_FILE = "test_output_flex_stage2.lua"; } // anonymous namespace TEST_CASE("nodes and ways") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import(options, "n10 v1 dV x10.0 y10.0\n" @@ -100,7 +100,7 @@ TEST_CASE("nodes and ways") TEST_CASE("relation data on ways") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and a relation on two of them REQUIRE_NOTHROW( @@ -198,7 +198,7 @@ TEST_CASE("relation data on ways") TEST_CASE("relation data on ways: delete or re-tag relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and a relation on two of them REQUIRE_NOTHROW( @@ -257,7 +257,7 @@ TEST_CASE("relation data on ways: delete or re-tag relation") TEST_CASE("relation data on ways: delete way in other relation") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and two relations on them REQUIRE_NOTHROW( @@ -326,7 +326,7 @@ TEST_CASE("relation data on ways: delete way in other relation") TEST_CASE("relation data on ways: changing things in one relation should not " "change output") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and two relations on them REQUIRE_NOTHROW( @@ -402,7 +402,7 @@ TEST_CASE("relation data on ways: changing things in one relation should not " TEST_CASE("relation data on ways: change relation (two rels)") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and two relations on them REQUIRE_NOTHROW( @@ -458,7 +458,7 @@ TEST_CASE("relation data on ways: change relation (two rels)") TEST_CASE("relation data on ways: change relation (three rels)") { - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); // create database with three ways and two relations on them REQUIRE_NOTHROW(db.run_import(options, diff --git a/tests/test-output-flex-tablespace.cpp b/tests/test-output-flex-tablespace.cpp index 65e61a3f2..527784855 100644 --- a/tests/test-output-flex-tablespace.cpp +++ b/tests/test-output-flex-tablespace.cpp @@ -16,7 +16,7 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex.lua"; +char const *const CONF_FILE = "test_output_flex.lua"; } // anonymous namespace @@ -28,7 +28,7 @@ TEST_CASE("simple import with tablespaces for middle") "spcname = 'tablespacetest'")); } - options_t options = testing::opt_t().slim().flex(conf_file); + options_t options = testing::opt_t().slim().flex(CONF_FILE); options.tblsslim_index = "tablespacetest"; options.tblsslim_data = "tablespacetest"; diff --git a/tests/test-output-flex-types.cpp b/tests/test-output-flex-types.cpp index cd22c5c59..689208894 100644 --- a/tests/test-output-flex-types.cpp +++ b/tests/test-output-flex-types.cpp @@ -18,13 +18,13 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_types.lua"; +char const *const CONF_FILE = "test_output_flex_types.lua"; } // anonymous namespace TEST_CASE("type nil") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, "n10 v1 dV x10.0 y10.0 Ttype=nil\n")); @@ -43,7 +43,7 @@ TEST_CASE("type nil") TEST_CASE("type boolean") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, "n10 v1 dV x10.0 y10.0 Ttype=boolean\n")); @@ -61,7 +61,7 @@ TEST_CASE("type boolean") TEST_CASE("type boolean in column where it doesn't belong") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_THROWS(db.run_import( options, "n10 v1 dV x10.0 y10.0 Ttype=boolean-fail column=ttext\n")); @@ -79,7 +79,7 @@ TEST_CASE("type boolean in column where it doesn't belong") TEST_CASE("type number") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, "n10 v1 dV x10.0 y10.0 Ttype=number\n")); @@ -113,7 +113,7 @@ TEST_CASE("type number") TEST_CASE("type string (with bool)") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, "n10 v1 dV x10.0 y10.0 Ttype=string-bool\n")); @@ -128,7 +128,7 @@ TEST_CASE("type string (with bool)") TEST_CASE("type string (with direction)") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import( options, "n10 v1 dV x10.0 y10.0 Ttype=string-direction\n")); @@ -142,7 +142,7 @@ TEST_CASE("type string (with direction)") TEST_CASE("type string (with number)") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import( options, "n10 v1 dV x10.0 y10.0 Ttype=string-with-number\n")); @@ -175,7 +175,7 @@ TEST_CASE("type string (with number)") TEST_CASE("type string (with invalid number)") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW(db.run_import( options, "n10 v1 dV x10.0 y10.0 Ttype=string-with-invalid-number\n")); @@ -197,7 +197,7 @@ TEST_CASE("type string (with invalid number)") TEST_CASE("type number in column where it doesn't belong") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_THROWS(db.run_import( options, "n10 v1 dV x10.0 y10.0 Ttype=number-fail column=thstr\n")); @@ -209,7 +209,7 @@ TEST_CASE("type number in column where it doesn't belong") TEST_CASE("Adding a function should always fail") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); std::array const types = {"ttext", "tbool", "tint2", "tint4", "tint8", "treal", @@ -228,7 +228,7 @@ TEST_CASE("Adding a function should always fail") TEST_CASE("type table") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); REQUIRE_NOTHROW( db.run_import(options, "n10 v1 dV x10.0 y10.0 Ttype=table\n")); @@ -245,7 +245,7 @@ TEST_CASE("type table") TEST_CASE("Adding a table with non-strings should fail for hstore") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); char const *const line = "n10 v1 dV x10.0 y10.0 Ttype=table-hstore-fail\n"; REQUIRE_THROWS(db.run_import(options, line)); @@ -257,7 +257,7 @@ TEST_CASE("Adding a table with non-strings should fail for hstore") TEST_CASE("Adding a table should fail except for hstore and json/jsonb") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); std::array const types = { "ttext", "tbool", "tint2", "tint4", "tint8", "treal", "tdirn", "tsqlt"}; @@ -275,7 +275,7 @@ TEST_CASE("Adding a table should fail except for hstore and json/jsonb") TEST_CASE("Adding a complex table in jsonb") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); char const *const line = "n10 v1 dV x10.0 y10.0 Ttype=json\n"; REQUIRE_NOTHROW(db.run_import(options, line)); @@ -295,7 +295,7 @@ TEST_CASE("Adding a complex table in jsonb") TEST_CASE("Adding a table with a loop should fail") { - testing::opt_t const options = testing::opt_t().flex(conf_file); + testing::opt_t const options = testing::opt_t().flex(CONF_FILE); char const *const line = "n10 v1 dV x10.0 y10.0 Ttype=json-loop\n"; REQUIRE_THROWS(db.run_import(options, line)); diff --git a/tests/test-output-flex-uni.cpp b/tests/test-output-flex-uni.cpp index e42848563..17604b304 100644 --- a/tests/test-output-flex-uni.cpp +++ b/tests/test-output-flex-uni.cpp @@ -16,7 +16,7 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_uni.lua"; +char const *const CONF_FILE = "test_output_flex_uni.lua"; } // anonymous namespace @@ -24,7 +24,7 @@ struct options_slim_default { static options_t options() { - return testing::opt_t().slim().flex(conf_file); + return testing::opt_t().slim().flex(CONF_FILE); } }; diff --git a/tests/test-output-flex-update.cpp b/tests/test-output-flex-update.cpp index a6a6b0d4f..879ce2ae1 100644 --- a/tests/test-output-flex-update.cpp +++ b/tests/test-output-flex-update.cpp @@ -17,7 +17,7 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex.lua"; +char const *const CONF_FILE = "test_output_flex.lua"; // Return a string with the schema name prepended to the table name. std::string with_schema(char const *table_name, options_t const &options) @@ -34,7 +34,7 @@ struct options_slim_default { static options_t options() { - return testing::opt_t().slim().flex(conf_file); + return testing::opt_t().slim().flex(CONF_FILE); } }; @@ -75,7 +75,7 @@ END conn.close(); return testing::opt_t() .slim() - .flex(conf_file) + .flex(CONF_FILE) .schema("myschema") .user("limited", "password_limited"); } diff --git a/tests/test-output-flex-validgeom.cpp b/tests/test-output-flex-validgeom.cpp index 59ae9c69e..73eec6665 100644 --- a/tests/test-output-flex-validgeom.cpp +++ b/tests/test-output-flex-validgeom.cpp @@ -16,16 +16,16 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex_validgeom.lua"; -char const *const data_file = "test_output_pgsql_validgeom.osm"; +char const *const CONF_FILE = "test_output_flex_validgeom.lua"; +char const *const DATA_FILE = "test_output_pgsql_validgeom.osm"; } // anonymous namespace TEST_CASE("no invalid geometries should end up in the database") { - options_t const options = testing::opt_t().flex(conf_file); + options_t const options = testing::opt_t().flex(CONF_FILE); - REQUIRE_NOTHROW(db.run_file(options, data_file)); + REQUIRE_NOTHROW(db.run_file(options, DATA_FILE)); auto conn = db.db().connect(); diff --git a/tests/test-output-flex.cpp b/tests/test-output-flex.cpp index 32ef66ea2..ec6dcaf24 100644 --- a/tests/test-output-flex.cpp +++ b/tests/test-output-flex.cpp @@ -16,7 +16,7 @@ namespace { testing::db::import_t db; -char const *const conf_file = "test_output_flex.lua"; +char const *const CONF_FILE = "test_output_flex.lua"; } // anonymous namespace @@ -24,7 +24,7 @@ struct options_slim_default { static options_t options() { - return testing::opt_t().slim().flex(conf_file); + return testing::opt_t().slim().flex(CONF_FILE); } }; @@ -32,7 +32,7 @@ struct options_slim_latlon { static options_t options() { - return testing::opt_t().slim().flex(conf_file).srs(PROJ_LATLONG); + return testing::opt_t().slim().flex(CONF_FILE).srs(PROJ_LATLONG); } };