diff options
author | Riza Sulistyo <riza@teluu.com> | 2016-06-01 10:05:22 +0000 |
---|---|---|
committer | Riza Sulistyo <riza@teluu.com> | 2016-06-01 10:05:22 +0000 |
commit | 6fcd10f88dbe42aa23d88c2c10842e1905695650 (patch) | |
tree | e0126257ddeb65895dc43fc6b61859a49814cccb | |
parent | 81c94ddc0be447dbd34ee88b9589cef8b8ecf79a (diff) |
Re #1917(misc): Fix failed purity_test() on pjlib-test since getaddrinfo() might return multiple addrinfo.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5330 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjlib/src/pjlib-test/sock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pjlib/src/pjlib-test/sock.c b/pjlib/src/pjlib-test/sock.c index d1f8737a..4d17ca93 100644 --- a/pjlib/src/pjlib-test/sock.c +++ b/pjlib/src/pjlib-test/sock.c @@ -424,8 +424,8 @@ static int purity_test(void) cnt = PJ_ARRAY_SIZE(ai); rc = pj_getaddrinfo(pj_AF_UNSPEC(), &str_ip, &cnt, ai); if (rc == PJ_SUCCESS) { - pj_assert(cnt == 1); - CHECK_SA_ZERO_LEN(&ai[0].ai_addr, -70); + while (cnt--) + CHECK_SA_ZERO_LEN(&ai[0].ai_addr, -70); } } #endif @@ -759,6 +759,8 @@ static int gethostbyname_test(void) pj_hostent he; pj_status_t status; + PJ_LOG(3,("test", "...gethostbyname_test()")); + /* Testing pj_gethostbyname() with invalid host */ host = pj_str("an-invalid-host-name"); status = pj_gethostbyname(&host, &he); |