Skip to content

Commit

Permalink
Change current test cases to use the new constants
Browse files Browse the repository at this point in the history
Change the family, socktype, protocols to defined constants

- Changed both test cases to accept and test new constants in
  test cases.

Issue: #4795

Signed-off-by: Haley Cao <haleycao88@hotmail.com>
  • Loading branch information
Haley Cao committed Mar 12, 2020
1 parent 245ac3a commit cd748ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fvtest/porttest/omrsockTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ TEST(PortSockTest, create_hints_and_element_extraction)
int32_t sockType = 0;
int32_t protocol = 0;

int32_t hintsFamily = 0;
int32_t hintsSockType = 1;
int32_t hintsProtocol = 1;
int32_t hintsFamily = OMRSOCK_AF_UNSPEC;
int32_t hintsSockType = OMRSOCK_STREAM;
int32_t hintsProtocol = OMRSOCK_IPPROTO_TCP;
int32_t hintsFlags = 0;

OMRPORTLIB->sock_getaddrinfo_create_hints(OMRPORTLIB, &hints, hintsFamily, hintsSockType, hintsProtocol, hintsFlags);
Expand Down Expand Up @@ -174,7 +174,7 @@ TEST(PortSockTest, create_hints_and_element_extraction)

/* Recreate hints with different parameters, see if hints elements are overwriten properly. */

hintsProtocol = 0;
hintsProtocol = OMRSOCK_IPPROTO_DEFAULT;
hintsFlags = 6;

OMRPORTLIB->sock_getaddrinfo_create_hints(OMRPORTLIB, &hints, hintsFamily, hintsSockType, hintsProtocol, hintsFlags);
Expand Down Expand Up @@ -236,9 +236,9 @@ TEST(PortSockTest, getaddrinfo_and_freeaddrinfo)
int32_t sockType = 0;
int32_t protocol = 0;

int32_t hintsFamily = 2;
int32_t hintsSockType = 1;
int32_t hintsProtocol = 0;
int32_t hintsFamily = OMRSOCK_AF_INET;
int32_t hintsSockType = OMRSOCK_STREAM;
int32_t hintsProtocol = OMRSOCK_IPPROTO_DEFAULT;
int32_t hintsFlags = 0;

rc = OMRPORTLIB->sock_getaddrinfo_create_hints(OMRPORTLIB, &hints, hintsFamily, hintsSockType, hintsProtocol, hintsFlags);
Expand Down

0 comments on commit cd748ed

Please sign in to comment.