TODO: OTP-authenticatd password change tested
[libisds.git] / test / offline / isds_message_copy_free.c
blobf57c7db34294ead2412238d82de4b817a01d616e
1 #include "../test.h"
2 #include "isds.h"
4 static int test_isds_message_copy_free(struct isds_message_copy **copy) {
5 isds_message_copy_free(copy);
6 if (!copy) PASS_TEST;
8 if (*copy)
9 FAIL_TEST("isds_message_copy_free() did not null pointer");
11 PASS_TEST;
15 int main(int argc, char **argv) {
17 INIT_TEST("isds_message_copy_free()");
18 if (isds_init())
19 ABORT_UNIT("isds_init() failed");
21 struct isds_message_copy *copy = NULL;
23 TEST("NULL", test_isds_message_copy_free, NULL);
24 TEST("*NULL", test_isds_message_copy_free, &copy);
26 TEST_CALLOC(copy);
27 TEST("Empty structure", test_isds_message_copy_free, &copy);
29 TEST_CALLOC(copy);
30 TEST_FILL_STRING(copy->dbIDRecipient);
31 TEST_FILL_STRING(copy->dmRecipientOrgUnit);
32 TEST_FILL_INT(copy->dmRecipientOrgUnitNum);
33 TEST_FILL_STRING(copy->dmToHands);
34 TEST_FILL_STRING(copy->dmStatus);
35 TEST_FILL_STRING(copy->dmID);
36 TEST("Full structure", test_isds_message_copy_free, &copy);
38 isds_cleanup();
39 SUM_TEST();