mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
test_tcp: de-duplicate seqno checking defines
This commit moves common defines and senqo array so they can be re-used in mulptiple places for sequence number checking rather than duplicated Currently they are used in two places, but I'm anticipating needing them in future TCP unit tests
This commit is contained in:
parent
6559ffd848
commit
34c9e30225
@ -16,6 +16,17 @@
|
|||||||
#error "This tests needs TCP_SND_BUF to be > TCP_WND"
|
#error "This tests needs TCP_SND_BUF to be > TCP_WND"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* used with check_seqnos() */
|
||||||
|
#define SEQNO1 (0xFFFFFF00 - TCP_MSS)
|
||||||
|
#define ISS 6510
|
||||||
|
static u32_t seqnos[] = {
|
||||||
|
SEQNO1,
|
||||||
|
SEQNO1 + (1 * TCP_MSS),
|
||||||
|
SEQNO1 + (2 * TCP_MSS),
|
||||||
|
SEQNO1 + (3 * TCP_MSS),
|
||||||
|
SEQNO1 + (4 * TCP_MSS),
|
||||||
|
SEQNO1 + (5 * TCP_MSS) };
|
||||||
|
|
||||||
static u8_t test_tcp_timer;
|
static u8_t test_tcp_timer;
|
||||||
|
|
||||||
/* our own version of tcp_tmr so we can reset fast/slow timer state */
|
/* our own version of tcp_tmr so we can reset fast/slow timer state */
|
||||||
@ -400,16 +411,7 @@ START_TEST(test_tcp_fast_rexmit_wraparound)
|
|||||||
ip_addr_t remote_ip, local_ip, netmask;
|
ip_addr_t remote_ip, local_ip, netmask;
|
||||||
u16_t remote_port = 0x100, local_port = 0x101;
|
u16_t remote_port = 0x100, local_port = 0x101;
|
||||||
err_t err;
|
err_t err;
|
||||||
#define SEQNO1 (0xFFFFFF00 - TCP_MSS)
|
|
||||||
#define ISS 6510
|
|
||||||
u16_t i, sent_total = 0;
|
u16_t i, sent_total = 0;
|
||||||
u32_t seqnos[] = {
|
|
||||||
SEQNO1,
|
|
||||||
SEQNO1 + (1 * TCP_MSS),
|
|
||||||
SEQNO1 + (2 * TCP_MSS),
|
|
||||||
SEQNO1 + (3 * TCP_MSS),
|
|
||||||
SEQNO1 + (4 * TCP_MSS),
|
|
||||||
SEQNO1 + (5 * TCP_MSS)};
|
|
||||||
LWIP_UNUSED_ARG(_i);
|
LWIP_UNUSED_ARG(_i);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(tx_data); i++) {
|
for (i = 0; i < sizeof(tx_data); i++) {
|
||||||
@ -500,16 +502,7 @@ START_TEST(test_tcp_rto_rexmit_wraparound)
|
|||||||
ip_addr_t remote_ip, local_ip, netmask;
|
ip_addr_t remote_ip, local_ip, netmask;
|
||||||
u16_t remote_port = 0x100, local_port = 0x101;
|
u16_t remote_port = 0x100, local_port = 0x101;
|
||||||
err_t err;
|
err_t err;
|
||||||
#define SEQNO1 (0xFFFFFF00 - TCP_MSS)
|
|
||||||
#define ISS 6510
|
|
||||||
u16_t i, sent_total = 0;
|
u16_t i, sent_total = 0;
|
||||||
u32_t seqnos[] = {
|
|
||||||
SEQNO1,
|
|
||||||
SEQNO1 + (1 * TCP_MSS),
|
|
||||||
SEQNO1 + (2 * TCP_MSS),
|
|
||||||
SEQNO1 + (3 * TCP_MSS),
|
|
||||||
SEQNO1 + (4 * TCP_MSS),
|
|
||||||
SEQNO1 + (5 * TCP_MSS)};
|
|
||||||
LWIP_UNUSED_ARG(_i);
|
LWIP_UNUSED_ARG(_i);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(tx_data); i++) {
|
for (i = 0; i < sizeof(tx_data); i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user