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 #692, fix or statements #739

Merged
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
29 changes: 24 additions & 5 deletions src/tests/network-api-test/network-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ void TestDatagramNetworkApi_Setup(void)

/* OS_SocketOpen */
actual = OS_SocketOpen(&socket_id, OS_SocketDomain_INET6, OS_SocketType_DATAGRAM);
UtAssert_True(actual == OS_SUCCESS || OS_ERR_NOT_IMPLEMENTED, "OS_SocketOpen() (%ld) Passed", (long)actual);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
}
else
{
UtAssert_True(actual == OS_SUCCESS, "OS_SocketOpen() (%ld) Passed", (long)actual);
}
OS_close(socket_id);

expected = OS_INVALID_POINTER;
Expand All @@ -126,12 +133,24 @@ void TestDatagramNetworkApi_Setup(void)

/* OS_SocketAddrInit */
actual = OS_SocketAddrInit(&addr, OS_SocketDomain_INET6);
UtAssert_True(actual == OS_SUCCESS || OS_ERR_NOT_IMPLEMENTED, "OS_SocketAddrInit() (%ld) == OS_SUCCESS",
(long)actual);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
}
else
{
UtAssert_True(actual == OS_SUCCESS, "OS_SocketAddrInit() (%ld) == OS_SUCCESS", (long)actual);
}

actual = OS_SocketAddrInit(NULL, OS_SocketDomain_INET6);
UtAssert_True(actual == OS_INVALID_POINTER || OS_ERR_NOT_IMPLEMENTED,
"OS_SocketAddrInit() (%ld) == OS_INVALID_POINTER", (long)actual);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
}
else
{
UtAssert_True(actual == OS_INVALID_POINTER, "OS_SocketAddrInit() (%ld) == OS_INVALID_POINTER", (long)actual);
}

expected = OS_ERR_NOT_IMPLEMENTED;
actual = OS_SocketAddrInit(&addr, OS_SocketDomain_INVALID);
Expand Down