Enable all unit tests (#5248)
* Add missing profile name to library extract test. * Support both tzid and TZID properties on timezone geometry. Improve validation of timezone polygons. * Missing tzid property wasn't a geojson validation issue, shouldn't have been tested there. * Use filesystem glob to loop over all test executables so we don't miss any in the future. Co-authored-by: Michael Bell <michael@mjjbell.com>
This commit is contained in:
@@ -20,6 +20,8 @@ BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
|
||||
osrm::ExtractorConfig config;
|
||||
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
|
||||
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
|
||||
config.profile_path = OSRM_TEST_DATA_DIR "/../../profiles/car.lua";
|
||||
config.small_component_size = 1000;
|
||||
config.requested_num_threads = std::thread::hardware_concurrency();
|
||||
BOOST_CHECK_NO_THROW(osrm::extract(config));
|
||||
}
|
||||
|
||||
@@ -53,5 +53,19 @@ BOOST_AUTO_TEST_CASE(timezoner_test)
|
||||
"48.88277], [8.57757, 49.07206], [8.28369, "
|
||||
"49.07206], [8.28369, 48.88277]]] }} ]}";
|
||||
BOOST_CHECK_THROW(Timezoner tz(missing_featc, now), util::exception);
|
||||
|
||||
char missing_tzid[] = "{ \"type\" : \"Feature\","
|
||||
"\"properties\" : { }, \"geometry\" : { \"type\": \"polygon\", "
|
||||
"\"coordinates\": [[[8.28369,48.88277], [8.57757, "
|
||||
"48.88277], [8.57757, 49.07206], [8.28369, "
|
||||
"49.07206], [8.28369, 48.88277]]] }}";
|
||||
BOOST_CHECK_THROW(Timezoner tz(missing_tzid, now), util::exception);
|
||||
|
||||
char tzid_err[] = "{ \"type\" : \"Feature\","
|
||||
"\"properties\" : { \"TZID\" : []}, \"geometry\" : { \"type\": \"polygon\", "
|
||||
"\"coordinates\": [[[8.28369,48.88277], [8.57757, "
|
||||
"48.88277], [8.57757, 49.07206], [8.28369, "
|
||||
"49.07206], [8.28369, 48.88277]]] }}";
|
||||
BOOST_CHECK_THROW(Timezoner tz(tzid_err, now), util::exception);
|
||||
}
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
@@ -65,22 +65,6 @@ BOOST_AUTO_TEST_CASE(timezone_validation_test)
|
||||
doc.Parse(nonobj_props);
|
||||
BOOST_CHECK_THROW(util::validateFeature(doc), util::exception);
|
||||
|
||||
char missing_tzid[] = "{ \"type\" : \"Feature\","
|
||||
"\"properties\" : { }, \"geometry\" : { \"type\": \"polygon\", "
|
||||
"\"coordinates\": [[[8.28369,48.88277], [8.57757, "
|
||||
"48.88277], [8.57757, 49.07206], [8.28369, "
|
||||
"49.07206], [8.28369, 48.88277]]] }}";
|
||||
doc.Parse(missing_tzid);
|
||||
BOOST_CHECK_THROW(util::validateFeature(doc), util::exception);
|
||||
|
||||
char tzid_err[] = "{ \"type\" : \"Feature\","
|
||||
"\"properties\" : { \"TZID\" : []}, \"geometry\" : { \"type\": \"polygon\", "
|
||||
"\"coordinates\": [[[8.28369,48.88277], [8.57757, "
|
||||
"48.88277], [8.57757, 49.07206], [8.28369, "
|
||||
"49.07206], [8.28369, 48.88277]]] }}";
|
||||
doc.Parse(tzid_err);
|
||||
BOOST_CHECK_THROW(util::validateFeature(doc), util::exception);
|
||||
|
||||
char missing_geom[] = "{ \"type\" : \"Feature\","
|
||||
"\"properties\" : { \"TZID\" : \"Europe/Berlin\"}, \"geometries\" : { "
|
||||
"\"type\": \"polygon\", "
|
||||
|
||||
Reference in New Issue
Block a user