mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-03 21:32:08 +00:00
Fixed more compiler warnings for unit tests
This commit is contained in:
parent
38e3299675
commit
851e03966d
@ -14,8 +14,8 @@
|
|||||||
#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
|
#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
TFun func;
|
TFun func;
|
||||||
const char *name;
|
const char *name;
|
||||||
} testfunc;
|
} testfunc;
|
||||||
|
|
||||||
#define TESTFUNC(x) {(x), "" # x "" }
|
#define TESTFUNC(x) {(x), "" # x "" }
|
||||||
@ -28,20 +28,10 @@ typedef struct {
|
|||||||
typedef Suite* (suite_getter_fn)(void);
|
typedef Suite* (suite_getter_fn)(void);
|
||||||
|
|
||||||
/** Create a test suite */
|
/** Create a test suite */
|
||||||
static Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
|
Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown);
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
Suite *s = suite_create(name);
|
|
||||||
|
|
||||||
for(i = 0; i < num_tests; i++) {
|
#ifdef LWIP_UNITTESTS_LIB
|
||||||
TCase *tc_core = tcase_create(name);
|
int lwip_unittests_run(void)
|
||||||
if ((setup != NULL) || (teardown != NULL)) {
|
#endif
|
||||||
tcase_add_checked_fixture(tc_core, setup, teardown);
|
|
||||||
}
|
|
||||||
tcase_add_named_test(tc_core, tests[i]);
|
|
||||||
suite_add_tcase(s, tc_core);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* LWIP_HDR_LWIP_CHECK_H__ */
|
#endif /* LWIP_HDR_LWIP_CHECK_H__ */
|
||||||
|
@ -10,8 +10,27 @@
|
|||||||
|
|
||||||
#include "lwip/init.h"
|
#include "lwip/init.h"
|
||||||
|
|
||||||
|
Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
Suite *s = suite_create(name);
|
||||||
|
|
||||||
int main()
|
for(i = 0; i < num_tests; i++) {
|
||||||
|
TCase *tc_core = tcase_create(name);
|
||||||
|
if ((setup != NULL) || (teardown != NULL)) {
|
||||||
|
tcase_add_checked_fixture(tc_core, setup, teardown);
|
||||||
|
}
|
||||||
|
tcase_add_named_test(tc_core, tests[i]);
|
||||||
|
suite_add_tcase(s, tc_core);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef LWIP_UNITTESTS_LIB
|
||||||
|
int lwip_unittests_run(void)
|
||||||
|
#else
|
||||||
|
int main(void)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
int number_failed;
|
int number_failed;
|
||||||
SRunner *sr;
|
SRunner *sr;
|
||||||
|
@ -36,6 +36,7 @@ static int tcp_oos_count(struct tcp_pcb* pcb)
|
|||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TCP_OOSEQ_MAX_PBUFS && (TCP_OOSEQ_MAX_PBUFS < ((TCP_WND / TCP_MSS) + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN))
|
||||||
/** Get the numbers of pbufs on the ooseq list */
|
/** Get the numbers of pbufs on the ooseq list */
|
||||||
static int tcp_oos_pbuf_count(struct tcp_pcb* pcb)
|
static int tcp_oos_pbuf_count(struct tcp_pcb* pcb)
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ static int tcp_oos_pbuf_count(struct tcp_pcb* pcb)
|
|||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Get the seqno of a segment (by index) on the ooseq list
|
/** Get the seqno of a segment (by index) on the ooseq list
|
||||||
*
|
*
|
||||||
@ -562,7 +564,7 @@ START_TEST(test_tcp_recv_ooseq_overrun_rxwin_edge)
|
|||||||
int datalen = 0;
|
int datalen = 0;
|
||||||
int datalen2;
|
int datalen2;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(data_full_wnd); i++) {
|
for(i = 0; i < (int)sizeof(data_full_wnd); i++) {
|
||||||
data_full_wnd[i] = (char)i;
|
data_full_wnd[i] = (char)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user