PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ perform_cluster_within_distance_test()

static void perform_cluster_within_distance_test ( double  tolerance,
char **  wkt_inputs,
uint32_t  num_inputs,
char **  wkt_outputs,
uint32_t  num_outputs 
)
static

Definition at line 120 of file cu_geos_cluster.c.

References assert_all_results_found(), cluster_within_distance(), lwfree(), lwgeom_free(), and WKTARRAY2LWGEOM().

Referenced by basic_distance_test(), basic_test(), empty_inputs_test(), nonsequential_test(), and single_input_test().

121 {
122  LWGEOM** lw_results;
123  uint32_t num_clusters;
124 
125  LWGEOM** expected_outputs = WKTARRAY2LWGEOM(wkt_outputs, num_outputs);
126  LWGEOM** lw_inputs = WKTARRAY2LWGEOM(wkt_inputs, num_inputs);
127 
128  cluster_within_distance(lw_inputs, num_inputs, tolerance, &lw_results, &num_clusters);
129 
130  CU_ASSERT_EQUAL(num_outputs, num_clusters);
131 
132  assert_all_results_found(lw_results, num_clusters, expected_outputs, num_outputs);
133 
134  /* Cleanup */
135  uint32_t i;
136  for(i = 0; i < num_outputs; i++)
137  {
138  lwgeom_free(expected_outputs[i]);
139  lwgeom_free(lw_results[i]);
140  }
141  lwfree(lw_results);
142  lwfree(expected_outputs);
143  lwfree(lw_inputs);
144 }
void lwfree(void *mem)
Definition: lwutil.c:244
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
int cluster_within_distance(LWGEOM **geoms, uint32_t num_geoms, double tolerance, LWGEOM ***clusterGeoms, uint32_t *num_clusters)
Takes an array of LWGEOM* and constructs an array of LWGEOM*, where each element in the constructed a...
static LWGEOM ** WKTARRAY2LWGEOM(char **wkt_array, size_t num_geoms)
unsigned int uint32_t
Definition: uthash.h:78
static void assert_all_results_found(LWGEOM **results, size_t num_outputs, LWGEOM **expected, size_t num_expected_outputs)
Here is the call graph for this function:
Here is the caller graph for this function: