Add AIFOTicket to isds_DbUserInfo as aifo_ticket
[libisds.git] / test / offline / isds_DbUserInfo_free.c
blobe10e18aace3be6081d13cca87a0b6722f9330381
1 #include "../test.h"
2 #include "isds.h"
4 static int test_isds_DbUserInfo_free(
5 struct isds_DbUserInfo **DbUserInfo) {
6 isds_DbUserInfo_free(DbUserInfo);
7 if (!DbUserInfo) PASS_TEST;
9 if (*DbUserInfo)
10 FAIL_TEST("isds_DbUserInfo_free() did not null pointer");
12 PASS_TEST;
16 int main(void) {
18 INIT_TEST("isds_DbUserInfo_free()");
19 if (isds_init())
20 ABORT_UNIT("isds_init() failed");
22 struct isds_DbUserInfo *DbUserInfo = NULL;
23 TEST("NULL", test_isds_DbUserInfo_free, NULL);
24 TEST("*NULL", test_isds_DbUserInfo_free, &DbUserInfo);
26 TEST_CALLOC(DbUserInfo);
27 TEST("Empty structure", test_isds_DbUserInfo_free, &DbUserInfo);
29 /* Full structure */
30 TEST_CALLOC(DbUserInfo);
31 TEST_FILL_STRING(DbUserInfo->userID);
32 TEST_FILL_INT(DbUserInfo->userType)
33 TEST_FILL_INT(DbUserInfo->userPrivils);
35 TEST_CALLOC(DbUserInfo->personName); /* Name of the person */
36 TEST_FILL_STRING(DbUserInfo->personName->pnFirstName);
37 TEST_FILL_STRING(DbUserInfo->personName->pnMiddleName);
38 TEST_FILL_STRING(DbUserInfo->personName->pnLastName);
39 TEST_FILL_STRING(DbUserInfo->personName->pnLastNameAtBirth);
41 TEST_CALLOC(DbUserInfo->address); /* Post address */
42 TEST_FILL_STRING(DbUserInfo->address->adCity);
43 TEST_FILL_STRING(DbUserInfo->address->adStreet);
44 TEST_FILL_STRING(DbUserInfo->address->adNumberInStreet);
45 TEST_FILL_STRING(DbUserInfo->address->adNumberInMunicipality);
46 TEST_FILL_STRING(DbUserInfo->address->adZipCode);
47 TEST_FILL_STRING(DbUserInfo->address->adState);
49 TEST_CALLOC(DbUserInfo->biDate); /* Date of birth in local time */
50 TEST_FILL_STRING(DbUserInfo->ic);
51 TEST_FILL_STRING(DbUserInfo->firmName);
52 TEST_FILL_STRING(DbUserInfo->caStreet);
53 TEST_FILL_STRING(DbUserInfo->caCity);
54 TEST_FILL_STRING(DbUserInfo->caZipCode);
55 TEST_FILL_STRING(DbUserInfo->caState);
56 TEST_FILL_STRING(DbUserInfo->aifo_ticket);
57 TEST("Full structure", test_isds_DbUserInfo_free, &DbUserInfo);
59 isds_cleanup();
60 SUM_TEST();