Adapt get_osrm to EngineConfig changes

This commit is contained in:
Patrick Niklaus 2016-03-24 17:45:14 +01:00
parent d51eefa1c4
commit b65ba5c394
6 changed files with 20 additions and 17 deletions

View File

@ -9,9 +9,10 @@
// I couldn't get Boost.UnitTest to provide a test suite level fixture with custom // I couldn't get Boost.UnitTest to provide a test suite level fixture with custom
// arguments per test suite (osrm base path from argv), so this has to suffice. // arguments per test suite (osrm base path from argv), so this has to suffice.
inline osrm::OSRM get_osrm(const std::string &base_path) inline osrm::OSRM getOSRM(const std::string &base_path)
{ {
osrm::EngineConfig config{base_path}; osrm::EngineConfig config;
config.storage_config = {base_path};
config.use_shared_memory = false; config.use_shared_memory = false;
return osrm::OSRM{config}; return osrm::OSRM{config};

View File

@ -23,7 +23,8 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
using namespace osrm; using namespace osrm;
EngineConfig config{args[0]}; EngineConfig config;
config.storage_config = {args[0]};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_trip = 2; config.max_locations_trip = 2;
@ -52,7 +53,8 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
using namespace osrm; using namespace osrm;
EngineConfig config{args[0]}; EngineConfig config;
config.storage_config = {args[0]};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_viaroute = 2; config.max_locations_viaroute = 2;
@ -81,7 +83,8 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
using namespace osrm; using namespace osrm;
EngineConfig config{args[0]}; EngineConfig config;
config.storage_config = {args[0]};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_distance_table = 2; config.max_locations_distance_table = 2;
@ -110,7 +113,8 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
using namespace osrm; using namespace osrm;
EngineConfig config{args[0]}; EngineConfig config;
config.storage_config = {args[0]};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_map_matching = 2; config.max_locations_map_matching = 2;

View File

@ -2,6 +2,7 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include "args.hpp" #include "args.hpp"
#include "fixture.hpp"
#include "osrm/match_parameters.hpp" #include "osrm/match_parameters.hpp"
@ -20,10 +21,7 @@ BOOST_AUTO_TEST_CASE(test_match)
using namespace osrm; using namespace osrm;
EngineConfig config{args[0]}; auto osrm = getOSRM(args[0]);
config.use_shared_memory = false;
OSRM osrm{config};
/* /*
MatchParameters params; MatchParameters params;

View File

@ -18,7 +18,7 @@ BOOST_AUTO_TEST_SUITE(nearest)
BOOST_AUTO_TEST_CASE(test_nearest_response) BOOST_AUTO_TEST_CASE(test_nearest_response)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)
BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates) BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates) BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component) BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;

View File

@ -18,7 +18,7 @@ BOOST_AUTO_TEST_SUITE(route)
BOOST_AUTO_TEST_CASE(test_route_same_coordinates) BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component) BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;

View File

@ -17,7 +17,7 @@ BOOST_AUTO_TEST_SUITE(tile)
BOOST_AUTO_TEST_CASE(test_tile) BOOST_AUTO_TEST_CASE(test_tile)
{ {
const auto args = get_args(); const auto args = get_args();
auto osrm = get_osrm(args.at(0)); auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;