test: Add isds_Address_free tests
[libisds.git] / test / offline / isds_Address_free.c
blob2ecfb92ad00794559743bbfefc270fea04d66b6c
1 #include "../test.h"
2 #include "isds.h"
4 static int test_isds_Address_free(
5 struct isds_Address **Address) {
6 isds_Address_free(Address);
7 if (NULL == Address) PASS_TEST;
9 if (NULL != *Address)
10 FAIL_TEST("isds_Address_free() did not null pointer");
12 PASS_TEST;
16 int main(int argc, char **argv) {
18 INIT_TEST("isds_Address_free()");
19 if (isds_init())
20 ABORT_UNIT("isds_init() failed");
22 struct isds_Address *Address = NULL;
23 TEST("NULL", test_isds_Address_free, NULL);
24 TEST("*NULL", test_isds_Address_free, &Address);
26 TEST_CALLOC(Address);
27 TEST("Empty structure", test_isds_Address_free, &Address);
29 TEST_CALLOC(Address);
30 TEST_FILL_STRING(Address->adCity);
31 TEST_FILL_STRING(Address->adStreet);
32 TEST_FILL_STRING(Address->adNumberInStreet);
33 TEST_FILL_STRING(Address->adNumberInMunicipality);
34 TEST_FILL_STRING(Address->adZipCode);
35 TEST_FILL_STRING(Address->adState);
36 TEST("Full structure", test_isds_Address_free, &Address);
38 isds_cleanup();
39 SUM_TEST();