diff options
author | Elliott Hughes <enh@google.com> | 2014-10-24 20:18:10 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-24 20:18:10 +0000 |
commit | e5871841f26c13f5aba2ca9f67b381ab7d4bd9ce (patch) | |
tree | b072b584a69b98e57d564a1c47235006e8c0e9ff | |
parent | 4e70df187b3d31273976dd09777548397a071476 (diff) | |
parent | 6a425bbe5ff6cafe4baa3db80c06eb3a5afdf08f (diff) | |
download | extras-e5871841f26c13f5aba2ca9f67b381ab7d4bd9ce.tar.gz |
am 6a425bbe: Merge "bionic libc test: remove getaddrinfo test"
* commit '6a425bbe5ff6cafe4baa3db80c06eb3a5afdf08f':
bionic libc test: remove getaddrinfo test
-rw-r--r-- | tests/bionic/libc/Android.mk | 1 | ||||
-rw-r--r-- | tests/bionic/libc/common/test_getaddrinfo.c | 44 |
2 files changed, 0 insertions, 45 deletions
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk index 226f7fa9..2f16ea65 100644 --- a/tests/bionic/libc/Android.mk +++ b/tests/bionic/libc/Android.mk @@ -62,7 +62,6 @@ endef sources := \ common/test_executable_destructor.c \ - common/test_getaddrinfo.c \ common/test_gethostbyname.c \ common/test_gethostname.c \ common/test_pthread_mutex.c \ diff --git a/tests/bionic/libc/common/test_getaddrinfo.c b/tests/bionic/libc/common/test_getaddrinfo.c deleted file mode 100644 index 444bef8e..00000000 --- a/tests/bionic/libc/common/test_getaddrinfo.c +++ /dev/null @@ -1,44 +0,0 @@ -/* this program is used to test that getaddrinfo() works correctly - * without a 'hints' argument - */ - -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> - -#include <stdio.h> /* for printf */ -#include <string.h> /* for memset */ -#include <netinet/in.h> /* for IPPROTO_TCP */ - -#define SERVER_NAME "www.android.com" -#define PORT_NUMBER "9999" - -int main(void) -{ - struct addrinfo hints; - struct addrinfo* res; - int ret; - - /* first, try without any hints */ - ret = getaddrinfo( SERVER_NAME, PORT_NUMBER, NULL, &res); - if (ret != 0) { - printf("first getaddrinfo returned error: %s\n", gai_strerror(ret)); - return 1; - } - - freeaddrinfo(res); - - /* now try with the hints */ - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - - ret = getaddrinfo( SERVER_NAME, PORT_NUMBER, &hints, &res ); - if (ret != 0) { - printf("second getaddrinfo returned error: %s\n", gai_strerror(ret)); - return 1; - } - - return 0; -} |