diff --git a/fvtest/porttest/omrsockTest.cpp b/fvtest/porttest/omrsockTest.cpp index 10e48afd299..c109e31540f 100644 --- a/fvtest/porttest/omrsockTest.cpp +++ b/fvtest/porttest/omrsockTest.cpp @@ -104,14 +104,33 @@ TEST(PortSockTest, per_thread_buffer_functionality) OMRPORT_ACCESS_FROM_OMRPORT(portTestEnv->getPortLibrary()); omrsock_addrinfo_t hints = NULL; + uint32_t length = 0; int32_t family = 0; - int32_t sockType = 1; - int32_t protocol = 1; - int32_t flags = 0; + int32_t sockType = 0; + int32_t protocol = 0; - OMRPORTLIB->sock_getaddrinfo_create_hints(OMRPORTLIB, &hints, family, sockType, protocol, flags); + int32_t hintsFamily = 0; + int32_t hintsSockType = 1; + int32_t hintsProtocol = 1; + int32_t hintsFlags = 0; + + OMRPORTLIB->sock_getaddrinfo_create_hints(OMRPORTLIB, &hints, hintsFamily, hintsSockType, hintsProtocol, hintsFlags); ASSERT_NE(hints, (void *)NULL); + + /* Get and verify elements of the newly created hints. */ + OMRPORTLIB->sock_getaddrinfo_length(OMRPORTLIB, hints, &length); + EXPECT_EQ(length, 0); + + OMRPORTLIB->sock_getaddrinfo_family(OMRPORTLIB, hints, &family, 0); + EXPECT_EQ(family, hintsFamily); + + OMRPORTLIB->sock_getaddrinfo_socktype(OMRPORTLIB, hints, &sockType, 0); + EXPECT_EQ(sockType, hintsSockType); + + OMRPORTLIB->sock_getaddrinfo_protocol(OMRPORTLIB, hints, &protocol, 0); + EXPECT_EQ(protocol, hintsProtocol); + } /**