PostGIS  2.2.7dev-r@@SVN_REVISION@@
static void test_unionfind_create ( void  )
static

Definition at line 18 of file cu_unionfind.c.

References UNIONFIND::cluster_sizes, UNIONFIND::clusters, UNIONFIND::N, UNIONFIND::num_clusters, UF_create(), and UF_destroy().

Referenced by unionfind_suite_setup().

19 {
20  UNIONFIND *uf = UF_create(10);
21 
22  uint32_t expected_initial_ids[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
23  uint32_t expected_initial_sizes[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
24 
25  CU_ASSERT_EQUAL(10, uf->N);
26  CU_ASSERT_EQUAL(10, uf->num_clusters);
27  CU_ASSERT_EQUAL(0, memcmp(uf->clusters, expected_initial_ids, 10*sizeof(uint32_t)));
28  CU_ASSERT_EQUAL(0, memcmp(uf->cluster_sizes, expected_initial_sizes, 10*sizeof(uint32_t)));
29 
30  UF_destroy(uf);
31 }
void UF_destroy(UNIONFIND *uf)
Definition: lwunionfind.c:40
uint32_t * clusters
Definition: lwunionfind.h:20
uint32_t * cluster_sizes
Definition: lwunionfind.h:21
uint32_t N
Definition: lwunionfind.h:23
uint32_t num_clusters
Definition: lwunionfind.h:22
UNIONFIND * UF_create(uint32_t N)
Definition: lwunionfind.c:21

Here is the call graph for this function:

Here is the caller graph for this function: