From: Paul Ramsey Date: Wed, 18 Feb 2015 21:58:15 +0000 (+0000) Subject: #3041, Cunit 2.1-3 breaks testing X-Git-Tag: 2.2.0rc1~661 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1804329962a65414624a21a5dfe40bd59f014c2;p=postgis #3041, Cunit 2.1-3 breaks testing 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 --- diff --git a/liblwgeom/cunit/cu_algorithm.c b/liblwgeom/cunit/cu_algorithm.c index 3d28b1d24..5a58261b5 100644 --- a/liblwgeom/cunit/cu_algorithm.c +++ b/liblwgeom/cunit/cu_algorithm.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_buildarea.c b/liblwgeom/cunit/cu_buildarea.c index 7c618f440..c3560dd7c 100644 --- a/liblwgeom/cunit/cu_buildarea.c +++ b/liblwgeom/cunit/cu_buildarea.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_clean.c b/liblwgeom/cunit/cu_clean.c index 439183c23..350175236 100644 --- a/liblwgeom/cunit/cu_clean.c +++ b/liblwgeom/cunit/cu_clean.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_clip_by_rect.c b/liblwgeom/cunit/cu_clip_by_rect.c index e962e3253..65ac141e5 100644 --- a/liblwgeom/cunit/cu_clip_by_rect.c +++ b/liblwgeom/cunit/cu_clip_by_rect.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_force_sfs.c b/liblwgeom/cunit/cu_force_sfs.c index 4815d0992..b71f6890a 100644 --- a/liblwgeom/cunit/cu_force_sfs.c +++ b/liblwgeom/cunit/cu_force_sfs.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_geodetic.c b/liblwgeom/cunit/cu_geodetic.c index ac54d3817..ef657b94e 100644 --- a/liblwgeom/cunit/cu_geodetic.c +++ b/liblwgeom/cunit/cu_geodetic.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_geos.c b/liblwgeom/cunit/cu_geos.c index 5b0dc7adb..877b7bb51 100644 --- a/liblwgeom/cunit/cu_geos.c +++ b/liblwgeom/cunit/cu_geos.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_homogenize.c b/liblwgeom/cunit/cu_homogenize.c index 71ea3a344..d488db4d3 100644 --- a/liblwgeom/cunit/cu_homogenize.c +++ b/liblwgeom/cunit/cu_homogenize.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_in_encoded_polyline.c b/liblwgeom/cunit/cu_in_encoded_polyline.c index 579feff1a..2838568e2 100644 --- a/liblwgeom/cunit/cu_in_encoded_polyline.c +++ b/liblwgeom/cunit/cu_in_encoded_polyline.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_in_geojson.c b/liblwgeom/cunit/cu_in_geojson.c index b9531d00a..ebd40d817 100644 --- a/liblwgeom/cunit/cu_in_geojson.c +++ b/liblwgeom/cunit/cu_in_geojson.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_in_twkb.c b/liblwgeom/cunit/cu_in_twkb.c index a09387624..07cd32743 100644 --- a/liblwgeom/cunit/cu_in_twkb.c +++ b/liblwgeom/cunit/cu_in_twkb.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_libgeom.c b/liblwgeom/cunit/cu_libgeom.c index cd89db018..69c328df3 100644 --- a/liblwgeom/cunit/cu_libgeom.c +++ b/liblwgeom/cunit/cu_libgeom.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_measures.c b/liblwgeom/cunit/cu_measures.c index 20af13fca..c8929974e 100644 --- a/liblwgeom/cunit/cu_measures.c +++ b/liblwgeom/cunit/cu_measures.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_misc.c b/liblwgeom/cunit/cu_misc.c index 7e86fbaf6..cac531744 100644 --- a/liblwgeom/cunit/cu_misc.c +++ b/liblwgeom/cunit/cu_misc.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_node.c b/liblwgeom/cunit/cu_node.c index 47710790b..a3f66b8bc 100644 --- a/liblwgeom/cunit/cu_node.c +++ b/liblwgeom/cunit/cu_node.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_encoded_polyline.c b/liblwgeom/cunit/cu_out_encoded_polyline.c index 7f0a71077..4c21e456b 100644 --- a/liblwgeom/cunit/cu_out_encoded_polyline.c +++ b/liblwgeom/cunit/cu_out_encoded_polyline.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_geojson.c b/liblwgeom/cunit/cu_out_geojson.c index 5a543c38f..8ed00eb2d 100644 --- a/liblwgeom/cunit/cu_out_geojson.c +++ b/liblwgeom/cunit/cu_out_geojson.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_gml.c b/liblwgeom/cunit/cu_out_gml.c index c37c46ba8..5be119fdb 100644 --- a/liblwgeom/cunit/cu_out_gml.c +++ b/liblwgeom/cunit/cu_out_gml.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_kml.c b/liblwgeom/cunit/cu_out_kml.c index 74e8fb25c..d9492e22b 100644 --- a/liblwgeom/cunit/cu_out_kml.c +++ b/liblwgeom/cunit/cu_out_kml.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_svg.c b/liblwgeom/cunit/cu_out_svg.c index 82d7ece72..8c650ef2d 100644 --- a/liblwgeom/cunit/cu_out_svg.c +++ b/liblwgeom/cunit/cu_out_svg.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_twkb.c b/liblwgeom/cunit/cu_out_twkb.c index 5314bc17e..29aeada64 100644 --- a/liblwgeom/cunit/cu_out_twkb.c +++ b/liblwgeom/cunit/cu_out_twkb.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_out_x3d.c b/liblwgeom/cunit/cu_out_x3d.c index 6141c083b..8d3498dae 100644 --- a/liblwgeom/cunit/cu_out_x3d.c +++ b/liblwgeom/cunit/cu_out_x3d.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_print.c b/liblwgeom/cunit/cu_print.c index f2aacb8ae..d9f615534 100644 --- a/liblwgeom/cunit/cu_print.c +++ b/liblwgeom/cunit/cu_print.c @@ -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); +} + diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c index acee094ff..c4c7db5d5 100644 --- a/liblwgeom/cunit/cu_ptarray.c +++ b/liblwgeom/cunit/cu_ptarray.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_sfcgal.c b/liblwgeom/cunit/cu_sfcgal.c index f48057dda..08568388c 100644 --- a/liblwgeom/cunit/cu_sfcgal.c +++ b/liblwgeom/cunit/cu_sfcgal.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_split.c b/liblwgeom/cunit/cu_split.c index e755ed8dc..2f0646b7f 100644 --- a/liblwgeom/cunit/cu_split.c +++ b/liblwgeom/cunit/cu_split.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_stringbuffer.c b/liblwgeom/cunit/cu_stringbuffer.c index 25b44aed6..5652dd9c1 100644 --- a/liblwgeom/cunit/cu_stringbuffer.c +++ b/liblwgeom/cunit/cu_stringbuffer.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_tester.c b/liblwgeom/cunit/cu_tester.c index c32db3a72..408009e37 100644 --- a/liblwgeom/cunit/cu_tester.c +++ b/liblwgeom/cunit/cu_tester.c @@ -21,42 +21,79 @@ 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) diff --git a/liblwgeom/cunit/cu_tester.h b/liblwgeom/cunit/cu_tester.h index 7f72790ed..b926764a0 100644 --- a/liblwgeom/cunit/cu_tester.h +++ b/liblwgeom/cunit/cu_tester.h @@ -10,11 +10,16 @@ **********************************************************************/ #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); diff --git a/liblwgeom/cunit/cu_tree.c b/liblwgeom/cunit/cu_tree.c index 6ea7b30dc..f94adf4fb 100644 --- a/liblwgeom/cunit/cu_tree.c +++ b/liblwgeom/cunit/cu_tree.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_triangulate.c b/liblwgeom/cunit/cu_triangulate.c index 894dbae3f..22a4944a9 100644 --- a/liblwgeom/cunit/cu_triangulate.c +++ b/liblwgeom/cunit/cu_triangulate.c @@ -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); +} diff --git a/liblwgeom/cunit/cu_varint.c b/liblwgeom/cunit/cu_varint.c index a398e6e57..9741d54e4 100644 --- a/liblwgeom/cunit/cu_varint.c +++ b/liblwgeom/cunit/cu_varint.c @@ -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); +}