summaryrefslogtreecommitdiff
path: root/tests/netdb_test.cpp
AgeCommit message (Collapse)Author
2018-08-02Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
2017-10-23Improve glibc compatibility of gethostby*_r functions.Elliott Hughes
And add more tests. Bug: N/A (but I'm here because a recent test broke existing tests) Test: ran tests Change-Id: Ib78430f179b43484a49bb50ff447ea6870c1ee3a
2017-10-15Complete <netdb.h>.Elliott Hughes
Add all the missing <netdb.h> functions. Also fix getservbyport to handle a null protocol correctly. Also fix getservbyname/getservbyport to not interfere with getservent. Also fix endservent to reset getservent iteration. Also reduce unnecessary differences from upstream NetBSD sethostent.c. The servent implementation is still horrific, and we should probably support protoent too so that debugging tools can use getprotobyname/getprotobynumber. Bug: N/A Test: ran tests Change-Id: I639108c46df0a768af297cf3bbce857cb1bef9d9
2015-01-13Test that ip6-localhost exists in etc/hosts.Yabin Cui
Addition change: make netdb_test pass on host. Bug: 18791191 Change-Id: I7a9e29aa559ff6557288b47323d8a436379201a2
2015-01-08Fix freeaddrinfo(NULL).Elliott Hughes
Bug: https://code.google.com/p/android/issues/detail?id=13228 Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
2014-12-17Sync with upstream for gethnamaddr.c.Yabin Cui
Bug: 18566967 Change-Id: I37e7410226b49eec67614e20b2c1d5e3e47817a5
2014-11-16Add getaddrinfo(3) tests for NULL arguments.Elliott Hughes
According to https://github.com/ukanth/afwall/pull/213 some OEMs have shipped a getaddrinfo(3) that crashes given NULL hostnames. Change-Id: I9cea5fdd68546b7c64cf47e10e2b2b4d672b69d0
2014-10-22Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).Derek Xue
This change is to migrate the getaddrinfo tests defined in the old file system/extras/tests/bionic/libc/common/test_getaddrinfo.c to the new place bionic/tests/netdb_test.cpp. The test here is more thorough, and catches a bug in getservbyname(3) that was breaking getaddrinfo(3)'s ability to look up services by name without a hint that would cause it to ask for a specific protocol. Change-Id: Ief5ebd0869496d1bc6a97861dfefa04bdf24bab1 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-22bionic/tests: migrate gethostbyname bionic test from system/extra to ↵Derek Xue
bionic/tests this change migrate the gethostbyname test defined in the old file system/extras/tests/bionic/libc/common/test_gethostbyname.c to the new place bionic/tests/netdb_test.cpp Change-Id: I342171090f681581fb54d68ea4a09adf61f52081 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2013-02-13Update getnameinfo.c, remove dead code, and fix error reporting.Elliott Hughes
Also add a unit test for the salen size checking. Bug: 1889275 Change-Id: I8ec4107df9e2e9a8571e8915525249c6e44b98ad
2013-02-13Add a test that getaddrinfo works when hints are NULL.Elliott Hughes
Bug: 1827911 Change-Id: I9e1b774c44c10a8c5391bcf3baf1607f50eaf214