fix tests to reflect proper rounding of travel times
This commit is contained in:
parent
2ec952032a
commit
ca6515c58a
@ -18,7 +18,7 @@ When a max speed is set, osrm will use 2/3 of that as the actual speed.
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab | 85 km/h |
|
| a | b | ab | 85 km/h |
|
||||||
| b | c | bc | 40 km/h |
|
| b | c | bc | 39 km/h |
|
||||||
|
|
||||||
Scenario: Car - Do not ignore maxspeed when higher than way speed
|
Scenario: Car - Do not ignore maxspeed when higher than way speed
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -32,7 +32,7 @@ When a max speed is set, osrm will use 2/3 of that as the actual speed.
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed |
|
| from | to | route | speed |
|
||||||
| a | b | ab | 25 km/h |
|
| a | b | ab | 25 km/h |
|
||||||
| b | c | bc | 60 km/h |
|
| b | c | bc | 59 km/h |
|
||||||
|
|
||||||
Scenario: Car - Forward/backward maxspeed
|
Scenario: Car - Forward/backward maxspeed
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
@ -43,8 +43,8 @@ When a max speed is set, osrm will use 2/3 of that as the actual speed.
|
|||||||
| primary | 60 | | | 40 km/h | 40 km/h |
|
| primary | 60 | | | 40 km/h | 40 km/h |
|
||||||
| primary | | 60 | | 40 km/h | 65 km/h |
|
| primary | | 60 | | 40 km/h | 65 km/h |
|
||||||
| primary | | | 60 | 65 km/h | 40 km/h |
|
| primary | | | 60 | 65 km/h | 40 km/h |
|
||||||
| primary | 15 | 60 | | 40 km/h | 10 km/h |
|
| primary | 15 | 60 | | 40 km/h | 9 km/h |
|
||||||
| primary | 15 | | 60 | 10 km/h | 40 km/h |
|
| primary | 15 | | 60 | 9 km/h | 40 km/h |
|
||||||
| primary | 15 | 30 | 60 | 20 km/h | 40 km/h |
|
| primary | 15 | 30 | 60 | 20 km/h | 40 km/h |
|
||||||
|
|
||||||
Scenario: Car - Maxspeed should not allow routing on unroutable ways
|
Scenario: Car - Maxspeed should not allow routing on unroutable ways
|
||||||
@ -62,4 +62,4 @@ When a max speed is set, osrm will use 2/3 of that as the actual speed.
|
|||||||
| runway | | | | | | |
|
| runway | | | | | | |
|
||||||
| runway | | | 100 | | | |
|
| runway | | | 100 | | | |
|
||||||
| runway | | | | 100 | | |
|
| runway | | | | 100 | | |
|
||||||
| runway | | | | | 100 | |
|
| runway | | | | | 100 | |
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
@routing @car @speed
|
@routing @car @speed
|
||||||
Feature: Car - speeds
|
Feature: Car - speeds
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the profile "car"
|
Given the profile "car"
|
||||||
And a grid size of 1000 meters
|
And a grid size of 1000 meters
|
||||||
|
|
||||||
Scenario: Car - speed of various way types
|
Scenario: Car - speed of various way types
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | oneway | bothw |
|
| highway | oneway | bothw |
|
||||||
| motorway | no | 90 km/h |
|
| motorway | no | 90 km/h |
|
||||||
| motorway_link | no | 75 km/h |
|
| motorway_link | no | 75 km/h |
|
||||||
| trunk | no | 85 km/h |
|
| trunk | no | 84 km/h |
|
||||||
| trunk_link | no | 70 km/h |
|
| trunk_link | no | 69 km/h |
|
||||||
| primary | no | 65 km/h |
|
| primary | no | 64 km/h |
|
||||||
| primary_link | no | 60 km/h |
|
| primary_link | no | 60 km/h |
|
||||||
| secondary | no | 55 km/h |
|
| secondary | no | 54 km/h |
|
||||||
| secondary_link | no | 50 km/h |
|
| secondary_link | no | 50 km/h |
|
||||||
| tertiary | no | 40 km/h |
|
| tertiary | no | 40 km/h |
|
||||||
| tertiary_link | no | 30 km/h |
|
| tertiary_link | no | 30 km/h |
|
||||||
|
@ -11,7 +11,7 @@ def test_routability_row i
|
|||||||
r[:status] = route_status r[:response]
|
r[:status] = route_status r[:response]
|
||||||
if r[:status].empty? == false
|
if r[:status].empty? == false
|
||||||
r[:route] = way_list r[:json]['route_instructions']
|
r[:route] = way_list r[:json]['route_instructions']
|
||||||
|
|
||||||
if r[:route]=="w#{i}"
|
if r[:route]=="w#{i}"
|
||||||
r[:time] = r[:json]['route_summary']['total_time']
|
r[:time] = r[:json]['route_summary']['total_time']
|
||||||
r[:distance] = r[:json]['route_summary']['total_distance']
|
r[:distance] = r[:json]['route_summary']['total_distance']
|
||||||
@ -24,7 +24,7 @@ def test_routability_row i
|
|||||||
end
|
end
|
||||||
result[direction] = r
|
result[direction] = r
|
||||||
end
|
end
|
||||||
|
|
||||||
# check if forw and backw returned the same values
|
# check if forw and backw returned the same values
|
||||||
result['bothw'] = {}
|
result['bothw'] = {}
|
||||||
[:status,:time,:distance,:speed].each do |key|
|
[:status,:time,:distance,:speed].each do |key|
|
||||||
@ -62,12 +62,12 @@ Then /^routability should be$/ do |table|
|
|||||||
else
|
else
|
||||||
raise "*** Unknown expectation format: #{want}"
|
raise "*** Unknown expectation format: #{want}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if FuzzyMatch.match output_row[direction], want
|
if FuzzyMatch.match output_row[direction], want
|
||||||
output_row[direction] = row[direction]
|
output_row[direction] = row[direction]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_row != row
|
if output_row != row
|
||||||
log_fail row,output_row,result
|
log_fail row,output_row,result
|
||||||
end
|
end
|
||||||
|
@ -15,4 +15,4 @@ Feature: Separate settings for forward/backward direction
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | distance | speed |
|
| from | to | route | distance | speed |
|
||||||
| a | d | abcd | 300 +- 1m | 36 km/h |
|
| a | d | abcd | 300 +- 1m | 36 km/h |
|
||||||
| d | a | abcd | 300 +- 1m | 16 km/h |
|
| d | a | abcd | 300 +- 1m | 15 km/h |
|
||||||
|
@ -28,4 +28,4 @@ Feature: Testbot - speeds
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | speed | time | distance |
|
| from | to | route | speed | time | distance |
|
||||||
| a | b | ab | 36 km/h | 10s | 100m |
|
| a | b | ab | 36 km/h | 10s | 100m |
|
||||||
| b | a | ab | 16 km/h | 22s | 100m |
|
| b | a | ab | 15 km/h | 23s | 100m |
|
||||||
|
Loading…
Reference in New Issue
Block a user