Update recently added previous macro name uses in tests

pull/9067/head
kegilbert 2019-03-01 13:44:14 -06:00
parent 8cef1904c5
commit 194fa129fb
42 changed files with 74 additions and 74 deletions

View File

@ -37,7 +37,7 @@ namespace {
Timer tc_bucket; // Timer to limit a test cases run time
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
mbed_stats_socket_t tcp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
#endif
@ -126,7 +126,7 @@ int split2half_rmng_tcp_test_time()
return (tcp_global::TESTS_TIMEOUT - tc_bucket.read()) / 2;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int fetch_stats()
{
return SocketStats::mbed_stats_socket_get_each(&tcp_stats[0], MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT);

View File

@ -25,7 +25,7 @@ void fill_tx_buffer_ascii(char *buff, size_t len);
nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock);
nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
extern mbed_stats_socket_t tcp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
int fetch_stats(void);
#endif

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_ADDRESS()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -49,7 +49,7 @@ void TCPSOCKET_BIND_ADDRESS()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_ADDRESS_INVALID()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -55,7 +55,7 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_ADDRESS_NULL()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -48,7 +48,7 @@ void TCPSOCKET_BIND_ADDRESS_NULL()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_ADDRESS_PORT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -48,7 +48,7 @@ void TCPSOCKET_BIND_ADDRESS_PORT()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_PORT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -48,7 +48,7 @@ void TCPSOCKET_BIND_PORT()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_PORT_FAIL()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -58,7 +58,7 @@ void TCPSOCKET_BIND_PORT_FAIL()
delete sock;
delete sock2;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_UNOPENED()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -47,7 +47,7 @@ void TCPSOCKET_BIND_UNOPENED()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_BIND_WRONG_TYPE()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -57,7 +57,7 @@ void TCPSOCKET_BIND_WRONG_TYPE()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -125,7 +125,7 @@ void tcpsocket_echotest_nonblock_receive()
void TCPSOCKET_ECHOTEST_NONBLOCK()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int j = 0;
int count = fetch_stats();
for (; j < count; j++) {
@ -179,7 +179,7 @@ void TCPSOCKET_ECHOTEST_NONBLOCK()
}
bytes2send -= sent;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (j = 0; j < count; j++) {
if ((tcp_stats[j].state == SOCK_OPEN) && (tcp_stats[j].proto == NSAPI_TCP)) {

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_OPEN_CLOSE_REPEAT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -42,7 +42,7 @@ void TCPSOCKET_OPEN_CLOSE_REPEAT()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->close());
}
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_OPEN_DESTRUCT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -41,7 +41,7 @@ void TCPSOCKET_OPEN_DESTRUCT()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
delete sock;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -70,7 +70,7 @@ void TCPSOCKET_OPEN_LIMIT()
break;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
int open_count = 0;
for (int j = 0; j < count; j++) {

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void TCPSOCKET_OPEN_TWICE()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);
@ -41,7 +41,7 @@ void TCPSOCKET_OPEN_TWICE()
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->open(NetworkInterface::get_default_instance()));
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tcp_stats[j].state);

View File

@ -39,7 +39,7 @@ namespace {
Timer tc_bucket; // Timer to limit a test cases run time
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
mbed_stats_socket_t tls_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
#endif
@ -154,7 +154,7 @@ int split2half_rmng_tls_test_time()
return (tls_global::TESTS_TIMEOUT - tc_bucket.read()) / 2;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int fetch_stats()
{
return SocketStats::mbed_stats_socket_get_each(&tls_stats[0], MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT);

View File

@ -28,7 +28,7 @@ void fill_tx_buffer_ascii(char *buff, size_t len);
nsapi_error_t tlssocket_connect_to_echo_srv(TLSSocket &sock);
nsapi_error_t tlssocket_connect_to_discard_srv(TLSSocket &sock);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
extern mbed_stats_socket_t tls_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
int fetch_stats(void);
#endif

View File

@ -131,7 +131,7 @@ void tlssocket_echotest_nonblock_receive()
void TLSSOCKET_ECHOTEST_NONBLOCK()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int j = 0;
int count = fetch_stats();
for (; j < count; j++) {
@ -184,7 +184,7 @@ void TLSSOCKET_ECHOTEST_NONBLOCK()
}
bytes2send -= sent;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (j = 0; j < count; j++) {
if ((tls_stats[j].state == SOCK_OPEN) && (tls_stats[j].proto == NSAPI_TLS)) {

View File

@ -28,7 +28,7 @@ using namespace utest::v1;
void TLSSOCKET_OPEN_DESTRUCT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tls_stats[j].state);
@ -43,7 +43,7 @@ void TLSSOCKET_OPEN_DESTRUCT()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
delete sock;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tls_stats[j].state);

View File

@ -72,7 +72,7 @@ void TLSSOCKET_OPEN_LIMIT()
break;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
int open_count = 0;
for (int j = 0; j < count; j++) {

View File

@ -28,7 +28,7 @@ using namespace utest::v1;
void TLSSOCKET_OPEN_TWICE()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tls_stats[j].state);
@ -43,7 +43,7 @@ void TLSSOCKET_OPEN_TWICE()
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->open(NetworkInterface::get_default_instance()));
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, tls_stats[j].state);

View File

