6 static void destructor(void **data
) {
11 static int test_isds_list_free(struct isds_list
**list
, int destructor_hits
) {
16 if (destructor_hits
!= counter
)
17 FAIL_TEST("Destructor called wrong times: expected=%d, called=%d",
18 destructor_hits
, counter
);
23 FAIL_TEST("isds_list_free() did not null pointer");
31 INIT_TEST("isds_list_free()");
33 ABORT_UNIT("isds_init() failed");
36 /* isds_list_free() */
37 struct isds_list
*list
= NULL
;
38 TEST("NULL", test_isds_list_free
, NULL
, 0);
39 TEST("*NULL", test_isds_list_free
, &list
, 0);
42 TEST("One item without destructor", test_isds_list_free
, &list
, 0);
45 list
->destructor
= destructor
;
46 TEST("One item with destructor", test_isds_list_free
, &list
, 1);
49 list
->destructor
= destructor
;
50 TEST_CALLOC(list
->next
);
51 list
->next
->destructor
= destructor
;
52 TEST("Two items list", test_isds_list_free
, &list
, 2);