From 85369d63108f3dea0abd9a017ec7760032ee59a9 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Thu, 27 Sep 2012 14:19:06 +0200 Subject: [PATCH 1/2] test for nodes too close to the poles --- features/bad.feature | 33 +++++++++++++++++++ features/bug.feature | 65 -------------------------------------- features/planetary.feature | 2 +- 3 files changed, 34 insertions(+), 66 deletions(-) delete mode 100644 features/bug.feature diff --git a/features/bad.feature b/features/bad.feature index 72b6bd8e3..e43d77550 100644 --- a/features/bad.feature +++ b/features/bad.feature @@ -53,3 +53,36 @@ Feature: Handle bad data in a graceful manner | 3 | 1 | | | 3 | 2 | | + @poles + Scenario: No routing close to the north/south pole + Mercator is undefined close to the poles. + All nodes and request with lat to close to the pole should therfore be ignored. + + Given the node locations + | node | lat | lon | + | a | 89 | 0 | + | b | 87 | 0 | + | c | 82 | 0 | + | d | 80 | 0 | + | l | -80 | 0 | + | m | -82 | 0 | + | n | -87 | 0 | + | o | -89 | 0 | + + And the ways + | nodes | + | ab | + | bc | + | mn | + | no | + + When I route I should get + | from | to | route | + | a | b | | + | b | c | | + | a | d | | + | c | d | cd | + | l | m | cd | + | o | l | | + | n | m | | + | o | n | | \ No newline at end of file diff --git a/features/bug.feature b/features/bug.feature deleted file mode 100644 index 242b0246c..000000000 --- a/features/bug.feature +++ /dev/null @@ -1,65 +0,0 @@ -@bug -Feature: Things that causes crashes or hangs - - @nohang - Scenario: OK - #this works as expected - Given the node map - | a | | - | b | c | - - And the ways - | nodes | - | ab | - | cb | - - When I route I should get - | from | to | route | - | c | b | cb | - - @hang - Scenario: Routed hangs on simple ways - #this causes osrm-routed to hang (at least on mac 10.8) - #note that this is very similar to the example above, except that the node map is mirrored - Given the node map - | | a | - | c | b | - - And the ways - | nodes | - | ab | - | cb | - - When I route I should get - | from | to | route | - | c | b | cb | - - @crash - Scenario: Quarter way around the equator - Given the node locations - | node | lat | lon | - | a | 0 | 0 | - | b | 0 | 90 | - - And the ways - | nodes | - | ab | - - When I route I should get - | from | to | route | - | a | b | ab | - - @crash - Scenario: From the equator to the north pole - Given the node locations - | node | lat | lon | - | a | 0 | 0 | - | b | 90 | 0 | - - And the ways - | nodes | - | ab | - - When I route I should get - | from | to | route | - | a | b | ab | diff --git a/features/planetary.feature b/features/planetary.feature index 5dd0c9ebb..adbcec433 100644 --- a/features/planetary.feature +++ b/features/planetary.feature @@ -84,4 +84,4 @@ Feature: Distance calculation When I route I should get | from | to | route | distance | - | a | b | ab | 8905559 ~0.1% | \ No newline at end of file + | a | b | ab | 8905559 ~0.1% | \ No newline at end of file From c4326ffd0bb3a0f22e0f81bb40af196436509059 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Thu, 27 Sep 2012 14:48:29 +0200 Subject: [PATCH 2/2] adding nodes to make tests work --- features/bad.feature | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/features/bad.feature b/features/bad.feature index e43d77550..14f707d22 100644 --- a/features/bad.feature +++ b/features/bad.feature @@ -56,7 +56,7 @@ Feature: Handle bad data in a graceful manner @poles Scenario: No routing close to the north/south pole Mercator is undefined close to the poles. - All nodes and request with lat to close to the pole should therfore be ignored. + All nodes and request with latitude to close to either of the poles should therefore be ignored. Given the node locations | node | lat | lon | @@ -64,6 +64,8 @@ Feature: Handle bad data in a graceful manner | b | 87 | 0 | | c | 82 | 0 | | d | 80 | 0 | + | e | 78 | 0 | + | k | -78 | 0 | | l | -80 | 0 | | m | -82 | 0 | | n | -87 | 0 | @@ -73,6 +75,10 @@ Feature: Handle bad data in a graceful manner | nodes | | ab | | bc | + | cd | + | de | + | kl | + | lm | | mn | | no | @@ -82,7 +88,7 @@ Feature: Handle bad data in a graceful manner | b | c | | | a | d | | | c | d | cd | - | l | m | cd | + | l | m | lm | | o | l | | | n | m | | - | o | n | | \ No newline at end of file + | o | n | |