]> granicus.if.org Git - postgis/commitdiff
Fix #1080: cunit is crashing on test_ShpDumerDestroy().
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Fri, 1 Jul 2011 09:33:28 +0000 (09:33 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Fri, 1 Jul 2011 09:33:28 +0000 (09:33 +0000)
Looks like the original code omitted to set the default config values causing
the addition of a ShpDumperDestroy() call to fall over on some platforms due
to uninitialised pointers.

git-svn-id: http://svn.osgeo.org/postgis/trunk@7533 b70326c6-7e19-0410-871a-916f4a2858ee

loader/cunit/cu_pgsql2shp.c

index 261a8626cc137ce981b981670b535eeed897f246..3d0264e80700b6b2d92f40bfd07838916bdaffc5 100644 (file)
@@ -66,9 +66,10 @@ int clean_pgsql2shp_suite(void)
 void test_ShpDumperCreate(void)
 {      
        config = (SHPDUMPERCONFIG*)calloc(1, sizeof(SHPDUMPERCONFIG));
+       set_config_defaults(config);
        state = ShpDumperCreate(config);
        CU_ASSERT_PTR_NOT_NULL(state);
-       CU_ASSERT_EQUAL(state->outtype, 's');
+       CU_ASSERT_EQUAL(state->config->fetchsize, 100);
 }
 
 void test_ShpDumperDestroy(void)