Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two of the three failing subtests in socket-api-tests #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/socket-api-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,10 @@ void assert_addrinfo(struct addrinfo* rp, int exp_socktype, short exp_port)
START_TEST(getaddrinfo_valid)
{
struct addrinfo *rp, *res = NULL;
struct addrinfo hints = {.ai_family = AF_UNSPEC};
struct addrinfo hints = {
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM
};

ck_assert(mm_getaddrinfo("localhost", "ssh", &hints, &res) == 0);
for (rp = res; rp != NULL; rp = rp->ai_next)
Expand Down Expand Up @@ -1013,7 +1016,7 @@ START_TEST(getaddrinfo_error)
ck_assert(mm_getaddrinfo("localhost", "joke", &hints, &res) == -1);
ck_assert_int_eq(mm_get_lasterror_number(), MM_ENOTFOUND);

hints.ai_socktype = SOCK_DGRAM;
hints.ai_socktype = SOCK_RAW;
ck_assert(mm_getaddrinfo("localhost", "ssh", &hints, &res) == -1);
ck_assert_int_eq(mm_get_lasterror_number(), MM_ENOTFOUND);
hints.ai_socktype = 0;
Expand Down