5 static int test_isds_DbUserInfo_duplicate(struct isds_DbUserInfo
*origin
) {
6 struct isds_DbUserInfo
*copy
= isds_DbUserInfo_duplicate(origin
);
7 TEST_DESTRUCTOR((void (*)(void *))isds_DbUserInfo_free
, ©
);
11 FAIL_TEST("Duplicate of NULL should be NULL");
16 FAIL_TEST("isds_DbUserInfo_duplicate() returned NULL instead of "
19 TEST_STRING_DUPLICITY(origin
->userID
, copy
->userID
);
20 TEST_INTPTR_DUPLICITY(origin
->userType
, copy
->userType
);
21 TEST_INTPTR_DUPLICITY(origin
->userPrivils
, copy
->userPrivils
);
24 TEST_POINTER_DUPLICITY(origin
->personName
, copy
->personName
);
25 if (origin
->personName
&& copy
->personName
) {
26 TEST_STRING_DUPLICITY(origin
->personName
->pnFirstName
,
27 copy
->personName
->pnFirstName
);
28 TEST_STRING_DUPLICITY(origin
->personName
->pnMiddleName
,
29 copy
->personName
->pnMiddleName
);
30 TEST_STRING_DUPLICITY(origin
->personName
->pnLastName
,
31 copy
->personName
->pnLastName
);
32 TEST_STRING_DUPLICITY(origin
->personName
->pnLastNameAtBirth
,
33 copy
->personName
->pnLastNameAtBirth
);
37 TEST_POINTER_DUPLICITY(origin
->address
, copy
->address
);
38 if (origin
->address
&& copy
->address
) {
39 TEST_STRING_DUPLICITY(origin
->address
->adCity
,
40 copy
->address
->adCity
);
41 TEST_STRING_DUPLICITY(origin
->address
->adStreet
,
42 copy
->address
->adStreet
);
43 TEST_STRING_DUPLICITY(origin
->address
->adNumberInStreet
,
44 copy
->address
->adNumberInStreet
);
45 TEST_STRING_DUPLICITY(origin
->address
->adNumberInMunicipality
,
46 copy
->address
->adNumberInMunicipality
);
47 TEST_STRING_DUPLICITY(origin
->address
->adZipCode
,
48 copy
->address
->adZipCode
);
49 TEST_STRING_DUPLICITY(origin
->address
->adState
,
50 copy
->address
->adState
);
53 TEST_TMPTR_DUPLICITY(origin
->biDate
, copy
->biDate
);
54 TEST_INTPTR_DUPLICITY(origin
->ic
, copy
->ic
);
55 TEST_INTPTR_DUPLICITY(origin
->firmName
, copy
->firmName
);
56 TEST_INTPTR_DUPLICITY(origin
->caStreet
, copy
->caStreet
);
57 TEST_INTPTR_DUPLICITY(origin
->caCity
, copy
->caCity
);
58 TEST_INTPTR_DUPLICITY(origin
->caZipCode
, copy
->caZipCode
);
59 TEST_INTPTR_DUPLICITY(origin
->caState
, copy
->caState
);
60 TEST_INTPTR_DUPLICITY(origin
->aifo_ticket
, copy
->aifo_ticket
);
68 INIT_TEST("isds_DbUserInfo_duplicate()");
70 ABORT_UNIT("isds_init() failed");
72 TEST("NULL", test_isds_DbUserInfo_duplicate
, NULL
);
74 struct isds_DbUserInfo empty
;
75 memset(&empty
, 0, sizeof(empty
));
76 TEST("Empty structure", test_isds_DbUserInfo_duplicate
, &empty
);
79 isds_UserType UserType
= 2;
80 long int UserPrivils
= 3;
81 struct isds_PersonName PersonName
= {
85 .pnLastNameAtBirth
= "P4"
87 struct isds_Address Address
= {
90 .adNumberInStreet
= "A3",
91 .adNumberInMunicipality
= "A4",
100 struct isds_DbUserInfo full
= {
102 .userType
= &UserType
,
103 .userPrivils
= &UserPrivils
,
104 .personName
= &PersonName
,
115 TEST("Full structure", test_isds_DbUserInfo_duplicate
, &full
);