Skip to content

Commit

Permalink
make tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshkaj committed Sep 26, 2018
1 parent 75de003 commit 9ed768a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion include/partitioner/partitioner_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct PartitionerConfig final : storage::IOConfig
// Defaults to false. Setting to true will require more storage/memory,
// but avoids the need for path unpacking to learn the distance of a CH
// route (useful for faster distance results in table queries)
bool cache_distances;
// bool cache_distances;
};
} // namespace partitioner
} // namespace osrm
Expand Down
3 changes: 3 additions & 0 deletions profiles/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function setup()

-- classes to support for exclude flags
excludable = Sequence {
Set {'toll'},
Set {'motorway'},
Set {'ferry'}
},

avoid = Set {
Expand Down
5 changes: 3 additions & 2 deletions src/engine/routing_algorithms/many_to_many_mld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
const std::vector<PhantomNode> &phantom_nodes,
const std::vector<std::size_t> &source_indices,
const std::vector<std::size_t> &target_indices,
const bool calculate_distance)
const bool /*calculate_distance*/)
{
const auto number_of_sources = source_indices.size();
const auto number_of_targets = target_indices.size();
Expand Down Expand Up @@ -900,7 +900,8 @@ manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
source_phantom);
}

if (calculate_distance)
// if (calculate_distance)
if (false)
{
distances_table.resize(number_of_entries, INVALID_EDGE_DISTANCE);
calculateDistances<DIRECTION>(query_heap,
Expand Down
72 changes: 36 additions & 36 deletions test/nodejs/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ test('route: routes Monaco', function(assert) {
});
});

// test('route: routes Monaco on MLD', function(assert) {
// assert.plan(5);
// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
// osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) {
// assert.ifError(err);
// assert.ok(route.waypoints);
// assert.ok(route.routes);
// assert.ok(route.routes.length);
// assert.ok(route.routes[0].geometry);
// });
// });
test('route: routes Monaco on MLD', function(assert) {
assert.plan(5);
var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) {
assert.ifError(err);
assert.ok(route.waypoints);
assert.ok(route.routes);
assert.ok(route.routes.length);
assert.ok(route.routes[0].geometry);
});
});

test('route: routes Monaco on CoreCH', function(assert) {
assert.plan(5);
Expand Down Expand Up @@ -566,31 +566,31 @@ test('route: throws on bad approaches', function(assert) {
/Approach must be a string: \[curb, unrestricted\] or null/);
});

// test('route: routes Monaco with custom limits on MLD', function(assert) {
// assert.plan(2);
// var osrm = new OSRM({
// path: monaco_mld_path,
// algorithm: 'MLD',
// max_alternatives: 10,
// });
// osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) {
// assert.ifError(err);
// assert.ok(Array.isArray(route.routes));
// });
// });

// test('route: in Monaco with custom limits on MLD', function(assert) {
// assert.plan(1);
// var osrm = new OSRM({
// path: monaco_mld_path,
// algorithm: 'MLD',
// max_alternatives: 10,
// });
// osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) {
// console.log(err)
// assert.equal(err.message, 'TooBig');
// });
// });
test('route: routes Monaco with custom limits on MLD', function(assert) {
assert.plan(2);
var osrm = new OSRM({
path: monaco_mld_path,
algorithm: 'MLD',
max_alternatives: 10,
});
osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) {
assert.ifError(err);
assert.ok(Array.isArray(route.routes));
});
});

test('route: in Monaco with custom limits on MLD', function(assert) {
assert.plan(1);
var osrm = new OSRM({
path: monaco_mld_path,
algorithm: 'MLD',
max_alternatives: 10,
});
osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) {
console.log(err)
assert.equal(err.message, 'TooBig');
});
});

test('route: route in Monaco without motorways', function(assert) {
assert.plan(3);
Expand Down

0 comments on commit 9ed768a

Please sign in to comment.