You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2017/04/19 18:18:10 UTC
[14/30] incubator-mynewt-core git commit: net/ip/lwip_base;
update to LwIP to tag STABLE-2_0_2_RELEASE
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/mdns/test_mdns.c
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/mdns/test_mdns.c b/net/ip/lwip_base/test/unit/mdns/test_mdns.c
index 9cff0fd..ca9be64 100644
--- a/net/ip/lwip_base/test/unit/mdns/test_mdns.c
+++ b/net/ip/lwip_base/test/unit/mdns/test_mdns.c
@@ -26,10 +26,7 @@
*
* This file is part of the lwIP TCP/IP stack.
*
- * Author: Erik Ekman <er...@verisure.com>
- *
- * Please coordinate changes and requests with Erik Ekman
- * <er...@verisure.com>
+ * Author: Erik Ekman <er...@kryo.se>
*
*/
@@ -45,6 +42,7 @@ START_TEST(readname_basic)
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -63,6 +61,7 @@ START_TEST(readname_anydata)
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -81,6 +80,7 @@ START_TEST(readname_short_buf)
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -92,18 +92,20 @@ START_TEST(readname_short_buf)
END_TEST
START_TEST(readname_long_label)
-{ static const u8_t data[] = {
+{
+ static const u8_t data[] = {
0x05, 'm', 'u', 'l', 't', 'i',
0x52, 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
- 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 0x00,
+ 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -154,11 +156,12 @@ START_TEST(readname_overflow)
0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't',
0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't',
0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't',
- 0x00,
+ 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -175,14 +178,15 @@ START_TEST(readname_jump_earlier)
/* Some padding needed, not supported to jump to bytes containing dns header */
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 10 */ 0x0f, 0x0e, 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xab,
- /* 20 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x0c,
+ /* 20 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x0c
};
static const u8_t fullname[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -203,14 +207,15 @@ START_TEST(readname_jump_earlier_jump)
/* 0x00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x08 */ 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x0a, 0xf2,
/* 0x10 */ 0x04, 'c', 'a', 's', 't', 0x00, 0xc0, 0x10,
- /* 0x18 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x16,
+ /* 0x18 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x16
};
static const u8_t fullname[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -234,16 +239,17 @@ START_TEST(readname_jump_maxdepth)
/* 0x18 */ 0x03, 'd', 'n', 's', 0xc0, 0x10, 0xc0, 0x10,
/* 0x20 */ 0x04, 'd', 'e', 'e', 'p', 0xc0, 0x18, 0x00,
/* 0x28 */ 0x04, 'c', 'a', 's', 't', 0xc0, 0x20, 0xb0,
- /* 0x30 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x28,
+ /* 0x30 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x28
};
static const u8_t fullname[] = {
0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't',
0x04, 'd', 'e', 'e', 'p', 0x03, 'd', 'n', 's',
- 0x04, 'n', 'a', 'm', 'e', 0x00,
+ 0x04, 'n', 'a', 'm', 'e', 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -261,14 +267,15 @@ START_TEST(readname_jump_later)
{
static const u8_t data[] = {
/* 0x00 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x10, 0x00, 0x01, 0x40,
- /* 0x10 */ 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xab,
+ /* 0x10 */ 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xab
};
static const u8_t fullname[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -285,11 +292,12 @@ END_TEST
START_TEST(readname_half_jump)
{
static const u8_t data[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -303,11 +311,12 @@ END_TEST
START_TEST(readname_jump_toolong)
{
static const u8_t data[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc2, 0x10, 0x00, 0x01, 0x40,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc2, 0x10, 0x00, 0x01, 0x40
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -322,11 +331,12 @@ START_TEST(readname_jump_loop_label)
{
static const u8_t data[] = {
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x10,
+ /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x10
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -341,11 +351,12 @@ START_TEST(readname_jump_loop_jump)
{
static const u8_t data[] = {
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x15,
+ /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x15
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -361,6 +372,7 @@ START_TEST(add_label_basic)
static const u8_t data[] = { 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00 };
struct mdns_domain domain;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain, 0, sizeof(domain));
res = mdns_domain_add_label(&domain, "multi", 5);
@@ -379,6 +391,7 @@ START_TEST(add_label_long_label)
static const char *toolong = "abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-";
struct mdns_domain domain;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain, 0, sizeof(domain));
res = mdns_domain_add_label(&domain, "multi", 5);
@@ -393,6 +406,7 @@ START_TEST(add_label_full)
static const char *label = "0123456789abcdef0123456789abcdef";
struct mdns_domain domain;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain, 0, sizeof(domain));
res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label));
@@ -440,10 +454,11 @@ END_TEST
START_TEST(domain_eq_basic)
{
static const u8_t data[] = {
- 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00,
+ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00
};
struct mdns_domain domain1, domain2;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain1, 0, sizeof(domain1));
res = mdns_domain_add_label(&domain1, "multi", 5);
@@ -470,6 +485,7 @@ START_TEST(domain_eq_diff)
{
struct mdns_domain domain1, domain2;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain1, 0, sizeof(domain1));
res = mdns_domain_add_label(&domain1, "multi", 5);
@@ -495,6 +511,7 @@ START_TEST(domain_eq_case)
{
struct mdns_domain domain1, domain2;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain1, 0, sizeof(domain1));
res = mdns_domain_add_label(&domain1, "multi", 5);
@@ -522,6 +539,7 @@ START_TEST(domain_eq_anydata)
static const u8_t data2[] = { 0x7f, 0x8c, 0x01, 0xff, 0xcf };
struct mdns_domain domain1, domain2;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain1, 0, sizeof(domain1));
res = mdns_domain_add_label(&domain1, (const char*)data1, sizeof(data1));
@@ -551,6 +569,7 @@ START_TEST(domain_eq_length)
{
struct mdns_domain domain1, domain2;
err_t res;
+ LWIP_UNUSED_ARG(_i);
memset(&domain1, 0, sizeof(domain1));
memset(domain1.name, 0xAA, sizeof(MDNS_DOMAIN_MAXLEN));
@@ -581,6 +600,7 @@ START_TEST(compress_full_match)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -615,6 +635,7 @@ START_TEST(compress_full_match_subset)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -644,13 +665,14 @@ START_TEST(compress_full_match_jump)
/* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
/* 0x10 */ 0x04, 'l', 'w', 'i', 'p', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xc0, 0x00, 0x02, 0x00,
- /* 0x20 */ 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0xc0, 0x15,
+ /* 0x20 */ 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0xc0, 0x15
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -685,6 +707,7 @@ START_TEST(compress_no_match)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -718,6 +741,7 @@ START_TEST(compress_2nd_label)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -752,6 +776,7 @@ START_TEST(compress_2nd_label_short)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -781,13 +806,14 @@ START_TEST(compress_jump_to_jump)
/* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
/* 0x10 */ 0x04, 'l', 'w', 'i', 'p', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xc0, 0x00, 0x02, 0x00,
- /* 0x20 */ 0x07, 'b', 'a', 'n', 'a', 'n', 'a', 's', 0xc0, 0x15,
+ /* 0x20 */ 0x07, 'b', 'a', 'n', 'a', 'n', 'a', 's', 0xc0, 0x15
};
struct pbuf *p;
struct mdns_domain domain;
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
@@ -827,6 +853,7 @@ START_TEST(compress_long_match)
u16_t offset;
u16_t length;
err_t res;
+ LWIP_UNUSED_ARG(_i);
p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM);
p->payload = (void *)(size_t)data;
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/mdns/test_mdns.h
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/mdns/test_mdns.h b/net/ip/lwip_base/test/unit/mdns/test_mdns.h
index 413ee82..c3df339 100644
--- a/net/ip/lwip_base/test/unit/mdns/test_mdns.h
+++ b/net/ip/lwip_base/test/unit/mdns/test_mdns.h
@@ -3,14 +3,6 @@
#include "../lwip_check.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
Suite* mdns_suite(void);
-#ifdef __cplusplus
-}
-#endif
-
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/tcp/tcp_helper.c
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/tcp/tcp_helper.c b/net/ip/lwip_base/test/unit/tcp/tcp_helper.c
index fc7e67f..64121ca 100644
--- a/net/ip/lwip_base/test/unit/tcp/tcp_helper.c
+++ b/net/ip/lwip_base/test/unit/tcp/tcp_helper.c
@@ -141,24 +141,33 @@ void
tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip,
ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port)
{
+ u32_t iss;
+
/* @todo: are these all states? */
/* @todo: remove from previous list */
pcb->state = state;
+
+ iss = tcp_next_iss(pcb);
+ pcb->snd_wl2 = iss;
+ pcb->snd_nxt = iss;
+ pcb->lastack = iss;
+ pcb->snd_lbb = iss;
+
if (state == ESTABLISHED) {
TCP_REG(&tcp_active_pcbs, pcb);
- pcb->local_ip.addr = local_ip->addr;
+ ip_addr_copy(pcb->local_ip, *local_ip);
pcb->local_port = local_port;
- pcb->remote_ip.addr = remote_ip->addr;
+ ip_addr_copy(pcb->remote_ip, *remote_ip);
pcb->remote_port = remote_port;
} else if(state == LISTEN) {
TCP_REG(&tcp_listen_pcbs.pcbs, pcb);
- pcb->local_ip.addr = local_ip->addr;
+ ip_addr_copy(pcb->local_ip, *local_ip);
pcb->local_port = local_port;
} else if(state == TIME_WAIT) {
TCP_REG(&tcp_tw_pcbs, pcb);
- pcb->local_ip.addr = local_ip->addr;
+ ip_addr_copy(pcb->local_ip, *local_ip);
pcb->local_port = local_port;
- pcb->remote_ip.addr = remote_ip->addr;
+ ip_addr_copy(pcb->remote_ip, *remote_ip);
pcb->remote_port = remote_port;
} else {
fail();
@@ -293,8 +302,8 @@ void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcoun
}
netif->output = test_tcp_netif_output;
netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
- ip4_addr_copy(netif->netmask, *ip_2_ip4(netmask));
- ip4_addr_copy(netif->ip_addr, *ip_2_ip4(ip_addr));
+ ip_addr_copy_from_ip4(netif->netmask, *ip_2_ip4(netmask));
+ ip_addr_copy_from_ip4(netif->ip_addr, *ip_2_ip4(ip_addr));
for (n = netif_list; n != NULL; n = n->next) {
if (n == netif) {
return;
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/tcp/tcp_helper.h
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/tcp/tcp_helper.h b/net/ip/lwip_base/test/unit/tcp/tcp_helper.h
index f666249..0497481 100644
--- a/net/ip/lwip_base/test/unit/tcp/tcp_helper.h
+++ b/net/ip/lwip_base/test/unit/tcp/tcp_helper.h
@@ -6,10 +6,6 @@
#include "lwip/tcp.h"
#include "lwip/netif.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* counters used for test_tcp_counters_* callback functions */
struct test_tcp_counters {
u32_t recv_calls;
@@ -53,8 +49,4 @@ void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcoun
ip_addr_t *ip_addr, ip_addr_t *netmask);
-#ifdef __cplusplus
-}
-#endif
-
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/tcp/test_tcp.c
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/tcp/test_tcp.c b/net/ip/lwip_base/test/unit/tcp/test_tcp.c
index bfcfa1d..d99b807 100644
--- a/net/ip/lwip_base/test/unit/tcp/test_tcp.c
+++ b/net/ip/lwip_base/test/unit/tcp/test_tcp.c
@@ -35,8 +35,8 @@ tcp_setup(void)
{
/* reset iss to default (6510) */
tcp_ticks = 0;
- tcp_ticks = 0 - (tcp_next_iss() - 6510);
- tcp_next_iss();
+ tcp_ticks = 0 - (tcp_next_iss(NULL) - 6510);
+ tcp_next_iss(NULL);
tcp_ticks = 0;
test_tcp_timer = 0;
@@ -46,9 +46,9 @@ tcp_setup(void)
static void
tcp_teardown(void)
{
- tcp_remove_all();
netif_list = NULL;
netif_default = NULL;
+ tcp_remove_all();
}
@@ -418,11 +418,12 @@ START_TEST(test_tcp_fast_rexmit_wraparound)
tcp_ticks = SEQNO1 - ISS;
pcb = test_tcp_new_counters_pcb(&counters);
EXPECT_RET(pcb != NULL);
- EXPECT(pcb->lastack == SEQNO1);
tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port);
pcb->mss = TCP_MSS;
/* disable initial congestion window (we don't send a SYN here...) */
pcb->cwnd = 2*TCP_MSS;
+ /* start in congestion advoidance */
+ pcb->ssthresh = pcb->cwnd;
/* send 6 mss-sized segments */
for (i = 0; i < 6; i++) {
@@ -443,7 +444,9 @@ START_TEST(test_tcp_fast_rexmit_wraparound)
/* ACK the first segment */
p = tcp_create_rx_segment(pcb, NULL, 0, 0, TCP_MSS, TCP_ACK);
test_tcp_input(p, &netif);
- /* ensure this didn't trigger a retransmission */
+ /* ensure this didn't trigger a retransmission. Only one
+ segment should be transmitted because cwnd opened up by
+ TCP_MSS and a fraction since we are in congestion avoidance */
EXPECT(txcounters.num_tx_calls == 1);
EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U);
memset(&txcounters, 0, sizeof(txcounters));
@@ -513,11 +516,10 @@ START_TEST(test_tcp_rto_rexmit_wraparound)
/* create and initialize the pcb */
tcp_ticks = 0;
- tcp_ticks = 0 - tcp_next_iss();
- tcp_ticks = SEQNO1 - tcp_next_iss();
+ tcp_ticks = 0 - tcp_next_iss(NULL);
+ tcp_ticks = SEQNO1 - tcp_next_iss(NULL);
pcb = test_tcp_new_counters_pcb(&counters);
EXPECT_RET(pcb != NULL);
- EXPECT(pcb->lastack == SEQNO1);
tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port);
pcb->mss = TCP_MSS;
/* disable initial congestion window (we don't send a SYN here...) */
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/tcp/test_tcp.h
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/tcp/test_tcp.h b/net/ip/lwip_base/test/unit/tcp/test_tcp.h
index c6c56dd..f28ee56 100644
--- a/net/ip/lwip_base/test/unit/tcp/test_tcp.h
+++ b/net/ip/lwip_base/test/unit/tcp/test_tcp.h
@@ -3,14 +3,6 @@
#include "../lwip_check.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
Suite *tcp_suite(void);
-#ifdef __cplusplus
-}
-#endif
-
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/tcp/test_tcp_oos.h
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/tcp/test_tcp_oos.h b/net/ip/lwip_base/test/unit/tcp/test_tcp_oos.h
index d0b7976..5b82013 100644
--- a/net/ip/lwip_base/test/unit/tcp/test_tcp_oos.h
+++ b/net/ip/lwip_base/test/unit/tcp/test_tcp_oos.h
@@ -3,14 +3,6 @@
#include "../lwip_check.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
Suite *tcp_oos_suite(void);
-#ifdef __cplusplus
-}
-#endif
-
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f52033e9/net/ip/lwip_base/test/unit/udp/test_udp.h
----------------------------------------------------------------------
diff --git a/net/ip/lwip_base/test/unit/udp/test_udp.h b/net/ip/lwip_base/test/unit/udp/test_udp.h
index 783739c..5426bf4 100644
--- a/net/ip/lwip_base/test/unit/udp/test_udp.h
+++ b/net/ip/lwip_base/test/unit/udp/test_udp.h
@@ -3,14 +3,6 @@
#include "../lwip_check.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
Suite* udp_suite(void);
-#ifdef __cplusplus
-}
-#endif
-
#endif