]> granicus.if.org Git - postgis/commitdiff
Fix 'defined but not used' and other warnings in unit tests
authorSandro Santilli <strk@keybit.net>
Fri, 5 Sep 2014 15:01:08 +0000 (15:01 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 5 Sep 2014 15:01:08 +0000 (15:01 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12948 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_in_geojson.c
liblwgeom/cunit/cu_out_encoded_polyline.c
liblwgeom/cunit/cu_out_gml.c
liblwgeom/cunit/cu_surface.c

index cef7bae8113ac4ea4285b3c9f82435d30b56da14..d37137bc235fd74a1582c799423034419d50170e 100644 (file)
@@ -31,7 +31,7 @@ static void do_geojson_test(const char * exp, char * in, char * exp_srs, int pre
        g = lwgeom_from_geojson(in, &srs);
   if ( ! g ) {
                fprintf(stderr, "\nIn:   %s\nExp:  %s\nObt: %s\n", in, exp, cu_error_msg);
-         CU_ASSERT(g);
+         CU_ASSERT(g != NULL);
     return;
   }
 
@@ -61,36 +61,6 @@ static void do_geojson_test(const char * exp, char * in, char * exp_srs, int pre
   if ( srs ) lwfree(srs);
 }
 
-
-static void do_geojson_unsupported(char * in, char * exp)
-{
-       LWGEOM *g;
-       char * h = NULL;
-  char * srs = NULL;
-  size_t size;
-
-       g = lwgeom_from_geojson(in, &srs);
-
-  if ( g ) {
-         h = lwgeom_to_wkt(g, WKT_ISO, 1, &size);
-    fprintf(stderr, "\nIn:   %s\nExp:  %s\nObt: %s\n",
-              in, exp, h);
-    CU_ASSERT(!g);
-  } else {
-
-    if (strcmp(cu_error_msg, exp))
-      fprintf(stderr, "\nIn:   %s\nExp:  %s\nObt: %s\n",
-              in, exp, cu_error_msg);
-    CU_ASSERT_STRING_EQUAL(in, cu_error_msg);
-  }
-
-  cu_error_msg_reset();
-
-  if ( srs ) lwfree(srs);
-  if ( h ) lwfree(h);
-       lwgeom_free(g);
-}
-
 static void in_geojson_test_srid(void)
 {
        /* Linestring */
index 7c190d2542b6efc4e63d26c71be67c9542fd05da..7f0a710776f53526b6650ab698c02713784dfc8b 100644 (file)
@@ -37,25 +37,6 @@ static void do_encoded_polyline_test(char * in, int precision, char * out)
 }
 
 
-static void do_encoded_polyline_unsupported(char * in, int precision, char * out)
-{
-       LWGEOM *g;
-       char *h;
-
-       g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE);
-       h = lwgeom_to_encoded_polyline(g, precision);
-
-       if (strcmp(cu_error_msg, out))
-               fprintf(stderr, "\nIn:   %s\nOut:  %s\nTheo: %s\n",
-                       in, cu_error_msg, out);
-
-       CU_ASSERT_STRING_EQUAL(out, cu_error_msg);
-       cu_error_msg_reset();
-
-       lwfree(h);
-       lwgeom_free(g);
-}
-
 static void out_encoded_polyline_test_geoms(void)
 {
        /* Linestring */
index 76e0d19cdb32702a79540093fbcedab579842161..547532389982d9d31a9e8f2e3681c962d0969874 100644 (file)
@@ -148,26 +148,6 @@ static void do_gml2_unsupported(char * in, char * out)
        lwgeom_free(g);
 }
 
-static void do_gml3_unsupported(char * in, char * out)
-{
-       LWGEOM *g;
-       char *h;
-       int opts = LW_GML_IS_DIMS;
-
-       g = lwgeom_from_wkt(in, LW_PARSER_CHECK_NONE);
-       h = lwgeom_to_gml3(g, NULL, 0, opts, "", NULL);
-
-       if (strcmp(cu_error_msg, out))
-               fprintf(stderr, "\nGML 3 - In:   %s\nOut:  %s\nTheo: %s\n",
-                       in, cu_error_msg, out);
-
-       CU_ASSERT_STRING_EQUAL(out, cu_error_msg);
-       cu_error_msg_reset();
-
-       lwfree(h);
-       lwgeom_free(g);
-}
-
 static void do_gml2_extent_test(char * in, char * out, char * srs,
                                    double precision, char * prefix)
 {
index 9a0462c2be4836264737b0b3cac4730d6bd09085..c9badf7f143e0870798c6a11599a606d5d67e87a 100644 (file)
@@ -12,8 +12,6 @@
 
 #include "cu_surface.h"
 
-static void check_tgeom(char *ewkt, int type, uint32_t srid, int is_solid);
-
 void triangle_parse(void)
 {
        LWGEOM *geom;
@@ -313,8 +311,8 @@ void polyhedralsurface_parse(void)
        geom = lwgeom_from_wkt("POLYHEDRALSURFACE EMPTY", LW_PARSER_CHECK_NONE);
        CU_ASSERT_EQUAL(strlen(cu_error_msg), 0);
        CU_ASSERT_EQUAL(geom->type, POLYHEDRALSURFACETYPE);
-       tmp = lwgeom_to_wkb(geom, WKB_HEX | WKB_ISO | WKB_NDR, 0);
-       CU_ASSERT_STRING_EQUAL("010F00000000000000", (char*)tmp);
+       tmp = (char *)lwgeom_to_wkb(geom, WKB_HEX | WKB_ISO | WKB_NDR, 0);
+       CU_ASSERT_STRING_EQUAL("010F00000000000000", tmp);
        lwfree(tmp);
        tmp = lwgeom_to_ewkt(geom);
        CU_ASSERT_STRING_EQUAL("POLYHEDRALSURFACE EMPTY", tmp);