@ -37,7 +37,7 @@ namespace {
Timer tc_bucket; // Timer to limit a test cases run time
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
#endif
@ -89,7 +89,7 @@ int split2half_rmng_udp_test_time()
return (udp_global::TESTS_TIMEOUT - tc_bucket.read()) / 2;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int fetch_stats()
{
return SocketStats::mbed_stats_socket_get_each(&udp_stats[0], MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT);

View File

@ -23,7 +23,7 @@ void drop_bad_packets(UDPSocket &sock, int orig_timeout);
nsapi_version_t get_ip_version();
void fill_tx_buffer_ascii(char *buff, size_t len);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
extern mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
int fetch_stats(void);
#endif

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_ADDRESS()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -48,7 +48,7 @@ void UDPSOCKET_BIND_ADDRESS()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_ADDRESS_INVALID()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -56,7 +56,7 @@ void UDPSOCKET_BIND_ADDRESS_INVALID()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_ADDRESS_NULL()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -47,7 +47,7 @@ void UDPSOCKET_BIND_ADDRESS_NULL()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_ADDRESS_PORT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -47,7 +47,7 @@ void UDPSOCKET_BIND_ADDRESS_PORT()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_PORT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -47,7 +47,7 @@ void UDPSOCKET_BIND_PORT()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_PORT_FAIL()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -57,7 +57,7 @@ void UDPSOCKET_BIND_PORT_FAIL()
delete sock;
delete sock2;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_UNOPENED()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -46,7 +46,7 @@ void UDPSOCKET_BIND_UNOPENED()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_BIND_WRONG_TYPE()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -56,7 +56,7 @@ void UDPSOCKET_BIND_WRONG_TYPE()
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -133,7 +133,7 @@ void udpsocket_echotest_nonblock_receiver(void *receive_bytes)
void UDPSOCKET_ECHOTEST_NONBLOCK()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int j = 0;
int count = fetch_stats();
for (; j < count; j++) {
@ -204,7 +204,7 @@ void UDPSOCKET_ECHOTEST_NONBLOCK()
printf("Packets sent: %d, packets received %d, loss ratio %.2lf\r\n", packets_sent, packets_recv, loss_ratio);
TEST_ASSERT_DOUBLE_WITHIN(TOLERATED_LOSS_RATIO, EXPECTED_LOSS_RATIO, loss_ratio);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (j = 0; j < count; j++) {
if ((NSAPI_UDP == udp_stats[j].proto) && (SOCK_OPEN == udp_stats[j].state)) {

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_OPEN_CLOSE_REPEAT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -42,7 +42,7 @@ void UDPSOCKET_OPEN_CLOSE_REPEAT()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->close());
}
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_OPEN_DESTRUCT()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -41,7 +41,7 @@ void UDPSOCKET_OPEN_DESTRUCT()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
delete sock;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -70,7 +70,7 @@ void UDPSOCKET_OPEN_LIMIT()
if (!socket_list_head) {
break;
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
int open_count = 0;
for (int j = 0; j < count; j++) {

View File

@ -26,7 +26,7 @@ using namespace utest::v1;
void UDPSOCKET_OPEN_TWICE()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);
@ -41,7 +41,7 @@ void UDPSOCKET_OPEN_TWICE()
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->open(NetworkInterface::get_default_instance()));
delete sock;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (int j = 0; j < count; j++) {
TEST_ASSERT_EQUAL(SOCK_CLOSED, udp_stats[j].state);

View File

@ -50,7 +50,7 @@ static void _ifdown()
printf("MBED: ifdown\n");
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int fetch_stats()
{
return SocketStats::mbed_stats_socket_get_each(&udp_stats[0], MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT);

View File

@ -40,7 +40,7 @@ NetworkInterface *net;
char interface_name[MBED_CONF_MULTIHOMING_MAX_INTERFACES_NUM][INTERFACE_NAME_LEN];
int interface_num = 0;
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
#endif
@ -120,7 +120,7 @@ void fill_tx_buffer_ascii(char *buff, size_t len)
}
}
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int fetch_stats()
{
return SocketStats::mbed_stats_socket_get_each(&udp_stats[0], MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT);

View File

@ -57,7 +57,7 @@ NetworkInterface *get_interface();
void drop_bad_packets(UDPSocket &sock, int orig_timeout);
void fill_tx_buffer_ascii(char *buff, size_t len);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
extern mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
int fetch_stats(void);
#endif

View File

@ -120,7 +120,7 @@ void udpsocket_echotest_nonblock_receiver(void *receive_bytes)
void MULTIHOMING_UDPSOCKET_ECHOTEST_NONBLOCK()
{
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int j = 0;
int count = fetch_stats();
for (; j < count; j++) {
@ -189,7 +189,7 @@ void MULTIHOMING_UDPSOCKET_ECHOTEST_NONBLOCK()
printf("Interface %s, Packets sent: %d, packets received %d, loss ratio %.2lf\r\n", interface_name[j], packets_sent, packets_recv, loss_ratio);
TEST_ASSERT_DOUBLE_WITHIN(TOLERATED_LOSS_RATIO, EXPECTED_LOSS_RATIO, loss_ratio);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
count = fetch_stats();
for (j = 0; j < count; j++) {
if ((NSAPI_UDP == udp_stats[j].proto) && (SOCK_OPEN == udp_stats[j].state)) {

View File

@ -16,7 +16,7 @@
#include "SocketStats.h"
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
int SocketStats::get_entry_position(const Socket *const reference_id)
{
return 0;

View File

@ -143,7 +143,7 @@ public:
*/
void stats_update_recv_bytes(const Socket *const reference_id, size_t recv_bytes);
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
private:
static mbed_stats_socket_t _stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
static SingletonPtr<PlatformMutex> _mutex;