]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/blobdiff - test/unit/tcp/tcp_helper.c
Worked on tcp_oos unit tests, nearly all TCP_QUEUE_OOS code is covered now
[pes-rpp/rpp-lwip.git] / test / unit / tcp / tcp_helper.c
index ad0f657d8e88c413b61fd537f9fad8a083aee016..4a28b8693d2680b207cdc3cb50b643fb84e63117 100644 (file)
@@ -33,6 +33,8 @@ tcp_remove_all(void)
   tcp_remove(tcp_tw_pcbs);
   fail_unless(lwip_stats.memp[MEMP_TCP_PCB].used == 0);
   fail_unless(lwip_stats.memp[MEMP_TCP_PCB_LISTEN].used == 0);
+  fail_unless(lwip_stats.memp[MEMP_TCP_SEG].used == 0);
+  fail_unless(lwip_stats.memp[MEMP_PBUF_POOL].used == 0);
 }
 
 /** Create a TCP segment usable for passing to tcp_input
@@ -56,8 +58,9 @@ tcp_create_segment(struct ip_addr* src_ip, struct ip_addr* dst_ip,
   struct pbuf* p;
   struct ip_hdr* iphdr;
   struct tcp_hdr* tcphdr;
+  u16_t pbuf_len = sizeof(struct ip_hdr) + sizeof(struct tcp_hdr) + data_len;
 
-  p = pbuf_alloc(PBUF_RAW, sizeof(struct ip_hdr) + sizeof(struct tcp_hdr) + data_len, PBUF_RAM);
+  p = pbuf_alloc(PBUF_RAW, pbuf_len, PBUF_POOL);
   EXPECT_RETNULL(p != NULL);
   EXPECT_RETNULL(p->next == NULL);