4 static int test_isds_credit_event_free(
5 struct isds_credit_event
**event
) {
6 isds_credit_event_free(event
);
10 FAIL_TEST("isds_credit_event_free() did not null pointer");
16 int main(int argc
, char **argv
) {
17 INIT_TEST("isds_credit_event_free()");
19 ABORT_UNIT("isds_init() failed");
21 struct isds_credit_event
*event
= NULL
;
22 TEST("NULL", test_isds_credit_event_free
, NULL
);
23 TEST("*NULL", test_isds_credit_event_free
, &event
);
26 TEST("Empty structure", test_isds_credit_event_free
, &event
);
29 TEST_CALLOC(event
->time
);
30 event
->type
= ISDS_CREDIT_CHARGED
;
31 TEST_FILL_STRING(event
->details
.charged
.transaction
);
32 TEST("Full structure ISDS_CREDIT_CHARGED",
33 test_isds_credit_event_free
, &event
);
36 TEST_CALLOC(event
->time
);
37 event
->type
= ISDS_CREDIT_DISCHARGED
;
38 TEST_FILL_STRING(event
->details
.discharged
.transaction
);
39 TEST("Full structure ISDS_CREDIT_DISCHARGED",
40 test_isds_credit_event_free
, &event
);
43 TEST_CALLOC(event
->time
);
44 event
->type
= ISDS_CREDIT_MESSAGE_SENT
;
45 TEST_FILL_STRING(event
->details
.message_sent
.recipient
);
46 TEST_FILL_STRING(event
->details
.message_sent
.message_id
);
47 TEST("Full structure ISDS_CREDIT_MESSAGE_SENT",
48 test_isds_credit_event_free
, &event
);
51 TEST_CALLOC(event
->time
);
52 event
->type
= ISDS_CREDIT_STORAGE_SET
;
53 TEST_CALLOC(event
->details
.storage_set
.new_valid_from
);
54 TEST_CALLOC(event
->details
.storage_set
.new_valid_to
);
55 TEST_FILL_INT(event
->details
.storage_set
.old_capacity
);
56 TEST_CALLOC(event
->details
.storage_set
.old_valid_from
);
57 TEST_CALLOC(event
->details
.storage_set
.old_valid_to
);
58 TEST_FILL_STRING(event
->details
.storage_set
.initiator
);
59 TEST("Full structure ISDS_CREDIT_STORAGE_SET",
60 test_isds_credit_event_free
, &event
);