From 648b2b6f2bb864b5f5d60d333d634e63eed4f526 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Thu, 23 Mar 2017 14:30:28 -0500 Subject: [PATCH] test_tcp: remove unnecessary memsets test_tcp_init_netif() memsets both netif and txcounters, so no need to manually do it --- test/unit/tcp/test_tcp.c | 3 --- test/unit/tcp/test_tcp_oos.c | 7 ------- 2 files changed, 10 deletions(-) diff --git a/test/unit/tcp/test_tcp.c b/test/unit/tcp/test_tcp.c index 66dae87c..f17cd542 100644 --- a/test/unit/tcp/test_tcp.c +++ b/test/unit/tcp/test_tcp.c @@ -107,7 +107,6 @@ START_TEST(test_tcp_recv_inseq) LWIP_UNUSED_ARG(_i); /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -159,7 +158,6 @@ START_TEST(test_tcp_malformed_header) LWIP_UNUSED_ARG(_i); /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -604,7 +602,6 @@ static void test_tcp_tx_full_window_lost(u8_t zero_window_probe_from_unsent) IP_ADDR4(&netmask, 255, 255, 255, 0); test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); memset(&counters, 0, sizeof(counters)); - memset(&txcounters, 0, sizeof(txcounters)); /* create and initialize the pcb */ pcb = test_tcp_new_counters_pcb(&counters); diff --git a/test/unit/tcp/test_tcp_oos.c b/test/unit/tcp/test_tcp_oos.c index 67eec0a3..a7baed73 100644 --- a/test/unit/tcp/test_tcp_oos.c +++ b/test/unit/tcp/test_tcp_oos.c @@ -166,7 +166,6 @@ START_TEST(test_tcp_recv_ooseq_FIN_OOSEQ) LWIP_UNUSED_ARG(_i); /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -308,7 +307,6 @@ START_TEST(test_tcp_recv_ooseq_FIN_INSEQ) LWIP_UNUSED_ARG(_i); /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -485,7 +483,6 @@ START_TEST(test_tcp_recv_ooseq_overrun_rxwin) } /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -578,7 +575,6 @@ START_TEST(test_tcp_recv_ooseq_overrun_rxwin_edge) } /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -670,7 +666,6 @@ START_TEST(test_tcp_recv_ooseq_max_bytes) } /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -751,7 +746,6 @@ START_TEST(test_tcp_recv_ooseq_max_pbufs) } /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0); @@ -854,7 +848,6 @@ static void test_tcp_recv_ooseq_double_FINs(int delay_packet) } /* initialize local vars */ - memset(&netif, 0, sizeof(netif)); IP_ADDR4(&local_ip, 192, 168, 1, 1); IP_ADDR4(&remote_ip, 192, 168, 1, 2); IP_ADDR4(&netmask, 255, 255, 255, 0);