Skip to content

Commit 832b576

Browse files
wip
1 parent b65d8f1 commit 832b576

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

unit_tests/library/extract.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "osrm/extractor_config.hpp"
66

77
#include <boost/algorithm/string.hpp>
8+
#include <oneapi/tbb/global_control.h>
9+
#include <oneapi/tbb/parallel_for.h>
810
#include <tbb/flow_graph.h>
911
#include <thread>
1012

@@ -32,29 +34,30 @@ BOOST_AUTO_TEST_SUITE(library_extract)
3234

3335
BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
3436
{
35-
tbb::flow::graph g;
37+
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
3638
osrm::ExtractorConfig config;
3739
config.requested_num_threads = std::thread::hardware_concurrency();
3840
BOOST_CHECK_THROW(osrm::extract(config),
3941
std::exception); // including osrm::util::exception, osmium::io_error, etc.
40-
g.wait_for_all();
42+
oneapi::tbb::finalize(handle);
4143
}
4244

4345
BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
4446
{
45-
tbb::flow::graph g;
47+
oneapi::tbb::task_scheduler_handle handle{tbb::attach{}};
4648
osrm::ExtractorConfig config;
4749
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
4850
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
4951
config.profile_path = OSRM_TEST_DATA_DIR "/../../profiles/car.lua";
5052
config.small_component_size = 1000;
5153
config.requested_num_threads = std::thread::hardware_concurrency();
5254
BOOST_CHECK_NO_THROW(osrm::extract(config));
53-
g.wait_for_all();
55+
oneapi::tbb::finalize(handle);
5456
}
5557

5658
BOOST_AUTO_TEST_CASE(test_setup_runtime_error)
5759
{
60+
5861
osrm::ExtractorConfig config;
5962
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
6063
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");

0 commit comments

Comments
 (0)