File: isds_Address_free.c

package info (click to toggle)
libisds 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,348 kB
  • ctags: 1,659
  • sloc: ansic: 24,898; sh: 11,772; makefile: 393; xml: 375; sed: 16
file content (40 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "../test.h"
#include "isds.h"

static int test_isds_Address_free(
        struct isds_Address **Address) {
    isds_Address_free(Address);
    if (NULL == Address) PASS_TEST;

    if (NULL != *Address)
        FAIL_TEST("isds_Address_free() did not null pointer");

    PASS_TEST;
}


int main(int argc, char **argv) {

    INIT_TEST("isds_Address_free()");
    if (isds_init())
        ABORT_UNIT("isds_init() failed");
    
    struct isds_Address *Address = NULL;
    TEST("NULL", test_isds_Address_free, NULL);
    TEST("*NULL", test_isds_Address_free, &Address);

    TEST_CALLOC(Address);
    TEST("Empty structure", test_isds_Address_free, &Address);

    TEST_CALLOC(Address);
    TEST_FILL_STRING(Address->adCity);
    TEST_FILL_STRING(Address->adStreet);
    TEST_FILL_STRING(Address->adNumberInStreet);
    TEST_FILL_STRING(Address->adNumberInMunicipality);
    TEST_FILL_STRING(Address->adZipCode);
    TEST_FILL_STRING(Address->adState);
    TEST("Full structure", test_isds_Address_free, &Address);

    isds_cleanup();
    SUM_TEST();
}