]> granicus.if.org Git - postgis/commitdiff
Test that mixed dimensionality is not allowed by ptarray_append_ptarray
authorSandro Santilli <strk@keybit.net>
Thu, 26 Jan 2012 12:59:43 +0000 (12:59 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 26 Jan 2012 12:59:43 +0000 (12:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8928 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_ptarray.c

index 50e518b0abfe77edd1a47ebf03ae4c4c85950b7e..26e9bf604ca47e6755953d64b7bc7a2c1f73552b 100644 (file)
@@ -137,6 +137,14 @@ static void test_ptarray_append_ptarray(void)
        lwline_free(line2);
        lwline_free(line1);
 
+       /* Mixed dimensionality is not allowed */
+       line1 = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(0 10 0, 10 0 0)"));
+       line2 = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(10 0,11 0)"));
+       ret = ptarray_append_ptarray(line1->points, line2->points, -1);
+       CU_ASSERT(ret == LW_FAILURE);
+       lwline_free(line2);
+       lwline_free(line1);
+
 }
 
 static void test_ptarray_locate_point(void)