diff options
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/src/pjlib-test/sock.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pjlib/src/pjlib-test/sock.c b/pjlib/src/pjlib-test/sock.c index 2eee2c5e..a3df9b63 100644 --- a/pjlib/src/pjlib-test/sock.c +++ b/pjlib/src/pjlib-test/sock.c @@ -51,6 +51,7 @@ * - pj_sock_connect() * - pj_sock_listen() * - pj_sock_accept() + * - pj_gethostbyname() * * * This file is <b>pjlib-test/sock.c</b> @@ -441,6 +442,23 @@ static int ioctl_test(void) return 0; } +static int gethostbyname_test(void) +{ + pj_str_t host; + pj_hostent he; + pj_status_t status; + + /* Testing pj_gethostbyname() with invalid host */ + host = pj_str("an-invalid-host-name"); + status = pj_gethostbyname(&host, &he); + + /* Must return failure! */ + if (status == PJ_SUCCESS) + return -20100; + else + return 0; +} + int sock_test() { int rc; @@ -451,6 +469,10 @@ int sock_test() if (rc != 0) return rc; + rc = gethostbyname_test(); + if (rc != 0) + return rc; + rc = simple_sock_test(); if (rc != 0) return rc; |