Skip to content

Commit 231bf40

Browse files
committed
Cleanup basic flex tests
1 parent a48697b commit 231bf40

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

tests/test-output-flex.cpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
static testing::db::import_t db;
77

8+
static char const *const conf_file = "test_output_flex.lua";
9+
810
static void require_tables(pg::conn_t const &conn)
911
{
1012
conn.require_has_table("osm2pgsql_test_point");
@@ -15,9 +17,9 @@ static void require_tables(pg::conn_t const &conn)
1517

1618
TEST_CASE("liechtenstein slim regression simple")
1719
{
18-
REQUIRE_NOTHROW(
19-
db.run_file(testing::opt_t().slim().flex("test_output_flex.lua"),
20-
"liechtenstein-2013-08-03.osm.pbf"));
20+
options_t const options = testing::opt_t().slim().flex(conf_file);
21+
22+
REQUIRE_NOTHROW(db.run_file(options, "liechtenstein-2013-08-03.osm.pbf"));
2123

2224
auto conn = db.db().connect();
2325
require_tables(conn);
@@ -52,9 +54,10 @@ TEST_CASE("liechtenstein slim regression simple")
5254

5355
TEST_CASE("liechtenstein slim latlon")
5456
{
55-
REQUIRE_NOTHROW(db.run_file(
56-
testing::opt_t().slim().flex("test_output_flex.lua").srs(PROJ_LATLONG),
57-
"liechtenstein-2013-08-03.osm.pbf"));
57+
options_t const options =
58+
testing::opt_t().slim().flex(conf_file).srs(PROJ_LATLONG);
59+
60+
REQUIRE_NOTHROW(db.run_file(options, "liechtenstein-2013-08-03.osm.pbf"));
5861

5962
auto conn = db.db().connect();
6063
require_tables(conn);
@@ -89,9 +92,10 @@ TEST_CASE("liechtenstein slim latlon")
8992

9093
TEST_CASE("way area slim flatnode")
9194
{
92-
REQUIRE_NOTHROW(db.run_file(
93-
testing::opt_t().slim().flex("test_output_flex.lua").flatnodes(),
94-
"test_output_pgsql_way_area.osm"));
95+
options_t const options =
96+
testing::opt_t().slim().flex(conf_file).flatnodes();
97+
98+
REQUIRE_NOTHROW(db.run_file(options, "test_output_pgsql_way_area.osm"));
9599

96100
auto conn = db.db().connect();
97101
require_tables(conn);
@@ -103,9 +107,10 @@ TEST_CASE("way area slim flatnode")
103107

104108
TEST_CASE("route relation slim flatnode")
105109
{
106-
REQUIRE_NOTHROW(db.run_file(
107-
testing::opt_t().slim().flex("test_output_flex.lua").flatnodes(),
108-
"test_output_pgsql_route_rel.osm"));
110+
options_t const options =
111+
testing::opt_t().slim().flex(conf_file).flatnodes();
112+
113+
REQUIRE_NOTHROW(db.run_file(options, "test_output_pgsql_route_rel.osm"));
109114

110115
auto conn = db.db().connect();
111116
require_tables(conn);
@@ -118,9 +123,9 @@ TEST_CASE("route relation slim flatnode")
118123

119124
TEST_CASE("liechtenstein slim bz2 parsing regression")
120125
{
121-
REQUIRE_NOTHROW(
122-
db.run_file(testing::opt_t().slim().flex("test_output_flex.lua"),
123-
"liechtenstein-2013-08-03.osm.bz2"));
126+
options_t const options = testing::opt_t().slim().flex(conf_file);
127+
128+
REQUIRE_NOTHROW(db.run_file(options, "liechtenstein-2013-08-03.osm.bz2"));
124129

125130
auto conn = db.db().connect();
126131
require_tables(conn);

0 commit comments

Comments
 (0)