tests: Adapt utf8locale to musl
[libisds.git] / test / offline / isds_DbOwnerInfo_free.c
blob6ec667a0ddfea507b6ea76968ada354df037d256
1 #include "../test.h"
2 #include "isds.h"
4 static int test_isds_DbOwnerInfo_free(
5 struct isds_DbOwnerInfo **DbOwnerInfo) {
6 isds_DbOwnerInfo_free(DbOwnerInfo);
7 if (!DbOwnerInfo) PASS_TEST;
9 if (*DbOwnerInfo)
10 FAIL_TEST("isds_DbOwnerInfo_free() did not null pointer");
12 PASS_TEST;
16 int main(void) {
18 INIT_TEST("isds_DbOwnerInfo_free()");
19 if (isds_init())
20 ABORT_UNIT("isds_init() failed");
22 struct isds_DbOwnerInfo *DbOwnerInfo = NULL;
23 TEST("NULL", test_isds_DbOwnerInfo_free, NULL);
24 TEST("*NULL", test_isds_DbOwnerInfo_free, &DbOwnerInfo);
26 TEST_CALLOC(DbOwnerInfo);
27 TEST("Empty structure", test_isds_DbOwnerInfo_free, &DbOwnerInfo);
30 /* Full structure */
31 TEST_CALLOC(DbOwnerInfo);
32 TEST_FILL_STRING(DbOwnerInfo->dbID);
33 TEST_FILL_INT(DbOwnerInfo->dbType);
34 TEST_FILL_STRING(DbOwnerInfo->ic);
36 TEST_CALLOC(DbOwnerInfo->personName); /* Name of person */
37 TEST_FILL_STRING(DbOwnerInfo->personName->pnFirstName);
38 TEST_FILL_STRING(DbOwnerInfo->personName->pnMiddleName);
39 TEST_FILL_STRING(DbOwnerInfo->personName->pnLastName);
40 TEST_FILL_STRING(DbOwnerInfo->personName->pnLastNameAtBirth);
42 TEST_FILL_STRING(DbOwnerInfo->firmName);
44 TEST_CALLOC(DbOwnerInfo->birthInfo); /* Birth of person */
45 TEST_CALLOC(DbOwnerInfo->birthInfo->biDate); /* Date of Birth */
46 TEST_FILL_STRING(DbOwnerInfo->birthInfo->biCity);
47 TEST_FILL_STRING(DbOwnerInfo->birthInfo->biCounty);
48 TEST_FILL_STRING(DbOwnerInfo->birthInfo->biState);
50 TEST_CALLOC(DbOwnerInfo->address); /* Post address */
51 TEST_FILL_STRING(DbOwnerInfo->address->adCity);
52 TEST_FILL_STRING(DbOwnerInfo->address->adStreet);
53 TEST_FILL_STRING(DbOwnerInfo->address->adNumberInStreet);
54 TEST_FILL_STRING(DbOwnerInfo->address->adNumberInMunicipality);
55 TEST_FILL_STRING(DbOwnerInfo->address->adZipCode);
56 TEST_FILL_STRING(DbOwnerInfo->address->adState);
58 TEST_FILL_STRING(DbOwnerInfo->nationality);
59 TEST_FILL_STRING(DbOwnerInfo->email);
60 TEST_FILL_STRING(DbOwnerInfo->telNumber);
61 TEST_FILL_STRING(DbOwnerInfo->identifier);
62 TEST_FILL_INT(DbOwnerInfo->aifoIsds);
63 TEST_FILL_STRING(DbOwnerInfo->registryCode);
64 TEST_FILL_INT(DbOwnerInfo->dbState);
65 TEST_FILL_INT(DbOwnerInfo->dbEffectiveOVM);
66 TEST_FILL_INT(DbOwnerInfo->dbOpenAddressing);
67 TEST("Full structure", test_isds_DbOwnerInfo_free, &DbOwnerInfo);
69 isds_cleanup();
70 SUM_TEST();