From 299135153e33869157ecd432dd0194743e959170 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Fri, 13 Apr 2018 22:42:54 +0200 Subject: Fix segfault in deformation When transforming coordinates outside the grid model the deformation operation failed spectatularly. This is now fixed by checking that the coordinate is inside the grid. If it isn't an error is returned and a debugging log message is issued. Closes #934 --- test/gie/deformation.gie | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/gie/deformation.gie b/test/gie/deformation.gie index 55283b84..b6ca3e0f 100644 --- a/test/gie/deformation.gie +++ b/test/gie/deformation.gie @@ -23,6 +23,14 @@ accept -3004295.5882503074 -1093474.1690603832 5500477.1338251457 expect -3004295.7025 -1093474.2106 5500477.3444 roundtrip 5 +# Test that errors are reported for coordinates outside the grid. +# Here we test 120W 40N which is well outside the alaska grid. +accept -2446353.8001 -4237209.0750 4077985.572 +expect failure errno grid_area +accept -2446353.8001 -4237209.0750 4077985.572 2000 +expect failure errno grid_area + + ------------------------------------------------------------------------------- Test using both horizontal and vertical grids ------------------------------------------------------------------------------- -- cgit v1.2.3