PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_unionfind_create()

static void test_unionfind_create ( void  )
static

Definition at line 18 of file cu_unionfind.c.

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  ASSERT_INT_EQUAL(uf->N, 10);
27  ASSERT_INTARRAY_EQUAL(uf->clusters, expected_initial_ids, 10);
28  ASSERT_INTARRAY_EQUAL(uf->cluster_sizes, expected_initial_sizes, 10);
29 
30  UF_destroy(uf);
31 }
#define ASSERT_INT_EQUAL(o, e)
#define ASSERT_INTARRAY_EQUAL(o, e, n)
void UF_destroy(UNIONFIND *uf)
Definition: lwunionfind.c:53
UNIONFIND * UF_create(uint32_t N)
Definition: lwunionfind.c:34
uint32_t N
Definition: lwunionfind.h:36
uint32_t * cluster_sizes
Definition: lwunionfind.h:34
uint32_t * clusters
Definition: lwunionfind.h:33
uint32_t num_clusters
Definition: lwunionfind.h:35
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by unionfind_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: