@@ -7,86 +7,38 @@ static testing::db::import_t db;
77
88static char const *const conf_file = " test_output_flex.lua" ;
99
10- static void require_tables (pg:: conn_t const &conn)
10+ struct options_slim_default
1111{
12- conn. require_has_table ( " osm2pgsql_test_point " );
13- conn. require_has_table ( " osm2pgsql_test_line " );
14- conn. require_has_table ( " osm2pgsql_test_polygon " );
15- conn. require_has_table ( " osm2pgsql_test_route " );
16- }
12+ static options_t options ()
13+ {
14+ return testing::opt_t (). slim (). flex (conf_file );
15+ }
16+ };
1717
18- TEST_CASE ( " liechtenstein slim regression simple " )
18+ struct options_slim_latlon
1919{
20- options_t const options = testing::opt_t ().slim ().flex (conf_file);
20+ static options_t options ()
21+ {
22+ return testing::opt_t ().slim ().flex (conf_file).srs (PROJ_LATLONG);
23+ }
24+ };
25+
26+ TEMPLATE_TEST_CASE (" liechtenstein regression" , " " , options_slim_default,
27+ options_slim_latlon)
28+ {
29+ options_t options = TestType::options ();
2130
2231 REQUIRE_NOTHROW (db.run_file (options, " liechtenstein-2013-08-03.osm.pbf" ));
2332
2433 auto conn = db.db ().connect ();
25- require_tables (conn);
34+
35+ conn.require_has_table (" osm2pgsql_test_point" );
36+ conn.require_has_table (" osm2pgsql_test_line" );
37+ conn.require_has_table (" osm2pgsql_test_polygon" );
38+ conn.require_has_table (" osm2pgsql_test_route" );
2639
2740 CHECK (1362 == conn.get_count (" osm2pgsql_test_point" ));
2841 CHECK (2932 == conn.get_count (" osm2pgsql_test_line" ));
2942 CHECK (4136 == conn.get_count (" osm2pgsql_test_polygon" ));
3043 CHECK (35 == conn.get_count (" osm2pgsql_test_route" ));
3144}
32-
33- TEST_CASE (" liechtenstein slim latlon" )
34- {
35- options_t const options =
36- testing::opt_t ().slim ().flex (conf_file).srs (PROJ_LATLONG);
37-
38- REQUIRE_NOTHROW (db.run_file (options, " liechtenstein-2013-08-03.osm.pbf" ));
39-
40- auto conn = db.db ().connect ();
41- require_tables (conn);
42-
43- REQUIRE (1362 == conn.get_count (" osm2pgsql_test_point" ));
44- REQUIRE (2932 == conn.get_count (" osm2pgsql_test_line" ));
45- REQUIRE (4136 == conn.get_count (" osm2pgsql_test_polygon" ));
46- }
47-
48- TEST_CASE (" way area slim flatnode" )
49- {
50- options_t const options =
51- testing::opt_t ().slim ().flex (conf_file).flatnodes ();
52-
53- REQUIRE_NOTHROW (db.run_file (options, " test_output_pgsql_way_area.osm" ));
54-
55- auto conn = db.db ().connect ();
56- require_tables (conn);
57-
58- REQUIRE (0 == conn.get_count (" osm2pgsql_test_point" ));
59- REQUIRE (0 == conn.get_count (" osm2pgsql_test_line" ));
60- REQUIRE (1 == conn.get_count (" osm2pgsql_test_polygon" ));
61- }
62-
63- TEST_CASE (" route relation slim flatnode" )
64- {
65- options_t const options =
66- testing::opt_t ().slim ().flex (conf_file).flatnodes ();
67-
68- REQUIRE_NOTHROW (db.run_file (options, " test_output_pgsql_route_rel.osm" ));
69-
70- auto conn = db.db ().connect ();
71- require_tables (conn);
72-
73- REQUIRE (0 == conn.get_count (" osm2pgsql_test_point" ));
74- REQUIRE (1 == conn.get_count (" osm2pgsql_test_line" ));
75- REQUIRE (0 == conn.get_count (" osm2pgsql_test_polygon" ));
76- REQUIRE (1 == conn.get_count (" osm2pgsql_test_route" ));
77- }
78-
79- TEST_CASE (" liechtenstein slim bz2 parsing regression" )
80- {
81- options_t const options = testing::opt_t ().slim ().flex (conf_file);
82-
83- REQUIRE_NOTHROW (db.run_file (options, " liechtenstein-2013-08-03.osm.bz2" ));
84-
85- auto conn = db.db ().connect ();
86- require_tables (conn);
87-
88- REQUIRE (1362 == conn.get_count (" osm2pgsql_test_point" ));
89- REQUIRE (2932 == conn.get_count (" osm2pgsql_test_line" ));
90- REQUIRE (4136 == conn.get_count (" osm2pgsql_test_polygon" ));
91- REQUIRE (35 == conn.get_count (" osm2pgsql_test_route" ));
92- }
0 commit comments