Use finishGEOS to remove valgrind noise in unit tests

Closes https://github.com/postgis/postgis/pull/571
This commit is contained in:
Raúl Marín 2020-07-28 12:17:03 +02:00
parent da2b1d8a0a
commit a714a46803
4 changed files with 34 additions and 4 deletions

View file

@ -15,6 +15,7 @@
#include "liblwgeom.h"
#include "liblwgeom_internal.h"
#include "../lwgeom_geos.h"
static void test_lwgeom_node(void)
{
@ -58,12 +59,19 @@ static void test_lwgeom_node(void)
lwfree(tmp); lwgeom_free(out); lwgeom_free(in);
}
static int
clean_geos_node_suite(void)
{
finishGEOS();
return 0;
}
/*
** Used by test harness to register the tests in this file.
*/
void node_suite_setup(void);
void node_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("noding", NULL, NULL);
CU_pSuite suite = CU_add_suite("noding", NULL, clean_geos_node_suite);
PG_ADD_TEST(suite, test_lwgeom_node);
}

View file

@ -15,6 +15,7 @@
#include "liblwgeom.h"
#include "liblwgeom_internal.h"
#include "../lwgeom_geos.h"
static void test_lwline_split_by_point_to(void)
{
@ -274,6 +275,12 @@ static void test_lwgeom_split(void)
lwgeom_free(blade);
}
static int
clean_geos_split_suite(void)
{
finishGEOS();
return 0;
}
/*
** Used by test harness to register the tests in this file.
@ -281,7 +288,7 @@ static void test_lwgeom_split(void)
void split_suite_setup(void);
void split_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("split", NULL, NULL);
CU_pSuite suite = CU_add_suite("split", NULL, clean_geos_split_suite);
PG_ADD_TEST(suite, test_lwline_split_by_point_to);
PG_ADD_TEST(suite, test_lwgeom_split);
}

View file

@ -15,6 +15,7 @@
#include "cu_tester.h"
#include "liblwgeom_internal.h"
#include "../lwgeom_geos.h"
static void
test_lwgeom_delaunay_triangulation(void)
@ -102,6 +103,13 @@ test_lwgeom_voronoi_diagram_expected_empty(void)
assert_empty_diagram("MULTIPOINT (0 0, 0 0.00001)", 0.001);
}
static int
clean_geos_triangulate_suite(void)
{
finishGEOS();
return 0;
}
/*
** Used by test harness to register the tests in this file.
*/
@ -109,7 +117,7 @@ void triangulate_suite_setup(void);
void
triangulate_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("triangulate", NULL, NULL);
CU_pSuite suite = CU_add_suite("triangulate", NULL, clean_geos_triangulate_suite);
PG_ADD_TEST(suite, test_lwgeom_delaunay_triangulation);
PG_ADD_TEST(suite, test_lwgeom_voronoi_diagram);
PG_ADD_TEST(suite, test_lwgeom_voronoi_diagram_expected_empty);

View file

@ -15,6 +15,7 @@
#include "liblwgeom.h"
#include "liblwgeom_internal.h"
#include "../lwgeom_geos.h"
static void test_lwgeom_wrapx(void)
{
@ -147,6 +148,12 @@ static void test_lwgeom_wrapx(void)
}
static int
clean_geos_wrapx_suite(void)
{
finishGEOS();
return 0;
}
/*
** Used by test harness to register the tests in this file.
@ -154,6 +161,6 @@ static void test_lwgeom_wrapx(void)
void wrapx_suite_setup(void);
void wrapx_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("wrapx", NULL, NULL);
CU_pSuite suite = CU_add_suite("wrapx", NULL, clean_geos_wrapx_suite);
PG_ADD_TEST(suite, test_lwgeom_wrapx);
}