osrm-backend/unit_tests/library/extract.cpp
Daniel Patterson d5cd702242
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>
2021-10-22 22:10:25 +01:00

30 lines
960 B
C++

#include <boost/test/unit_test.hpp>
#include "osrm/extractor.hpp"
#include "osrm/extractor_config.hpp"
#include <thread>
BOOST_AUTO_TEST_SUITE(library_extract)
BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
{
osrm::ExtractorConfig config;
config.requested_num_threads = std::thread::hardware_concurrency();
BOOST_CHECK_THROW(osrm::extract(config),
std::exception); // including osrm::util::exception, osmium::io_error, etc.
}
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));
}
BOOST_AUTO_TEST_SUITE_END()