Changeset 1028


Ignore:
Timestamp:
Mar 1, 2007 6:52:39 PM (17 years ago)
Author:
bennylp
Message:

Related to ticket #148: added test in pjlib-test to capture the error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/pjproject-0.5-stable/pjlib/src/pjlib-test/sock.c

    r974 r1028  
    5252 *  - pj_sock_listen() 
    5353 *  - pj_sock_accept() 
     54 *  - pj_gethostbyname() 
    5455 * 
    5556 * 
     
    442443} 
    443444 
     445static int gethostbyname_test(void) 
     446{ 
     447    pj_str_t host; 
     448    pj_hostent he; 
     449    pj_status_t status; 
     450 
     451    /* Testing pj_gethostbyname() with invalid host */ 
     452    host = pj_str("an-invalid-host-name"); 
     453    status = pj_gethostbyname(&host, &he); 
     454 
     455    /* Must return failure! */ 
     456    if (status == PJ_SUCCESS) 
     457        return -20100; 
     458    else 
     459        return 0; 
     460} 
     461 
    444462int sock_test() 
    445463{ 
     
    449467 
    450468    rc = format_test(); 
     469    if (rc != 0) 
     470        return rc; 
     471 
     472    rc = gethostbyname_test(); 
    451473    if (rc != 0) 
    452474        return rc; 
Note: See TracChangeset for help on using the changeset viewer.