Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Nov 3, 2024
1 parent b65d8f1 commit 832b576
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions unit_tests/library/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "osrm/extractor_config.hpp"

#include <boost/algorithm/string.hpp>
#include <oneapi/tbb/global_control.h>
#include <oneapi/tbb/parallel_for.h>
#include <tbb/flow_graph.h>
#include <thread>

Expand Down Expand Up @@ -32,29 +34,30 @@ BOOST_AUTO_TEST_SUITE(library_extract)

BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
{
tbb::flow::graph g;
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
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.
g.wait_for_all();
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
{
tbb::flow::graph g;
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
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));
g.wait_for_all();
oneapi::tbb::finalize(handle);
}

BOOST_AUTO_TEST_CASE(test_setup_runtime_error)
{

osrm::ExtractorConfig config;
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
Expand Down

0 comments on commit 832b576

Please sign in to comment.