55
66static testing::db::import_t db;
77
8- TEST_CASE (" default projection" )
8+ static char const *const conf_file = " test_output_flex_area.lua" ;
9+ static char const *const data_file = " test_output_pgsql_area.osm" ;
10+
11+ TEST_CASE (" area calculation in default projection" )
912{
10- options_t const options =
11- testing::opt_t ().slim ().flex (" test_output_flex.lua" );
13+ options_t const options = testing::opt_t ().flex (conf_file);
1214
13- REQUIRE_NOTHROW (db.run_file (options, " test_output_pgsql_area.osm " ));
15+ REQUIRE_NOTHROW (db.run_file (options, data_file ));
1416
1517 auto conn = db.db ().connect ();
1618
@@ -23,29 +25,28 @@ TEST_CASE("default projection")
2325 " SELECT area FROM osm2pgsql_test_polygon WHERE name='multi'" );
2426}
2527
26- TEST_CASE (" latlon projection" )
28+ TEST_CASE (" area calculation in latlon projection" )
2729{
2830 options_t const options =
29- testing::opt_t ().slim (). flex (" test_output_flex.lua " ).srs (PROJ_LATLONG);
31+ testing::opt_t ().flex (conf_file ).srs (PROJ_LATLONG);
3032
31- REQUIRE_NOTHROW (db.run_file (options, " test_output_pgsql_area.osm " ));
33+ REQUIRE_NOTHROW (db.run_file (options, data_file ));
3234
3335 auto conn = db.db ().connect ();
3436
3537 REQUIRE (2 == conn.get_count (" osm2pgsql_test_polygon" ));
3638 conn.assert_double (
37- 1 , " SELECT area FROM osm2pgsql_test_polygon WHERE name='poly'" );
39+ 1.0 , " SELECT area FROM osm2pgsql_test_polygon WHERE name='poly'" );
3840 conn.assert_double (
39- 8 , " SELECT area FROM osm2pgsql_test_polygon WHERE name='multi'" );
41+ 8.0 , " SELECT area FROM osm2pgsql_test_polygon WHERE name='multi'" );
4042}
4143
42- TEST_CASE (" latlon projection with way area reprojection" )
44+ TEST_CASE (" area calculation in latlon projection with way area reprojection" )
4345{
44- options_t options =
45- testing::opt_t ().slim ().flex (" test_output_flex.lua" ).srs (PROJ_LATLONG);
46+ options_t options = testing::opt_t ().flex (conf_file).srs (PROJ_LATLONG);
4647 options.reproject_area = true ;
4748
48- REQUIRE_NOTHROW (db.run_file (options, " test_output_pgsql_area.osm " ));
49+ REQUIRE_NOTHROW (db.run_file (options, data_file ));
4950
5051 auto conn = db.db ().connect ();
5152
0 commit comments