mirror of https://github.com/ARMmbed/mbed-os.git
Greentea tests ignore bind returning UNSUPPORTED
parent
ab1c2be997
commit
a2110d5411
|
@ -39,7 +39,12 @@ void TCPSOCKET_BIND_ADDRESS()
|
|||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(sockAddr));
|
||||
nsapi_error_t bind_result = sock->bind(sockAddr);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind("190.2.3.4", 1024));
|
||||
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_NULL()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(NULL, 1024));
|
||||
nsapi_error_t bind_result = sock->bind(NULL, 1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_PORT()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(get_interface()->get_ip_address(), 80));
|
||||
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void TCPSOCKET_BIND_PORT()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,14 @@ void TCPSOCKET_BIND_PORT_FAIL()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
delete sock;
|
||||
return;
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
TCPSocket *sock2 = new TCPSocket;
|
||||
if (!sock2) {
|
||||
|
|
|
@ -37,7 +37,12 @@ void TCPSOCKET_BIND_UNOPENED()
|
|||
if (!sock) {
|
||||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -40,7 +40,12 @@ void TCPSOCKET_BIND_WRONG_TYPE()
|
|||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
char addr_bytes[16] = {0xfe, 0x80, 0xff, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
SocketAddress sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind(sockAddr));
|
||||
nsapi_error_t bind_result = sock->bind(sockAddr);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -39,7 +39,12 @@ void UDPSOCKET_BIND_ADDRESS()
|
|||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(sockAddr));
|
||||
nsapi_error_t bind_result = sock->bind(sockAddr);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_INVALID()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind("190.2.3.4", 1024));
|
||||
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_NULL()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(NULL, 1024));
|
||||
nsapi_error_t bind_result = sock->bind(NULL, 1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_PORT()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(get_interface()->get_ip_address(), 80));
|
||||
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,12 @@ void UDPSOCKET_BIND_PORT()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -38,7 +38,14 @@ void UDPSOCKET_BIND_PORT_FAIL()
|
|||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
delete sock;
|
||||
return;
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
|
||||
}
|
||||
|
||||
UDPSocket *sock2 = new UDPSocket;
|
||||
if (!sock2) {
|
||||
|
|
|
@ -37,7 +37,12 @@ void UDPSOCKET_BIND_UNOPENED()
|
|||
if (!sock) {
|
||||
TEST_FAIL();
|
||||
}
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, sock->bind(1024));
|
||||
nsapi_error_t bind_result = sock->bind(1024);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
|
@ -40,7 +40,12 @@ void UDPSOCKET_BIND_WRONG_TYPE()
|
|||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
|
||||
char addr_bytes[16] = {0xfe, 0x80, 0xff, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
SocketAddress sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind(sockAddr));
|
||||
nsapi_error_t bind_result = sock->bind(sockAddr);
|
||||
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("bind() not supported");
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
|
||||
}
|
||||
|
||||
delete sock;
|
||||
|
||||
|
|
Loading…
Reference in New Issue