am 66bae426: am 7f558f60: am cf8ea37f: Merge "bionic/tests: migrate gethostbyname bionic test from system/extra to bionic/tests"
* commit '66bae4262aa0c516181e6177f371c5e9223b665a': bionic/tests: migrate gethostbyname bionic test from system/extra to bionic/tests
This commit is contained in:
commit
74b96b47f3
@ -55,3 +55,13 @@ TEST(netdb, getnameinfo_salen) {
|
|||||||
ASSERT_STREQ("::", tmp);
|
ASSERT_STREQ("::", tmp);
|
||||||
ASSERT_EQ(EAI_FAMILY, getnameinfo(sa, too_little, tmp, sizeof(tmp), NULL, 0, NI_NUMERICHOST));
|
ASSERT_EQ(EAI_FAMILY, getnameinfo(sa, too_little, tmp, sizeof(tmp), NULL, 0, NI_NUMERICHOST));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(netdb, gethostbyname) {
|
||||||
|
hostent* hent = gethostbyname("localhost");
|
||||||
|
ASSERT_TRUE(hent != NULL);
|
||||||
|
ASSERT_EQ(hent->h_addrtype, AF_INET);
|
||||||
|
ASSERT_EQ(hent->h_addr[0], 127);
|
||||||
|
ASSERT_EQ(hent->h_addr[1], 0);
|
||||||
|
ASSERT_EQ(hent->h_addr[2], 0);
|
||||||
|
ASSERT_EQ(hent->h_addr[3], 1);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user