Skip to content

Commit

Permalink
test case: add tcp state and reset test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
ydesp committed Jun 16, 2021
1 parent 2195f74 commit 67deb80
Show file tree
Hide file tree
Showing 6 changed files with 688 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/unit/Filelists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set(LWIP_TESTFILES
${LWIP_TESTDIR}/mqtt/test_mqtt.c
${LWIP_TESTDIR}/tcp/tcp_helper.c
${LWIP_TESTDIR}/tcp/test_tcp_oos.c
${LWIP_TESTDIR}/tcp/test_tcp_state.c
${LWIP_TESTDIR}/tcp/test_tcp.c
${LWIP_TESTDIR}/udp/test_udp.c
)
1 change: 1 addition & 0 deletions test/unit/Filelists.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ TESTFILES=$(TESTDIR)/lwip_unittests.c \
$(TESTDIR)/mqtt/test_mqtt.c \
$(TESTDIR)/tcp/tcp_helper.c \
$(TESTDIR)/tcp/test_tcp_oos.c \
$(TESTDIR)/tcp/test_tcp_state.c \
$(TESTDIR)/tcp/test_tcp.c \
$(TESTDIR)/udp/test_udp.c

2 changes: 2 additions & 0 deletions test/unit/lwip_unittests.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "udp/test_udp.h"
#include "tcp/test_tcp.h"
#include "tcp/test_tcp_oos.h"
#include "tcp/test_tcp_state.h"
#include "core/test_def.h"
#include "core/test_mem.h"
#include "core/test_netif.h"
Expand Down Expand Up @@ -69,6 +70,7 @@ int main(void)
udp_suite,
tcp_suite,
tcp_oos_suite,
tcp_state_suite,
def_suite,
mem_suite,
netif_suite,
Expand Down
6 changes: 5 additions & 1 deletion test/unit/tcp/tcp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ tcp_remove(struct tcp_pcb* pcb_list)
while(pcb != NULL) {
pcb2 = pcb;
pcb = pcb->next;
tcp_abort(pcb2);
if (pcb2->state == LISTEN) {
tcp_close(pcb2);
} else {
tcp_abort(pcb2);
}
}
}

Expand Down
Loading

0 comments on commit 67deb80

Please sign in to comment.