]> granicus.if.org Git - postgis/commitdiff
Add some debugging info to find failure in debbie
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 24 Oct 2012 18:44:08 +0000 (18:44 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 24 Oct 2012 18:44:08 +0000 (18:44 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10544 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_geodetic.c

index 6a41858e5ef64e457740e2cdd278250b4d2f1851..23c7d86982434c427c6f4c27fa3357ec707d5706 100644 (file)
@@ -573,12 +573,14 @@ static void test_edge_intersects(void)
        line2pts("LINESTRING(-1.0 0.0, 1.0 0.0)", &A1, &A2);
        line2pts("LINESTRING(0.0 -1.0, 0.0 0.0)", &B1, &B2);
        rv = edge_intersects(&A1, &A2, &B1, &B2);
+       printf("\nEnd touches middle of segment: %d\n", rv);
        CU_ASSERT_EQUAL(rv, PIR_INTERSECTS|PIR_B_TOUCH_RIGHT);
 
        /*  End touches end of segment at (0 0) */
        line2pts("LINESTRING(0.0 0.0, 1.0 0.0)", &A1, &A2);
        line2pts("LINESTRING(0.0 -1.0, 0.0 0.0)", &B1, &B2);
        rv = edge_intersects(&A1, &A2, &B1, &B2);
+       printf("End touches end of segment: %d\n", rv);
        CU_ASSERT_EQUAL(rv, PIR_INTERSECTS|PIR_B_TOUCH_RIGHT|PIR_A_TOUCH_RIGHT);
 
        /* Intersection at (180 0) */
@@ -615,13 +617,14 @@ static void test_edge_intersects(void)
        line2pts("LINESTRING(-180.0 80.0, 0.0 80.0)", &A1, &A2);
        line2pts("LINESTRING(90.0 80.0, -90.0 90.0)", &B1, &B2);
        rv = edge_intersects(&A1, &A2, &B1, &B2);
+       printf("End touches arc at north pole: %d\n", rv);
        CU_ASSERT_EQUAL(rv, PIR_INTERSECTS|PIR_B_TOUCH_LEFT);
        
        /* End touches end at north pole */
        line2pts("LINESTRING(-180.0 80.0, 0.0 90.0)", &A1, &A2);
        line2pts("LINESTRING(90.0 80.0, -90.0 90.0)", &B1, &B2);
        rv = edge_intersects(&A1, &A2, &B1, &B2);
-       //printf("%d\n",rv);
+       printf("End touches end at north pole: %d\n", rv);
        CU_ASSERT_EQUAL(rv, PIR_INTERSECTS|PIR_B_TOUCH_LEFT|PIR_A_TOUCH_RIGHT);
 }
 
@@ -1190,7 +1193,7 @@ static void test_spheroid_area(void)
        lwgeom_calculate_gbox_geodetic(lwg, &gbox);
        a1 = lwgeom_area_sphere(lwg, &s);
        a2 = lwgeom_area_spheroid(lwg, &s);
-       printf("\nsphere: %.12g\nspheroid: %.12g\n", a1, a2);
+       //printf("\nsphere: %.12g\nspheroid: %.12g\n", a1, a2);
        CU_ASSERT_DOUBLE_EQUAL(a1, 89.7127703297, 0.1); /* sphere */
        CU_ASSERT_DOUBLE_EQUAL(a2, 89.8684316032, 0.1); /* spheroid */
        lwgeom_free(lwg);