From: Paul Ramsey Date: Wed, 18 Feb 2015 23:13:26 +0000 (+0000) Subject: #3041, add remaining tests X-Git-Tag: 2.2.0rc1~659 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83bbb78dd842b69ca835b34018d88b5021795342;p=postgis #3041, add remaining tests git-svn-id: http://svn.osgeo.org/postgis/trunk@13239 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/cunit/cu_in_wkb.c b/liblwgeom/cunit/cu_in_wkb.c index 9086dca1d..fabd07a6c 100644 --- a/liblwgeom/cunit/cu_in_wkb.c +++ b/liblwgeom/cunit/cu_in_wkb.c @@ -213,22 +213,21 @@ static void test_wkb_in_malformed(void) /* ** Used by test harness to register the tests in this file. */ - -CU_TestInfo wkb_in_tests[] = +void wkb_in_suite_setup(void); +void wkb_in_suite_setup(void) { - PG_TEST(test_wkb_in_point), - PG_TEST(test_wkb_in_linestring), - PG_TEST(test_wkb_in_polygon), - PG_TEST(test_wkb_in_multipoint), - PG_TEST(test_wkb_in_multilinestring), - PG_TEST(test_wkb_in_multipolygon), - PG_TEST(test_wkb_in_collection), - PG_TEST(test_wkb_in_circularstring), - PG_TEST(test_wkb_in_compoundcurve), - PG_TEST(test_wkb_in_curvpolygon), - PG_TEST(test_wkb_in_multicurve), - PG_TEST(test_wkb_in_multisurface), - PG_TEST(test_wkb_in_malformed), - CU_TEST_INFO_NULL -}; -CU_SuiteInfo wkb_in_suite = {"WKB In Suite", init_wkb_in_suite, clean_wkb_in_suite, wkb_in_tests}; + CU_pSuite suite = CU_add_suite("WKB In Suite", init_wkb_in_suite, clean_wkb_in_suite); + PG_ADD_TEST(suite, test_wkb_in_point); + PG_ADD_TEST(suite, test_wkb_in_linestring); + PG_ADD_TEST(suite, test_wkb_in_polygon); + PG_ADD_TEST(suite, test_wkb_in_multipoint); + PG_ADD_TEST(suite, test_wkb_in_multilinestring); + PG_ADD_TEST(suite, test_wkb_in_multipolygon); + PG_ADD_TEST(suite, test_wkb_in_collection); + PG_ADD_TEST(suite, test_wkb_in_circularstring); + PG_ADD_TEST(suite, test_wkb_in_compoundcurve); + PG_ADD_TEST(suite, test_wkb_in_curvpolygon); + PG_ADD_TEST(suite, test_wkb_in_multicurve); + PG_ADD_TEST(suite, test_wkb_in_multisurface); + PG_ADD_TEST(suite, test_wkb_in_malformed); +} diff --git a/liblwgeom/cunit/cu_in_wkt.c b/liblwgeom/cunit/cu_in_wkt.c index a8ce96806..64af831dc 100644 --- a/liblwgeom/cunit/cu_in_wkt.c +++ b/liblwgeom/cunit/cu_in_wkt.c @@ -350,24 +350,23 @@ static void test_wkt_in_errlocation(void) /* ** Used by test harness to register the tests in this file. */ - -CU_TestInfo wkt_in_tests[] = +void wkt_in_suite_setup(void); +void wkt_in_suite_setup(void) { - PG_TEST(test_wkt_in_point), - PG_TEST(test_wkt_in_linestring), - PG_TEST(test_wkt_in_polygon), - PG_TEST(test_wkt_in_multipoint), - PG_TEST(test_wkt_in_multilinestring), - PG_TEST(test_wkt_in_multipolygon), - PG_TEST(test_wkt_in_collection), - PG_TEST(test_wkt_in_circularstring), - PG_TEST(test_wkt_in_compoundcurve), - PG_TEST(test_wkt_in_curvpolygon), - PG_TEST(test_wkt_in_multicurve), - PG_TEST(test_wkt_in_multisurface), - PG_TEST(test_wkt_in_tin), - PG_TEST(test_wkt_in_polyhedralsurface), - PG_TEST(test_wkt_in_errlocation), - CU_TEST_INFO_NULL -}; -CU_SuiteInfo wkt_in_suite = {"in_wkt", init_wkt_in_suite, clean_wkt_in_suite, wkt_in_tests}; + CU_pSuite suite = CU_add_suite("WKT In Suite", init_wkt_in_suite, clean_wkt_in_suite); + PG_ADD_TEST(suite, test_wkt_in_point); + PG_ADD_TEST(suite, test_wkt_in_linestring); + PG_ADD_TEST(suite, test_wkt_in_polygon); + PG_ADD_TEST(suite, test_wkt_in_multipoint); + PG_ADD_TEST(suite, test_wkt_in_multilinestring); + PG_ADD_TEST(suite, test_wkt_in_multipolygon); + PG_ADD_TEST(suite, test_wkt_in_collection); + PG_ADD_TEST(suite, test_wkt_in_circularstring); + PG_ADD_TEST(suite, test_wkt_in_compoundcurve); + PG_ADD_TEST(suite, test_wkt_in_curvpolygon); + PG_ADD_TEST(suite, test_wkt_in_multicurve); + PG_ADD_TEST(suite, test_wkt_in_multisurface); + PG_ADD_TEST(suite, test_wkt_in_tin); + PG_ADD_TEST(suite, test_wkt_in_polyhedralsurface); + PG_ADD_TEST(suite, test_wkt_in_errlocation); +} diff --git a/liblwgeom/cunit/cu_out_wkb.c b/liblwgeom/cunit/cu_out_wkb.c index cabffac0c..d6c37a203 100644 --- a/liblwgeom/cunit/cu_out_wkb.c +++ b/liblwgeom/cunit/cu_out_wkb.c @@ -175,22 +175,21 @@ static void test_wkb_out_polyhedralsurface(void) /* ** Used by test harness to register the tests in this file. */ - -CU_TestInfo wkb_out_tests[] = +void wkb_out_suite_setup(void); +void wkb_out_suite_setup(void) { - PG_TEST(test_wkb_out_point), - PG_TEST(test_wkb_out_linestring), - PG_TEST(test_wkb_out_polygon), - PG_TEST(test_wkb_out_multipoint), - PG_TEST(test_wkb_out_multilinestring), - PG_TEST(test_wkb_out_multipolygon), - PG_TEST(test_wkb_out_collection), - PG_TEST(test_wkb_out_circularstring), - PG_TEST(test_wkb_out_compoundcurve), - PG_TEST(test_wkb_out_curvpolygon), - PG_TEST(test_wkb_out_multicurve), - PG_TEST(test_wkb_out_multisurface), - PG_TEST(test_wkb_out_polyhedralsurface), - CU_TEST_INFO_NULL -}; -CU_SuiteInfo wkb_out_suite = {"WKB Out Suite", init_wkb_out_suite, clean_wkb_out_suite, wkb_out_tests}; + CU_pSuite suite = CU_add_suite("WKB Out Suite", init_wkb_out_suite, clean_wkb_out_suite); + PG_ADD_TEST(suite, test_wkb_out_point); + PG_ADD_TEST(suite, test_wkb_out_linestring); + PG_ADD_TEST(suite, test_wkb_out_polygon); + PG_ADD_TEST(suite, test_wkb_out_multipoint); + PG_ADD_TEST(suite, test_wkb_out_multilinestring); + PG_ADD_TEST(suite, test_wkb_out_multipolygon); + PG_ADD_TEST(suite, test_wkb_out_collection); + PG_ADD_TEST(suite, test_wkb_out_circularstring); + PG_ADD_TEST(suite, test_wkb_out_compoundcurve); + PG_ADD_TEST(suite, test_wkb_out_curvpolygon); + PG_ADD_TEST(suite, test_wkb_out_multicurve); + PG_ADD_TEST(suite, test_wkb_out_multisurface); + PG_ADD_TEST(suite, test_wkb_out_polyhedralsurface); +} diff --git a/liblwgeom/cunit/cu_out_wkt.c b/liblwgeom/cunit/cu_out_wkt.c index 1af867a30..8cfea62ef 100644 --- a/liblwgeom/cunit/cu_out_wkt.c +++ b/liblwgeom/cunit/cu_out_wkt.c @@ -208,21 +208,20 @@ static void test_wkt_out_multisurface(void) /* ** Used by test harness to register the tests in this file. */ - -CU_TestInfo wkt_out_tests[] = -{ - PG_TEST(test_wkt_out_point), - PG_TEST(test_wkt_out_linestring), - PG_TEST(test_wkt_out_polygon), - PG_TEST(test_wkt_out_multipoint), - PG_TEST(test_wkt_out_multilinestring), - PG_TEST(test_wkt_out_multipolygon), - PG_TEST(test_wkt_out_collection), - PG_TEST(test_wkt_out_circularstring), - PG_TEST(test_wkt_out_compoundcurve), - PG_TEST(test_wkt_out_curvpolygon), - PG_TEST(test_wkt_out_multicurve), - PG_TEST(test_wkt_out_multisurface), - CU_TEST_INFO_NULL -}; -CU_SuiteInfo wkt_out_suite = {"WKT Out Suite", init_wkt_out_suite, clean_wkt_out_suite, wkt_out_tests}; +void wkt_out_suite_setup(void); +void wkt_out_suite_setup(void) +{ + CU_pSuite suite = CU_add_suite("WKT Out Suite", init_wkt_out_suite, clean_wkt_out_suite); + PG_ADD_TEST(suite, test_wkt_out_point); + PG_ADD_TEST(suite, test_wkt_out_linestring); + PG_ADD_TEST(suite, test_wkt_out_polygon); + PG_ADD_TEST(suite, test_wkt_out_multipoint); + PG_ADD_TEST(suite, test_wkt_out_multilinestring); + PG_ADD_TEST(suite, test_wkt_out_multipolygon); + PG_ADD_TEST(suite, test_wkt_out_collection); + PG_ADD_TEST(suite, test_wkt_out_circularstring); + PG_ADD_TEST(suite, test_wkt_out_compoundcurve); + PG_ADD_TEST(suite, test_wkt_out_curvpolygon); + PG_ADD_TEST(suite, test_wkt_out_multicurve); + PG_ADD_TEST(suite, test_wkt_out_multisurface); +} diff --git a/liblwgeom/cunit/cu_surface.c b/liblwgeom/cunit/cu_surface.c index c9badf7f1..e64e9c74d 100644 --- a/liblwgeom/cunit/cu_surface.c +++ b/liblwgeom/cunit/cu_surface.c @@ -401,15 +401,12 @@ surface_dimension(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 surface_tests[] = +void surface_suite_setup(void); +void surface_suite_setup(void) { - PG_TEST(triangle_parse), - PG_TEST(tin_parse), - PG_TEST(polyhedralsurface_parse), - PG_TEST(surface_dimension), - CU_TEST_INFO_NULL -}; -CU_SuiteInfo surface_suite = {"surface", NULL, NULL, surface_tests}; + CU_pSuite suite = CU_add_suite("surface", NULL, NULL); + PG_ADD_TEST(suite, triangle_parse); + PG_ADD_TEST(suite, tin_parse); + PG_ADD_TEST(suite, polyhedralsurface_parse); + PG_ADD_TEST(suite, surface_dimension); +} diff --git a/liblwgeom/cunit/cu_tester.c b/liblwgeom/cunit/cu_tester.c index e801f5af0..f21bd53e5 100644 --- a/liblwgeom/cunit/cu_tester.c +++ b/liblwgeom/cunit/cu_tester.c @@ -53,6 +53,12 @@ extern void stringbuffer_suite_setup(void); extern void tree_suite_setup(void); extern void triangulate_suite_setup(void); extern void varint_suite_setup(void); +extern void wkt_out_suite_setup(void); +extern void wkb_out_suite_setup(void); +extern void surface_suite_setup(void); +extern void wkb_in_suite_setup(void); +extern void wkt_in_suite_setup(void); + /* AND ADD YOUR SUITE SETUP FUNCTION HERE (2 of 2) */ PG_SuiteSetup setupfuncs[] = @@ -91,6 +97,11 @@ PG_SuiteSetup setupfuncs[] = tree_suite_setup, triangulate_suite_setup, varint_suite_setup, + wkt_out_suite_setup, + wkb_out_suite_setup, + surface_suite_setup, + wkb_in_suite_setup, + wkt_in_suite_setup, NULL };