4 static int compare_isds_PersonName(
5 const struct isds_PersonName
*expected_result
,
6 const struct isds_PersonName
*result
) {
8 TEST_POINTER_DUPLICITY(expected_result
, result
);
9 if (NULL
== expected_result
)
12 TEST_STRING_DUPLICITY(expected_result
->pnFirstName
, result
->pnFirstName
);
13 TEST_STRING_DUPLICITY(expected_result
->pnMiddleName
, result
->pnMiddleName
);
14 TEST_STRING_DUPLICITY(expected_result
->pnLastName
, result
->pnLastName
);
15 TEST_STRING_DUPLICITY(expected_result
->pnLastNameAtBirth
,
16 result
->pnLastNameAtBirth
);
21 static int compare_isds_BirthInfo(
22 const struct isds_BirthInfo
*expected_result
,
23 const struct isds_BirthInfo
*result
) {
25 TEST_POINTER_DUPLICITY(expected_result
, result
);
26 if (NULL
== expected_result
)
29 TEST_TMPTR_DUPLICITY(expected_result
->biDate
, result
->biDate
);
30 TEST_STRING_DUPLICITY(expected_result
->biCity
, result
->biCity
);
31 TEST_STRING_DUPLICITY(expected_result
->biCounty
, result
->biCounty
);
32 TEST_STRING_DUPLICITY(expected_result
->biState
, result
->biState
);
37 static int compare_isds_Address(
38 const struct isds_Address
*expected_result
,
39 const struct isds_Address
*result
) {
41 TEST_POINTER_DUPLICITY(expected_result
, result
);
42 if (NULL
== expected_result
)
45 TEST_INTPTR_DUPLICITY(expected_result
->adCode
, result
->adCode
);
46 TEST_STRING_DUPLICITY(expected_result
->adCity
, result
->adCity
);
47 TEST_STRING_DUPLICITY(expected_result
->adDistrict
, result
->adDistrict
);
48 TEST_STRING_DUPLICITY(expected_result
->adStreet
, result
->adStreet
);
49 TEST_STRING_DUPLICITY(expected_result
->adNumberInStreet
,
50 result
->adNumberInStreet
);
51 TEST_STRING_DUPLICITY(expected_result
->adNumberInMunicipality
,
52 result
->adNumberInMunicipality
);
53 TEST_STRING_DUPLICITY(expected_result
->adZipCode
, result
->adZipCode
);
54 TEST_STRING_DUPLICITY(expected_result
->adState
, result
->adState
);
60 /* Compare isds_DbOwnerInfo.
61 * @return 0 if equaled, 1 otherwise. */
62 static int compare_isds_DbOwnerInfo(
63 const struct isds_DbOwnerInfo
*expected_result
,
64 const struct isds_DbOwnerInfo
*result
) {
66 TEST_POINTER_DUPLICITY(expected_result
, result
);
67 if (NULL
== expected_result
)
70 TEST_STRING_DUPLICITY(expected_result
->dbID
, result
->dbID
);
71 TEST_INTPTR_DUPLICITY(expected_result
->dbType
, result
->dbType
);
72 TEST_STRING_DUPLICITY(expected_result
->ic
, result
->ic
);
73 if (compare_isds_PersonName(expected_result
->personName
,
76 TEST_STRING_DUPLICITY(expected_result
->firmName
, result
->firmName
);
77 if (compare_isds_BirthInfo(expected_result
->birthInfo
, result
->birthInfo
))
79 if (compare_isds_Address(expected_result
->address
, result
->address
))
81 TEST_STRING_DUPLICITY(expected_result
->nationality
, result
->nationality
);
82 TEST_STRING_DUPLICITY(expected_result
->email
, result
->email
);
83 TEST_STRING_DUPLICITY(expected_result
->telNumber
, result
->telNumber
);
84 TEST_STRING_DUPLICITY(expected_result
->identifier
, result
->identifier
);
85 TEST_BOOLEANPTR_DUPLICITY(expected_result
->aifoIsds
, result
->aifoIsds
);
86 TEST_STRING_DUPLICITY(expected_result
->registryCode
, result
->registryCode
);
87 TEST_INTPTR_DUPLICITY(expected_result
->dbState
, result
->dbState
);
88 TEST_BOOLEANPTR_DUPLICITY(expected_result
->dbEffectiveOVM
,
89 result
->dbEffectiveOVM
);
90 TEST_BOOLEANPTR_DUPLICITY(expected_result
->dbOpenAddressing
,
91 result
->dbOpenAddressing
);
96 /* Compare list of isds_DbOwnerInfo structures.
97 * @return 0 if equaled, 1 otherwise and set failure reason. */
98 int compare_isds_DbOwnerInfo_lists(const struct isds_list
*expected_list
,
99 const struct isds_list
*list
) {
100 const struct isds_list
*expected_item
, *item
;
103 for (i
= 1, expected_item
= expected_list
, item
= list
;
104 NULL
!= expected_item
&& NULL
!= item
;
105 i
++, expected_item
= expected_item
->next
, item
= item
->next
) {
106 if (compare_isds_DbOwnerInfo(
107 (struct isds_DbOwnerInfo
*)expected_item
->data
,
108 (struct isds_DbOwnerInfo
*)item
->data
))
111 if (NULL
!= expected_item
&& NULL
== item
)
112 FAIL_TEST("Result list is missing %d. item", i
);
113 if (NULL
== expected_item
&& NULL
!= item
)
114 FAIL_TEST("Result list has superfluous %d. item", i
);