]> granicus.if.org Git - postgis/commitdiff
#3041, Cunit 2.1-3 breaks testing
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 18 Feb 2015 21:58:15 +0000 (21:58 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 18 Feb 2015 21:58:15 +0000 (21:58 +0000)
This fix is for the liblwgeom cu_tester only, the raster and other
testers remain to be fixed

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

32 files changed:
liblwgeom/cunit/cu_algorithm.c
liblwgeom/cunit/cu_buildarea.c
liblwgeom/cunit/cu_clean.c
liblwgeom/cunit/cu_clip_by_rect.c
liblwgeom/cunit/cu_force_sfs.c
liblwgeom/cunit/cu_geodetic.c
liblwgeom/cunit/cu_geos.c
liblwgeom/cunit/cu_homogenize.c
liblwgeom/cunit/cu_in_encoded_polyline.c
liblwgeom/cunit/cu_in_geojson.c
liblwgeom/cunit/cu_in_twkb.c
liblwgeom/cunit/cu_libgeom.c
liblwgeom/cunit/cu_measures.c
liblwgeom/cunit/cu_misc.c
liblwgeom/cunit/cu_node.c
liblwgeom/cunit/cu_out_encoded_polyline.c
liblwgeom/cunit/cu_out_geojson.c
liblwgeom/cunit/cu_out_gml.c
liblwgeom/cunit/cu_out_kml.c
liblwgeom/cunit/cu_out_svg.c
liblwgeom/cunit/cu_out_twkb.c
liblwgeom/cunit/cu_out_x3d.c
liblwgeom/cunit/cu_print.c
liblwgeom/cunit/cu_ptarray.c
liblwgeom/cunit/cu_sfcgal.c
liblwgeom/cunit/cu_split.c
liblwgeom/cunit/cu_stringbuffer.c
liblwgeom/cunit/cu_tester.c
liblwgeom/cunit/cu_tester.h
liblwgeom/cunit/cu_tree.c
liblwgeom/cunit/cu_triangulate.c
liblwgeom/cunit/cu_varint.c

index 3d28b1d249331e5f1c018885e4ef5cb176380d90..5a58261b55ebf99016772722f6f5b7903af39ff8 100644 (file)
@@ -903,24 +903,24 @@ static void test_geohash_point_as_int(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo algorithms_tests[] =
+void algorithms_suite_setup(void);
+void algorithms_suite_setup(void)
 {
-       PG_TEST(test_lw_segment_side),
-       PG_TEST(test_lw_segment_intersects),
-       PG_TEST(test_lwline_crossing_short_lines),
-       PG_TEST(test_lwline_crossing_long_lines),
-       PG_TEST(test_lwline_crossing_bugs),
-       PG_TEST(test_lwpoint_set_ordinate),
-       PG_TEST(test_lwpoint_get_ordinate),
-       PG_TEST(test_point_interpolate),
-       PG_TEST(test_lwline_clip),
-       PG_TEST(test_lwline_clip_big),
-       PG_TEST(test_lwmline_clip),
-       PG_TEST(test_geohash_point),
-       PG_TEST(test_geohash_precision),
-       PG_TEST(test_geohash),
-       PG_TEST(test_geohash_point_as_int),
-       PG_TEST(test_isclosed),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo algorithms_suite = {"PostGIS Computational Geometry Suite",  init_cg_suite,  clean_cg_suite, algorithms_tests};
+       CU_pSuite suite = CU_add_suite("PostGIS Computational Geometry Suite", init_cg_suite, clean_cg_suite);
+       PG_ADD_TEST(suite,test_lw_segment_side);
+       PG_ADD_TEST(suite,test_lw_segment_intersects);
+       PG_ADD_TEST(suite,test_lwline_crossing_short_lines);
+       PG_ADD_TEST(suite,test_lwline_crossing_long_lines);
+       PG_ADD_TEST(suite,test_lwline_crossing_bugs);
+       PG_ADD_TEST(suite,test_lwpoint_set_ordinate);
+       PG_ADD_TEST(suite,test_lwpoint_get_ordinate);
+       PG_ADD_TEST(suite,test_point_interpolate);
+       PG_ADD_TEST(suite,test_lwline_clip);
+       PG_ADD_TEST(suite,test_lwline_clip_big);
+       PG_ADD_TEST(suite,test_lwmline_clip);
+       PG_ADD_TEST(suite,test_geohash_point);
+       PG_ADD_TEST(suite,test_geohash_precision);
+       PG_ADD_TEST(suite,test_geohash);
+       PG_ADD_TEST(suite,test_geohash_point_as_int);
+       PG_ADD_TEST(suite,test_isclosed);
+}
index 7c618f440b8b6d06d26a9aad12f6f3debd70b28a..c3560dd7c8b5d4990bd50de52a6d048c0b11b36d 100644 (file)
@@ -323,19 +323,16 @@ static void buildarea7(void)
 }
 
 
-/*
-** Used by test harness to register the tests in this file.
-*/
-static CU_TestInfo buildarea_tests[] =
+void buildarea_suite_setup(void);
+void buildarea_suite_setup(void)
 {
-       PG_TEST(buildarea1),
-       PG_TEST(buildarea2),
-       PG_TEST(buildarea3),
-       PG_TEST(buildarea4),
-       PG_TEST(buildarea4b),
-       PG_TEST(buildarea5),
-       PG_TEST(buildarea6),
-       PG_TEST(buildarea7),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo buildarea_suite = {"buildarea",  NULL,  NULL, buildarea_tests};
+       CU_pSuite suite = CU_add_suite("buildarea", NULL, NULL);
+       PG_ADD_TEST(suite,buildarea1);
+       PG_ADD_TEST(suite,buildarea2);
+       PG_ADD_TEST(suite,buildarea3);
+       PG_ADD_TEST(suite,buildarea4);
+       PG_ADD_TEST(suite,buildarea4b);
+       PG_ADD_TEST(suite,buildarea5);
+       PG_ADD_TEST(suite,buildarea6);
+       PG_ADD_TEST(suite,buildarea7);
+}
index 439183c23261fa632bed32f731084efbda9ee122..350175236e396a9259faec47f0af0238ec018522 100644 (file)
@@ -139,9 +139,9 @@ static void test_lwgeom_make_valid(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-static CU_TestInfo clean_tests[] =
+void clean_suite_setup(void);
+void clean_suite_setup(void)
 {
-       PG_TEST(test_lwgeom_make_valid),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo clean_suite = {"clean",  NULL,  NULL, clean_tests};
+       CU_pSuite suite = CU_add_suite("clean", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwgeom_make_valid);
+}
index e962e32537a20df70a73a31e6f37698b817d537e..65ac141e5944f3c04d253c64d140eec69e220b44 100644 (file)
@@ -56,9 +56,9 @@ static void test_lwgeom_clip_by_rect(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo clip_by_rect_tests[] =
+void clip_by_rect_suite_setup(void);
+void clip_by_rect_suite_setup(void)
 {
-       PG_TEST(test_lwgeom_clip_by_rect),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo clip_by_rect_suite = {"clip_by_rect",  NULL,  NULL, clip_by_rect_tests};
+       CU_pSuite suite = CU_add_suite("clip_by_rect", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwgeom_clip_by_rect);
+}
index 4815d0992355e7c8f34743b758bb1e83adc9f815..b71f6890aa91346101cbc89de500cfcccc5c76a8 100644 (file)
@@ -164,11 +164,11 @@ static void test_sfs_11(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo force_sfs_tests[] =
+void force_sfs_suite_setup(void);
+void force_sfs_suite_setup(void)
 {
-       PG_TEST(test_sfs_11),
-       PG_TEST(test_sfs_12),
-       PG_TEST(test_sqlmm),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo force_sfs_suite = {"force_sfs",  NULL,  NULL, force_sfs_tests};
+       CU_pSuite suite = CU_add_suite("force_sfs", NULL, NULL);
+       PG_ADD_TEST(suite, test_sfs_11);
+       PG_ADD_TEST(suite, test_sfs_12);
+       PG_ADD_TEST(suite, test_sqlmm);
+}
index ac54d38170170c5a47b93e6570b27e1fa1ca630c..ef657b94edbfe4c5973fca5b59224a92e8cdee5b 100644 (file)
@@ -1484,31 +1484,31 @@ static void test_lwgeom_area_sphere(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo geodetic_tests[] =
+void geodetic_suite_setup(void);
+void geodetic_suite_setup(void)
 {
-       PG_TEST(test_sphere_direction),
-       PG_TEST(test_sphere_project),
-       PG_TEST(test_lwgeom_area_sphere),
-       PG_TEST(test_signum),
-       PG_TEST(test_gbox_from_spherical_coordinates),
-       PG_TEST(test_gserialized_get_gbox_geocentric),
-       PG_TEST(test_clairaut),
-       PG_TEST(test_edge_intersection),
-       PG_TEST(test_edge_intersects),
-       PG_TEST(test_edge_distance_to_point),
-       PG_TEST(test_edge_distance_to_edge),
-       PG_TEST(test_lwgeom_distance_sphere),
-       PG_TEST(test_lwgeom_check_geodetic),
-       PG_TEST(test_gserialized_from_lwgeom),
-       PG_TEST(test_spheroid_distance),
-       PG_TEST(test_spheroid_area),
-       PG_TEST(test_lwpoly_covers_point2d),
-       PG_TEST(test_gbox_utils),
-       PG_TEST(test_vector_angle),
-       PG_TEST(test_vector_rotate),
-       PG_TEST(test_lwgeom_segmentize_sphere),
-       PG_TEST(test_ptarray_contains_point_sphere),
-       PG_TEST(test_ptarray_contains_point_sphere_iowa),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo geodetic_suite = {"Geodetic Suite",  NULL,  NULL, geodetic_tests};
+       CU_pSuite suite = CU_add_suite("Geodetic Suite", NULL, NULL);
+       PG_ADD_TEST(suite, test_sphere_direction);
+       PG_ADD_TEST(suite, test_sphere_project);
+       PG_ADD_TEST(suite, test_lwgeom_area_sphere);
+       PG_ADD_TEST(suite, test_signum);
+       PG_ADD_TEST(suite, test_gbox_from_spherical_coordinates);
+       PG_ADD_TEST(suite, test_gserialized_get_gbox_geocentric);
+       PG_ADD_TEST(suite, test_clairaut);
+       PG_ADD_TEST(suite, test_edge_intersection);
+       PG_ADD_TEST(suite, test_edge_intersects);
+       PG_ADD_TEST(suite, test_edge_distance_to_point);
+       PG_ADD_TEST(suite, test_edge_distance_to_edge);
+       PG_ADD_TEST(suite, test_lwgeom_distance_sphere);
+       PG_ADD_TEST(suite, test_lwgeom_check_geodetic);
+       PG_ADD_TEST(suite, test_gserialized_from_lwgeom);
+       PG_ADD_TEST(suite, test_spheroid_distance);
+       PG_ADD_TEST(suite, test_spheroid_area);
+       PG_ADD_TEST(suite, test_lwpoly_covers_point2d);
+       PG_ADD_TEST(suite, test_gbox_utils);
+       PG_ADD_TEST(suite, test_vector_angle);
+       PG_ADD_TEST(suite, test_vector_rotate);
+       PG_ADD_TEST(suite, test_lwgeom_segmentize_sphere);
+       PG_ADD_TEST(suite, test_ptarray_contains_point_sphere);
+       PG_ADD_TEST(suite, test_ptarray_contains_point_sphere_iowa);
+}
index 5b0dc7adb8e5d17b554b64200bd51058223f4228..877b7bb51d8c99e720bad5b3d8b8d0934b37a1bd 100644 (file)
@@ -68,10 +68,9 @@ static void test_geos_noop(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo geos_tests[] =
+void geos_suite_setup(void);
+void geos_suite_setup(void)
 {
-       PG_TEST(test_geos_noop),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo geos_suite = {"GEOS",  NULL,  NULL, geos_tests};
-
+       CU_pSuite suite = CU_add_suite("GEOS", NULL, NULL);
+       PG_ADD_TEST(suite, test_geos_noop);
+}
index 71ea3a344607445c29a1c5bf482345a7a912fd26..d488db4d3a6e8b8835bc83e502ac5cc2e9429a39 100644 (file)
@@ -251,14 +251,14 @@ static void test_geom(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo homogenize_tests[] =
+void homogenize_suite_setup(void);
+void homogenize_suite_setup(void)
 {
-       PG_TEST(test_coll_point),
-       PG_TEST(test_coll_line),
-       PG_TEST(test_coll_poly),
-       PG_TEST(test_coll_coll),
-       PG_TEST(test_geom),
-       PG_TEST(test_coll_curve),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo homogenize_suite = {"homogenize",  NULL,  NULL, homogenize_tests};
+       CU_pSuite suite = CU_add_suite("homogenize", NULL, NULL);
+       PG_ADD_TEST(suite, test_coll_point);
+       PG_ADD_TEST(suite, test_coll_line);
+       PG_ADD_TEST(suite, test_coll_poly);
+       PG_ADD_TEST(suite, test_coll_coll);
+       PG_ADD_TEST(suite, test_geom);
+       PG_ADD_TEST(suite, test_coll_curve);
+}
index 579feff1a2d22e41d0d9eb8feb9e13419914a442..2838568e2c4421ac47dbfb5e8e73a3b9ab5e0257 100644 (file)
@@ -56,10 +56,10 @@ static void in_encoded_polyline_test_precision(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo in_encoded_polyline_tests[] =
+void in_encoded_polyline_suite_setup(void);
+void in_encoded_polyline_suite_setup(void)
 {
-       PG_TEST(in_encoded_polyline_test_geoms),
-       PG_TEST(in_encoded_polyline_test_precision),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo in_encoded_polyline_suite = {"Encoded Polyline In Suite",  NULL,  NULL, in_encoded_polyline_tests};
+       CU_pSuite suite = CU_add_suite("Encoded Polyline In Suite", NULL, NULL);
+       PG_ADD_TEST(suite, in_encoded_polyline_test_geoms);
+       PG_ADD_TEST(suite, in_encoded_polyline_test_precision);
+}
index b9531d00a6eb4417290767a14e437d2cc0a8eae3..ebd40d8175e6cf99f0128915cd6bfba6058b206a 100644 (file)
@@ -199,11 +199,11 @@ static void in_geojson_test_geoms(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo in_geojson_tests[] =
+void in_geojson_suite_setup(void);
+void in_geojson_suite_setup(void)
 {
-       PG_TEST(in_geojson_test_srid),
-       PG_TEST(in_geojson_test_bbox),
-       PG_TEST(in_geojson_test_geoms),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo in_geojson_suite = {"in_geojson",  NULL,  NULL, in_geojson_tests};
+       CU_pSuite suite = CU_add_suite("in_geojson", NULL, NULL);
+       PG_ADD_TEST(suite, in_geojson_test_srid);
+       PG_ADD_TEST(suite, in_geojson_test_bbox);
+       PG_ADD_TEST(suite, in_geojson_test_geoms);
+}
index a09387624b8b2197419df1f3690ed1e4aa872e2d..07cd32743e76741888a96ea322d131edbce0a381 100644 (file)
@@ -161,16 +161,15 @@ static void test_twkb_in_collection(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-
-CU_TestInfo twkb_in_tests[] =
+void twkb_in_suite_setup(void);
+void twkb_in_suite_setup(void)
 {
-       PG_TEST(test_twkb_in_point),
-       PG_TEST(test_twkb_in_linestring),
-       PG_TEST(test_twkb_in_polygon),
-       PG_TEST(test_twkb_in_multipoint),
-       PG_TEST(test_twkb_in_multilinestring),
-       PG_TEST(test_twkb_in_multipolygon),
-       PG_TEST(test_twkb_in_collection),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo twkb_in_suite = {"TWKB In Suite",  init_twkb_in_suite,  clean_twkb_in_suite, twkb_in_tests};
+       CU_pSuite suite = CU_add_suite("TWKB In Suite", init_twkb_in_suite, clean_twkb_in_suite);
+       PG_ADD_TEST(suite, test_twkb_in_point);
+       PG_ADD_TEST(suite, test_twkb_in_linestring);
+       PG_ADD_TEST(suite, test_twkb_in_polygon);
+       PG_ADD_TEST(suite, test_twkb_in_multipoint);
+       PG_ADD_TEST(suite, test_twkb_in_multilinestring);
+       PG_ADD_TEST(suite, test_twkb_in_multipolygon);
+       PG_ADD_TEST(suite, test_twkb_in_collection);
+}
index cd89db01853511d575fa96bcd70bf819febe1308..69c328df38d5671d7629b3834c8167d1656ad23e 100644 (file)
@@ -966,29 +966,28 @@ static void test_lwline_from_lwmpoint(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo libgeom_tests[] =
+void libgeom_suite_setup(void);
+void libgeom_suite_setup(void)
 {
-       PG_TEST(test_typmod_macros),
-       PG_TEST(test_flags_macros),
-       PG_TEST(test_serialized_srid),
-       PG_TEST(test_gserialized_from_lwgeom_size),
-       PG_TEST(test_gbox_serialized_size),
-       PG_TEST(test_lwgeom_from_gserialized),
-       PG_TEST(test_lwgeom_count_vertices),
-       PG_TEST(test_on_gser_lwgeom_count_vertices),
-       PG_TEST(test_geometry_type_from_string),
-       PG_TEST(test_lwcollection_extract),
-       PG_TEST(test_lwgeom_free),
-       PG_TEST(test_lwgeom_flip_coordinates),
-       PG_TEST(test_f2d),
-       PG_TEST(test_lwgeom_clone),
-       PG_TEST(test_lwgeom_force_clockwise),
-       PG_TEST(test_lwgeom_calculate_gbox),
-       PG_TEST(test_lwgeom_is_empty),
-       PG_TEST(test_lwgeom_same),
-       PG_TEST(test_lwline_from_lwmpoint),
-       PG_TEST(test_lwgeom_as_curve),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo libgeom_suite = {"libgeom",  NULL,  NULL, libgeom_tests};
-
+       CU_pSuite suite = CU_add_suite("libgeom", NULL, NULL);
+       PG_ADD_TEST(suite, test_typmod_macros);
+       PG_ADD_TEST(suite, test_flags_macros);
+       PG_ADD_TEST(suite, test_serialized_srid);
+       PG_ADD_TEST(suite, test_gserialized_from_lwgeom_size);
+       PG_ADD_TEST(suite, test_gbox_serialized_size);
+       PG_ADD_TEST(suite, test_lwgeom_from_gserialized);
+       PG_ADD_TEST(suite, test_lwgeom_count_vertices);
+       PG_ADD_TEST(suite, test_on_gser_lwgeom_count_vertices);
+       PG_ADD_TEST(suite, test_geometry_type_from_string);
+       PG_ADD_TEST(suite, test_lwcollection_extract);
+       PG_ADD_TEST(suite, test_lwgeom_free);
+       PG_ADD_TEST(suite, test_lwgeom_flip_coordinates);
+       PG_ADD_TEST(suite, test_f2d);
+       PG_ADD_TEST(suite, test_lwgeom_clone);
+       PG_ADD_TEST(suite, test_lwgeom_force_clockwise);
+       PG_ADD_TEST(suite, test_lwgeom_calculate_gbox);
+       PG_ADD_TEST(suite, test_lwgeom_is_empty);
+       PG_ADD_TEST(suite, test_lwgeom_same);
+       PG_ADD_TEST(suite, test_lwline_from_lwmpoint);
+       PG_ADD_TEST(suite, test_lwgeom_as_curve);
+}
index 20af13fcab33d7f8aace6d77ea7bf4ec5492d29f..c8929974e19aab6bb5b69c215d0452ef77f624ad 100644 (file)
@@ -873,19 +873,19 @@ test_lw_dist2d_ptarray_ptarrayarc(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo measures_tests[] =
+void measures_suite_setup(void);
+void measures_suite_setup(void)
 {
-       PG_TEST(test_mindistance2d_tolerance),
-       PG_TEST(test_rect_tree_contains_point),
-       PG_TEST(test_rect_tree_intersects_tree),
-       PG_TEST(test_lwgeom_segmentize2d),
-       PG_TEST(test_lwgeom_locate_along),
-       PG_TEST(test_lw_dist2d_pt_arc),
-       PG_TEST(test_lw_dist2d_seg_arc),
-       PG_TEST(test_lw_dist2d_arc_arc),
-       PG_TEST(test_lw_arc_length),
-       PG_TEST(test_lw_dist2d_pt_ptarrayarc),
-       PG_TEST(test_lw_dist2d_ptarray_ptarrayarc),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo measures_suite = {"measures", NULL,  NULL, measures_tests};
+       CU_pSuite suite = CU_add_suite("measures", NULL, NULL);
+       PG_ADD_TEST(suite, test_mindistance2d_tolerance);
+       PG_ADD_TEST(suite, test_rect_tree_contains_point);
+       PG_ADD_TEST(suite, test_rect_tree_intersects_tree);
+       PG_ADD_TEST(suite, test_lwgeom_segmentize2d);
+       PG_ADD_TEST(suite, test_lwgeom_locate_along);
+       PG_ADD_TEST(suite, test_lw_dist2d_pt_arc);
+       PG_ADD_TEST(suite, test_lw_dist2d_seg_arc);
+       PG_ADD_TEST(suite, test_lw_dist2d_arc_arc);
+       PG_ADD_TEST(suite, test_lw_arc_length);
+       PG_ADD_TEST(suite, test_lw_dist2d_pt_ptarrayarc);
+       PG_ADD_TEST(suite, test_lw_dist2d_ptarray_ptarrayarc);
+}
index 7e86fbaf684f49c4c1cf1332e9962dd340fb3da5..cac5317447be87833f7836044d8e5ef7302909ac 100644 (file)
@@ -122,13 +122,13 @@ static void test_misc_wkb(void)
 /*
 ** Used by the test harness to register the tests in this file.
 */
-CU_TestInfo misc_tests[] =
+void misc_suite_setup(void);
+void misc_suite_setup(void)
 {
-       PG_TEST(test_misc_force_2d),
-       PG_TEST(test_misc_simplify),
-       PG_TEST(test_misc_count_vertices),
-       PG_TEST(test_misc_area),
-       PG_TEST(test_misc_wkb),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo misc_suite = {"misc", NULL, NULL, misc_tests };
+       CU_pSuite suite = CU_add_suite("misc", NULL, NULL);
+       PG_ADD_TEST(suite, test_misc_force_2d);
+       PG_ADD_TEST(suite, test_misc_simplify);
+       PG_ADD_TEST(suite, test_misc_count_vertices);
+       PG_ADD_TEST(suite, test_misc_area);
+       PG_ADD_TEST(suite, test_misc_wkb);
+}
index 47710790b536c0dfe6570cdedf782b37f9ea6b52..a3f66b8bcbe8d3f87d7cdeeff7e8debd5c6625e9 100644 (file)
@@ -63,12 +63,9 @@ static void test_lwgeom_node(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-/*
-** Used by test harness to register the tests in this file.
-*/
-CU_TestInfo node_tests[] =
+void node_suite_setup(void);
+void node_suite_setup(void)
 {
-       PG_TEST(test_lwgeom_node),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo node_suite = {"node",  NULL,  NULL, node_tests};
+       CU_pSuite suite = CU_add_suite("node", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwgeom_node);
+}
index 7f0a710776f53526b6650ab698c02713784dfc8b..4c21e456b7286af8dfb3be5adba1a7e1cde4bcf6 100644 (file)
@@ -87,11 +87,11 @@ static void out_encoded_polyline_test_precision(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_encoded_polyline_tests[] =
+void out_encoded_polyline_suite_setup(void);
+void out_encoded_polyline_suite_setup(void)
 {
-       PG_TEST(out_encoded_polyline_test_geoms),
-       PG_TEST(out_encoded_polyline_test_srid),
-       PG_TEST(out_encoded_polyline_test_precision),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_encoded_polyline_suite = {"Encoded Polyline Out Suite",  NULL,  NULL, out_encoded_polyline_tests};
+       CU_pSuite suite = CU_add_suite("Encoded Polyline Out Suite", NULL, NULL);
+       PG_ADD_TEST(suite, out_encoded_polyline_test_geoms);
+       PG_ADD_TEST(suite, out_encoded_polyline_test_srid);
+       PG_ADD_TEST(suite, out_encoded_polyline_test_precision);
+}
index 5a543c38f325cb3de7fa01a793774c719ad9c5b7..8ed00eb2d7f90df6c7f8db3e981ca48dea43c0ef 100644 (file)
@@ -298,13 +298,13 @@ static void out_geojson_test_geoms(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_geojson_tests[] =
+void out_geojson_suite_setup(void);
+void out_geojson_suite_setup(void)
 {
-       PG_TEST(out_geojson_test_precision),
-       PG_TEST(out_geojson_test_dims),
-       PG_TEST(out_geojson_test_srid),
-       PG_TEST(out_geojson_test_bbox),
-       PG_TEST(out_geojson_test_geoms),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_geojson_suite = {"GeoJson Out Suite",  NULL,  NULL, out_geojson_tests};
+       CU_pSuite suite = CU_add_suite("GeoJson Out Suite", NULL, NULL);
+       PG_ADD_TEST(suite, out_geojson_test_precision);
+       PG_ADD_TEST(suite, out_geojson_test_dims);
+       PG_ADD_TEST(suite, out_geojson_test_srid);
+       PG_ADD_TEST(suite, out_geojson_test_bbox);
+       PG_ADD_TEST(suite, out_geojson_test_geoms);
+}
index c37c46ba8c843a785435d9482f26af1b52bfd4ea..5be119fdb7705ec62f083c337ee9d1e985889d89 100644 (file)
@@ -1067,17 +1067,17 @@ static void out_gml3_extent(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_gml_tests[] =
+void out_gml_suite_setup(void);
+void out_gml_suite_setup(void)
 {
-       PG_TEST(out_gml_test_precision),
-       PG_TEST(out_gml_test_srid),
-       PG_TEST(out_gml_test_dims),
-       PG_TEST(out_gml_test_geodetic),
-       PG_TEST(out_gml_test_geoms),
-       PG_TEST(out_gml_test_geoms_prefix),
-       PG_TEST(out_gml_test_geoms_nodims),
-       PG_TEST(out_gml2_extent),
-       PG_TEST(out_gml3_extent),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_gml_suite = {"out_gml",  NULL,  NULL, out_gml_tests};
+       CU_pSuite suite = CU_add_suite("out_gml", NULL, NULL);
+       PG_ADD_TEST(suite, out_gml_test_precision);
+       PG_ADD_TEST(suite, out_gml_test_srid);
+       PG_ADD_TEST(suite, out_gml_test_dims);
+       PG_ADD_TEST(suite, out_gml_test_geodetic);
+       PG_ADD_TEST(suite, out_gml_test_geoms);
+       PG_ADD_TEST(suite, out_gml_test_geoms_prefix);
+       PG_ADD_TEST(suite, out_gml_test_geoms_nodims);
+       PG_ADD_TEST(suite, out_gml2_extent);
+       PG_ADD_TEST(suite, out_gml3_extent);
+}
index 74e8fb25c20863381b2c3f5649bbfb8fe7be923c..d9492e22b88e442e584fed904b9550a6d4a50124 100644 (file)
@@ -236,12 +236,12 @@ static void out_kml_test_prefix(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_kml_tests[] =
+void out_kml_suite_setup(void);
+void out_kml_suite_setup(void)
 {
-       PG_TEST(out_kml_test_precision),
-       PG_TEST(out_kml_test_dims),
-       PG_TEST(out_kml_test_geoms),
-       PG_TEST(out_kml_test_prefix),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_kml_suite = {"KML Out Suite",  NULL,  NULL, out_kml_tests};
+       CU_pSuite suite = CU_add_suite("KML Out Suite", NULL, NULL);
+       PG_ADD_TEST(suite, out_kml_test_precision);
+       PG_ADD_TEST(suite, out_kml_test_dims);
+       PG_ADD_TEST(suite, out_kml_test_geoms);
+       PG_ADD_TEST(suite, out_kml_test_prefix);
+}
index 82d7ece72b4dffa387b77ba26b0de16bfefb254b..8c650ef2d418ec6032051592d748cfc702d846c1 100644 (file)
@@ -318,13 +318,13 @@ static void out_svg_test_srid(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_svg_tests[] =
+void out_svg_suite_setup(void);
+void out_svg_suite_setup(void)
 {
-       PG_TEST(out_svg_test_precision),
-       PG_TEST(out_svg_test_dims),
-       PG_TEST(out_svg_test_relative),
-       PG_TEST(out_svg_test_geoms),
-       PG_TEST(out_svg_test_srid),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_svg_suite = {"SVG Out Suite",  NULL,  NULL, out_svg_tests};
+       CU_pSuite suite = CU_add_suite("SVG Out Suite", NULL, NULL);
+       PG_ADD_TEST(suite, out_svg_test_precision);
+       PG_ADD_TEST(suite, out_svg_test_dims);
+       PG_ADD_TEST(suite, out_svg_test_relative);
+       PG_ADD_TEST(suite, out_svg_test_geoms);
+       PG_ADD_TEST(suite, out_svg_test_srid);
+}
index 5314bc17ef3e0515315499ec1b1fd218aa21daf4..29aeada64a1915af9f7fbf9b3a93cc10d79d8fa8 100644 (file)
@@ -127,16 +127,15 @@ static void test_twkb_out_collection(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-
-CU_TestInfo twkb_out_tests[] =
+void twkb_out_suite_setup(void);
+void twkb_out_suite_setup(void)
 {
-       PG_TEST(test_twkb_out_point),
-       PG_TEST(test_twkb_out_linestring),
-       PG_TEST(test_twkb_out_polygon),
-       PG_TEST(test_twkb_out_multipoint),
-       PG_TEST(test_twkb_out_multilinestring),
-       PG_TEST(test_twkb_out_multipolygon),
-       PG_TEST(test_twkb_out_collection),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo twkb_out_suite = {"TWKB Out Suite",  init_twkb_out_suite,  clean_twkb_out_suite, twkb_out_tests};
+       CU_pSuite suite = CU_add_suite("TWKB Out Suite", init_twkb_out_suite, clean_twkb_out_suite);
+       PG_ADD_TEST(suite, test_twkb_out_point);
+       PG_ADD_TEST(suite, test_twkb_out_linestring);
+       PG_ADD_TEST(suite, test_twkb_out_polygon);
+       PG_ADD_TEST(suite, test_twkb_out_multipoint);
+       PG_ADD_TEST(suite, test_twkb_out_multilinestring);
+       PG_ADD_TEST(suite, test_twkb_out_multipolygon);
+       PG_ADD_TEST(suite, test_twkb_out_collection);
+}
index 6141c083b908ae89c3c84f89c8186ad3630e57d6..8d3498dae7cbf41b3ef841cc7bf11f307f8adef7 100644 (file)
@@ -159,10 +159,10 @@ static void out_x3d3_test_geoms(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo out_x3d_tests[] =
+void out_x3d_suite_setup(void);
+void out_x3d_suite_setup(void)
 {
-       PG_TEST(out_x3d3_test_precision),
-       PG_TEST(out_x3d3_test_geoms),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo out_x3d_suite = {"X3D Out Suite",  NULL,  NULL, out_x3d_tests};
+       CU_pSuite suite = CU_add_suite("X3D Out Suite", NULL, NULL);
+       PG_ADD_TEST(suite, out_x3d3_test_precision);
+       PG_ADD_TEST(suite, out_x3d3_test_geoms);
+}
index f2aacb8aea27efbe977ff8217dbd3bc7bdd5f11c..d9f615534b9144d0a30de2f0c789b594b33e7bcc 100644 (file)
@@ -18,7 +18,6 @@
 #include "liblwgeom_internal.h"
 #include "cu_tester.h"
 
-
 static void test_lwprint_assert_format(char * point_wkt, const char * format, const char * expected)
 {
        LWPOINT * test_point = (LWPOINT*)lwgeom_from_wkt(point_wkt, LW_PARSER_CHECK_NONE);
@@ -160,15 +159,16 @@ static void test_lwprint_bad_formats(void)
 }
 
 /*
-** Used by the test harness to register the tests in this file.
+** Callback used by the test harness to register the tests in this file.
 */
-CU_TestInfo print_tests[] =
+void print_suite_setup(void);
+void print_suite_setup(void)
 {
-       PG_TEST(test_lwprint_default_format),
-       PG_TEST(test_lwprint_format_orders),
-       PG_TEST(test_lwprint_optional_format),
-       PG_TEST(test_lwprint_oddball_formats),
-       PG_TEST(test_lwprint_bad_formats),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo print_suite = {"print_suite", NULL, NULL, print_tests };
+       CU_pSuite suite = CU_add_suite("print_suite", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwprint_default_format);
+       PG_ADD_TEST(suite, test_lwprint_format_orders);
+       PG_ADD_TEST(suite, test_lwprint_optional_format);
+       PG_ADD_TEST(suite, test_lwprint_oddball_formats);
+       PG_ADD_TEST(suite, test_lwprint_bad_formats);
+}
+
index acee094fffbf478c5438b863e11378dff337d5d7..c4c7db5d5343df651cbb986ba84f832e73d8be9b 100644 (file)
@@ -435,7 +435,7 @@ static void test_ptarray_desegmentize()
        out = lwgeom_desegmentize(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        CU_ASSERT_STRING_EQUAL(str, "LINESTRING(10 10,0 10,0 0,10 0)");
-       printf("%s\n", str);
+       // printf("%s\n", str);
        lwgeom_free(in);
        lwgeom_free(out);
        lwfree(str);
@@ -692,17 +692,17 @@ static void test_ptarrayarc_contains_point()
 /*
 ** Used by the test harness to register the tests in this file.
 */
-CU_TestInfo ptarray_tests[] =
+void ptarray_suite_setup(void);
+void ptarray_suite_setup(void)
 {
-       PG_TEST(test_ptarray_append_point),
-       PG_TEST(test_ptarray_append_ptarray),
-       PG_TEST(test_ptarray_locate_point),
-       PG_TEST(test_ptarray_isccw),
-       PG_TEST(test_ptarray_signed_area),
-       PG_TEST(test_ptarray_desegmentize),
-       PG_TEST(test_ptarray_insert_point),
-       PG_TEST(test_ptarray_contains_point),
-       PG_TEST(test_ptarrayarc_contains_point),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo ptarray_suite = {"ptarray", NULL, NULL, ptarray_tests };
+       CU_pSuite suite = CU_add_suite("ptarray", NULL, NULL);
+       PG_ADD_TEST(suite, test_ptarray_append_point);
+       PG_ADD_TEST(suite, test_ptarray_append_ptarray);
+       PG_ADD_TEST(suite, test_ptarray_locate_point);
+       PG_ADD_TEST(suite, test_ptarray_isccw);
+       PG_ADD_TEST(suite, test_ptarray_signed_area);
+       PG_ADD_TEST(suite, test_ptarray_desegmentize);
+       PG_ADD_TEST(suite, test_ptarray_insert_point);
+       PG_ADD_TEST(suite, test_ptarray_contains_point);
+       PG_ADD_TEST(suite, test_ptarrayarc_contains_point);
+}
index f48057dda34fef239f4098e3237bb895bc8a4aba..08568388c3e81d7ccfb6bbf6ca21efc898db148f 100644 (file)
@@ -91,10 +91,9 @@ static void test_sfcgal_noop(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo sfcgal_tests[] =
+void sfcgal_suite_setup(void);
+void sfcgal_suite_setup(void)
 {
-       PG_TEST(test_sfcgal_noop),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo sfcgal_suite = {"SFCGAL",  NULL,  NULL, sfcgal_tests};
-
+       CU_pSuite suite = CU_add_suite("SFCGAL", NULL, NULL);
+       PG_ADD_TEST(suite, test_sfcgal_noop);
+}
index e755ed8dcdc0e845d766c57e954f415024cfe045..2f0646b7f6ca26ea5301158918bbbfac422c49b7 100644 (file)
@@ -160,10 +160,10 @@ static void test_lwgeom_split(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo split_tests[] =
+void split_suite_setup(void);
+void split_suite_setup(void)
 {
-       PG_TEST(test_lwline_split_by_point_to),
-       PG_TEST(test_lwgeom_split),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo split_suite = {"split",  NULL,  NULL, split_tests};
+       CU_pSuite suite = CU_add_suite("split", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwline_split_by_point_to);
+       PG_ADD_TEST(suite, test_lwgeom_split);
+}
index 25b44aed6d61050c267cf747f13a0842fe318600..5652dd9c1e94b4266aad4bd6659b1b9dbeb515ee 100644 (file)
@@ -54,10 +54,10 @@ static void test_stringbuffer_aprintf(void)
 /*
 ** Used by the test harness to register the tests in this file.
 */
-CU_TestInfo stringbuffer_tests[] =
+void stringbuffer_suite_setup(void);
+void stringbuffer_suite_setup(void)
 {
-       PG_TEST(test_stringbuffer_append),
-       PG_TEST(test_stringbuffer_aprintf),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo stringbuffer_suite = {"stringbuffer", NULL, NULL, stringbuffer_tests };
+       CU_pSuite suite = CU_add_suite("stringbuffer", NULL, NULL);
+       PG_ADD_TEST(suite, test_stringbuffer_append);
+       PG_ADD_TEST(suite, test_stringbuffer_aprintf);
+}
index c32db3a728401300488d50d3d789a24859e4f2e7..408009e37044f68f2a9e8880f0925cdca3f1cfce 100644 (file)
 static void
 cu_errorreporter(const char *fmt, va_list ap);
 
-/* ADD YOUR SUITE HERE (1 of 2) */
-extern CU_SuiteInfo print_suite;
-extern CU_SuiteInfo algorithms_suite;
-extern CU_SuiteInfo buildarea_suite;
-extern CU_SuiteInfo clean_suite;
-extern CU_SuiteInfo clip_by_rect_suite;
-extern CU_SuiteInfo misc_suite;
-extern CU_SuiteInfo ptarray_suite;
-extern CU_SuiteInfo measures_suite;
-extern CU_SuiteInfo node_suite;
-extern CU_SuiteInfo wkt_out_suite;
-extern CU_SuiteInfo wkt_in_suite;
-extern CU_SuiteInfo twkb_out_suite;
-extern CU_SuiteInfo twkb_in_suite;
-extern CU_SuiteInfo wkb_out_suite;
-extern CU_SuiteInfo wkb_in_suite;
-extern CU_SuiteInfo libgeom_suite;
-extern CU_SuiteInfo split_suite;
-extern CU_SuiteInfo geodetic_suite;
-extern CU_SuiteInfo geos_suite;
-extern CU_SuiteInfo sfcgal_suite;
-extern CU_SuiteInfo tree_suite;
-extern CU_SuiteInfo triangulate_suite;
-extern CU_SuiteInfo homogenize_suite;
-extern CU_SuiteInfo force_sfs_suite;
-extern CU_SuiteInfo in_geojson_suite;
-extern CU_SuiteInfo stringbuffer_suite;
-extern CU_SuiteInfo surface_suite;
-extern CU_SuiteInfo out_gml_suite;
-extern CU_SuiteInfo out_kml_suite;
-extern CU_SuiteInfo out_geojson_suite;
-extern CU_SuiteInfo out_svg_suite;
-extern CU_SuiteInfo out_x3d_suite;
-extern CU_SuiteInfo out_encoded_polyline_suite;
-extern CU_SuiteInfo in_encoded_polyline_suite;
-extern CU_SuiteInfo varint_suite;
+
+/* ADD YOUR SUITE SETUP FUNCTION HERE (1 of 2) */
+extern void print_suite_setup();
+extern void algorithms_suite_setup();
+extern void buildarea_suite_setup();
+extern void clean_suite_setup();
+extern void clip_by_rect_suite_setup();
+extern void force_sfs_suite_setup(void);
+extern void geodetic_suite_setup(void);
+extern void geos_suite_setup(void);
+extern void homogenize_suite_setup(void);
+extern void in_encoded_polyline_suite_setup(void);
+extern void in_geojson_suite_setup(void);
+extern void twkb_in_suite_setup(void);
+extern void libgeom_suite_setup(void);
+extern void measures_suite_setup(void);
+extern void misc_suite_setup(void);
+extern void node_suite_setup(void);
+extern void out_encoded_polyline_suite_setup(void);
+extern void out_geojson_suite_setup(void);
+extern void out_gml_suite_setup(void);
+extern void out_kml_suite_setup(void);
+extern void out_svg_suite_setup(void);
+extern void twkb_out_suite_setup(void);
+extern void out_x3d_suite_setup(void);
+extern void ptarray_suite_setup(void);
+extern void sfcgal_suite_setup(void);
+extern void split_suite_setup(void);
+extern void stringbuffer_suite_setup(void);
+extern void tree_suite_setup(void);
+extern void triangulate_suite_setup(void);
+extern void varint_suite_setup(void);
+
+/* AND ADD YOUR SUITE SETUP FUNCTION HERE (2 of 2) */
+PG_SuiteSetup setupfuncs[] =
+{
+       print_suite_setup,
+       algorithms_suite_setup,
+       buildarea_suite_setup,
+       clean_suite_setup,
+       clip_by_rect_suite_setup,
+       force_sfs_suite_setup,
+       geodetic_suite_setup,
+       geos_suite_setup,
+       homogenize_suite_setup,
+       in_encoded_polyline_suite_setup,
+#if HAVE_LIBJSON
+       in_geojson_suite_setup,
+#endif
+       twkb_in_suite_setup,
+       libgeom_suite_setup,
+       measures_suite_setup,
+       misc_suite_setup,
+       node_suite_setup,
+       out_encoded_polyline_suite_setup,
+       out_geojson_suite_setup,
+       out_gml_suite_setup,
+       out_kml_suite_setup,
+       out_svg_suite_setup,
+       twkb_out_suite_setup,
+       out_x3d_suite_setup,
+       ptarray_suite_setup,
+#if HAVE_SFCGAL
+       sfcgal_suite_setup,
+#endif
+       split_suite_setup,
+       stringbuffer_suite_setup,
+       tree_suite_setup,
+       triangulate_suite_setup,
+       varint_suite_setup,
+       NULL
+};
+
 
 #define MAX_CUNIT_MSG_LENGTH 256
 
@@ -67,51 +104,6 @@ extern CU_SuiteInfo varint_suite;
 */
 int main(int argc, char *argv[])
 {
-       /* ADD YOUR SUITE HERE (2 of 2) */
-       CU_SuiteInfo suites[] =
-       {
-               print_suite,
-               misc_suite,
-               ptarray_suite,
-               algorithms_suite,
-               buildarea_suite,
-               clean_suite,
-               clip_by_rect_suite,
-               measures_suite,
-               node_suite,
-               wkt_out_suite,
-               wkt_in_suite,
-               twkb_out_suite,
-               twkb_in_suite,
-               wkb_out_suite,
-               wkb_in_suite,
-               libgeom_suite,
-               split_suite,
-               geodetic_suite,
-               geos_suite,
-#if HAVE_SFCGAL
-               sfcgal_suite,
-#endif
-               tree_suite,
-               triangulate_suite,
-               stringbuffer_suite,
-               surface_suite,
-               homogenize_suite,
-               force_sfs_suite,
-#if HAVE_LIBJSON
-               in_geojson_suite,
-#endif
-               out_gml_suite,
-               out_kml_suite,
-               out_geojson_suite,
-               out_svg_suite,
-               out_x3d_suite,
-               out_encoded_polyline_suite,
-               in_encoded_polyline_suite,
-               varint_suite,
-               CU_SUITE_INFO_NULL
-       };
-
        int index;
        char *suite_name;
        CU_pSuite suite_to_run;
@@ -133,14 +125,21 @@ int main(int argc, char *argv[])
                return errCode;
        }
 
-       /* Register all the test suites. */
-       if (CUE_SUCCESS != CU_register_suites(suites))
+       PG_SuiteSetup *setupfunc = setupfuncs;
+       while ( *setupfunc )
        {
-               errCode = CU_get_error();
-               printf("    Error attempting to register test suites: %d.  See CUError.h for error code list.\n", errCode);
-               return errCode;
+               (*setupfunc)();
+               setupfunc++;
        }
 
+       /* Register all the test suites. */
+       // if (CUE_SUCCESS != CU_register_suites(suites))
+       // {
+       //      errCode = CU_get_error();
+       //      printf("    Error attempting to register test suites: %d.  See CUError.h for error code list.\n", errCode);
+       //      return errCode;
+       // }
+
        /* Run all tests using the CUnit Basic interface */
        CU_basic_set_mode(CU_BRM_VERBOSE);
        if (argc <= 1)
index 7f72790ed5821061b4a198b6bf20eea95ed487b1..b926764a0dd94f9474933208471b67d613b9db0a 100644 (file)
  **********************************************************************/
 
 #define PG_TEST(test_func) { #test_func, test_func }
+
 #define MAX_CUNIT_ERROR_LENGTH 512
 
+#define PG_ADD_TEST(suite, testfunc) CU_add_test(suite, #testfunc, testfunc)
+
 /* Contains the most recent error message generated by lwerror. */
 char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1];
 
 /* Resets cu_error_msg back to blank. */
 void cu_error_msg_reset(void);
 
+/* Our internal callback to register Suites with the main tester */
+typedef void (*PG_SuiteSetup)(void);
index 6ea7b30dcc8a69b3340cca9f9c280c3e6e45c4e7..f94adf4fb390a992f0335ee28898aef369b0533b 100644 (file)
@@ -332,13 +332,12 @@ static void test_tree_circ_distance(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo tree_tests[] =
+void tree_suite_setup(void);
+void tree_suite_setup(void)
 {
-       PG_TEST(test_tree_circ_create),
-       PG_TEST(test_tree_circ_pip),
-       PG_TEST(test_tree_circ_pip2),
-       PG_TEST(test_tree_circ_distance),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo tree_suite = {"Internal Spatial Trees",  NULL,  NULL, tree_tests};
-
+       CU_pSuite suite = CU_add_suite("Internal Spatial Trees", NULL, NULL);
+       PG_ADD_TEST(suite, test_tree_circ_create);
+       PG_ADD_TEST(suite, test_tree_circ_pip);
+       PG_ADD_TEST(suite, test_tree_circ_pip2);
+       PG_ADD_TEST(suite, test_tree_circ_distance);
+}
index 894dbae3f7cb62df2e8272ff0590dca674c4539a..22a4944a9052ef3b63da2294dd68cb6565c19acc 100644 (file)
@@ -50,9 +50,9 @@ static void test_lwgeom_delaunay_triangulation(void)
 /*
 ** Used by test harness to register the tests in this file.
 */
-CU_TestInfo triangulate_tests[] =
+void triangulate_suite_setup(void);
+void triangulate_suite_setup(void)
 {
-       PG_TEST(test_lwgeom_delaunay_triangulation),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo triangulate_suite = {"triangulate",  NULL,  NULL, triangulate_tests};
+       CU_pSuite suite = CU_add_suite("triangulate", NULL, NULL);
+       PG_ADD_TEST(suite, test_lwgeom_delaunay_triangulation);
+}
index a398e6e574f0f319cdf58f4f22109b9a520edd03..9741d54e43ceacdb843e41a5e69b47082984fcad 100644 (file)
@@ -183,9 +183,9 @@ static void test_varint(void)
 /*
 ** Used by the test harness to register the tests in this file.
 */
-CU_TestInfo varint_tests[] =
+void varint_suite_setup(void);
+void varint_suite_setup(void)
 {
-       PG_TEST(test_varint),
-       CU_TEST_INFO_NULL
-};
-CU_SuiteInfo varint_suite = {"varint", NULL, NULL, varint_tests };
+       CU_pSuite suite = CU_add_suite("varint", NULL, NULL);
+       PG_ADD_TEST(suite, test_varint);
+}