Compare commits
21 Commits
STABLE-2_1
...
STABLE-2_1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ca936f6b5 | ||
|
|
e7b74570d9 | ||
|
|
018c64ab94 | ||
|
|
7e92fb3d7f | ||
|
|
051fbea5e6 | ||
|
|
214e2d90f3 | ||
|
|
4022a19cbc | ||
|
|
a32ea1e793 | ||
|
|
f67f2692d4 | ||
|
|
3b745f7154 | ||
|
|
d876d3c4df | ||
|
|
e8b0c52806 | ||
|
|
5bd7518343 | ||
|
|
51265f3f7d | ||
|
|
2e4932f23b | ||
|
|
dbd0bc8a2c | ||
|
|
e5627ec649 | ||
|
|
5c8fd3158d | ||
|
|
d5843944cc | ||
|
|
f62be85576 | ||
|
|
f1bd63046e |
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -2,3 +2,9 @@
|
||||
*.txt text
|
||||
*.c text
|
||||
*.h text
|
||||
|
||||
# For git archive
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
.travis.yml export-ignore
|
||||
.vscode export-ignore
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = "lwIP"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "2.1.3.rc1"
|
||||
PROJECT_NUMBER = "2.1.3"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -14,7 +14,7 @@ set(LWIP_VERSION_REVISION "3")
|
||||
# LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases
|
||||
# LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions
|
||||
# Numbers 1..31 are reserved for release candidates
|
||||
set(LWIP_VERSION_RC "1")
|
||||
set(LWIP_VERSION_RC "LWIP_RC_RELEASE")
|
||||
|
||||
if ("${LWIP_VERSION_RC}" STREQUAL "LWIP_RC_RELEASE")
|
||||
set(LWIP_VERSION_STRING
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void
|
||||
netconn_thread_init(void)
|
||||
{
|
||||
sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
if ((sem == NULL) || !sys_sem_valid(sem)) {
|
||||
if (!sys_sem_valid(sem)) {
|
||||
/* call alloc only once */
|
||||
LWIP_NETCONN_THREAD_SEM_ALLOC();
|
||||
LWIP_ASSERT("LWIP_NETCONN_THREAD_SEM_ALLOC() failed", sys_sem_valid(LWIP_NETCONN_THREAD_SEM_GET()));
|
||||
@@ -1357,7 +1357,7 @@ void
|
||||
netconn_thread_cleanup(void)
|
||||
{
|
||||
sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
if ((sem != NULL) && sys_sem_valid(sem)) {
|
||||
if (sys_sem_valid(sem)) {
|
||||
/* call free only once */
|
||||
LWIP_NETCONN_THREAD_SEM_FREE();
|
||||
}
|
||||
|
||||
@@ -128,8 +128,7 @@ lwip_gethostbyname(const char *name)
|
||||
if (s_hostent.h_addr_list != NULL) {
|
||||
u8_t idx;
|
||||
for (idx = 0; s_hostent.h_addr_list[idx]; idx++) {
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i] == %p\n", idx, s_hostent.h_addr_list[idx]));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i]-> == %s\n", idx, ipaddr_ntoa((ip_addr_t *)s_hostent.h_addr_list[idx])));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i]-> == %s\n", idx, ipaddr_ntoa(s_phostent_addr[idx])));
|
||||
}
|
||||
}
|
||||
#endif /* DNS_DEBUG */
|
||||
@@ -306,7 +305,11 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
/* service name specified: convert to port number
|
||||
* @todo?: currently, only ASCII integers (port numbers) are supported (AI_NUMERICSERV)! */
|
||||
port_nr = atoi(servname);
|
||||
if ((port_nr <= 0) || (port_nr > 0xffff)) {
|
||||
if (port_nr == 0 && (servname[0] != '0')) {
|
||||
/* atoi failed - service was not numeric */
|
||||
return EAI_SERVICE;
|
||||
}
|
||||
if ((port_nr < 0) || (port_nr > 0xffff)) {
|
||||
return EAI_SERVICE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +772,9 @@ mqtt_message_received(mqtt_client_t *client, u8_t fixed_hdr_len, u16_t length, u
|
||||
LWIP_DEBUGF(MQTT_DEBUG_WARN,( "mqtt_message_received: Received short packet (payload)\n"));
|
||||
goto out_disconnect;
|
||||
}
|
||||
client->data_cb(client->inpub_arg, var_hdr_payload + payload_offset, payload_length, remaining_length == 0 ? MQTT_DATA_FLAG_LAST : 0);
|
||||
if (client->data_cb != NULL) {
|
||||
client->data_cb(client->inpub_arg, var_hdr_payload + payload_offset, payload_length, remaining_length == 0 ? MQTT_DATA_FLAG_LAST : 0);
|
||||
}
|
||||
/* Reply if QoS > 0 */
|
||||
if (remaining_length == 0 && qos > 0) {
|
||||
/* Send PUBACK for QoS 1 or PUBREC for QoS 2 */
|
||||
|
||||
@@ -161,21 +161,25 @@ static void
|
||||
altcp_tcp_remove_callbacks(struct tcp_pcb *tpcb)
|
||||
{
|
||||
tcp_arg(tpcb, NULL);
|
||||
tcp_recv(tpcb, NULL);
|
||||
tcp_sent(tpcb, NULL);
|
||||
tcp_err(tpcb, NULL);
|
||||
tcp_poll(tpcb, NULL, tpcb->pollinterval);
|
||||
if (tpcb->state != LISTEN) {
|
||||
tcp_recv(tpcb, NULL);
|
||||
tcp_sent(tpcb, NULL);
|
||||
tcp_err(tpcb, NULL);
|
||||
tcp_poll(tpcb, NULL, tpcb->pollinterval);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
altcp_tcp_setup_callbacks(struct altcp_pcb *conn, struct tcp_pcb *tpcb)
|
||||
{
|
||||
tcp_arg(tpcb, conn);
|
||||
tcp_recv(tpcb, altcp_tcp_recv);
|
||||
tcp_sent(tpcb, altcp_tcp_sent);
|
||||
tcp_err(tpcb, altcp_tcp_err);
|
||||
/* tcp_poll is set when interval is set by application */
|
||||
/* listen is set totally different :-) */
|
||||
/* this might be called for LISTN when close fails... */
|
||||
if (tpcb->state != LISTEN) {
|
||||
tcp_recv(tpcb, altcp_tcp_recv);
|
||||
tcp_sent(tpcb, altcp_tcp_sent);
|
||||
tcp_err(tpcb, altcp_tcp_err);
|
||||
/* tcp_poll is set when interval is set by application */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1120,13 +1120,6 @@ dhcp_bind(struct netif *netif)
|
||||
}
|
||||
|
||||
ip4_addr_copy(gw_addr, dhcp->offered_gw_addr);
|
||||
/* gateway address not given? */
|
||||
if (ip4_addr_isany_val(gw_addr)) {
|
||||
/* copy network address */
|
||||
ip4_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask);
|
||||
/* use first host address on network as gateway */
|
||||
ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL));
|
||||
}
|
||||
|
||||
#if LWIP_DHCP_AUTOIP_COOP
|
||||
if (dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_ON) {
|
||||
@@ -1354,6 +1347,7 @@ dhcp_release_and_stop(struct netif *netif)
|
||||
/* create and initialize the DHCP message header */
|
||||
struct pbuf *p_out;
|
||||
u16_t options_out_len;
|
||||
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||
p_out = dhcp_create_msg(netif, dhcp, DHCP_RELEASE, &options_out_len);
|
||||
if (p_out != NULL) {
|
||||
struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload;
|
||||
@@ -1373,6 +1367,8 @@ dhcp_release_and_stop(struct netif *netif)
|
||||
|
||||
/* remove IP address from interface (prevents routing from selecting this interface) */
|
||||
netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
||||
} else {
|
||||
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||
}
|
||||
|
||||
#if LWIP_DHCP_AUTOIP_COOP
|
||||
@@ -1382,8 +1378,6 @@ dhcp_release_and_stop(struct netif *netif)
|
||||
}
|
||||
#endif /* LWIP_DHCP_AUTOIP_COOP */
|
||||
|
||||
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||
|
||||
if (dhcp->pcb_allocated != 0) {
|
||||
dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */
|
||||
dhcp->pcb_allocated = 0;
|
||||
@@ -1514,6 +1508,7 @@ dhcp_parse_reply(struct pbuf *p, struct dhcp *dhcp)
|
||||
u8_t *options;
|
||||
u16_t offset;
|
||||
u16_t offset_max;
|
||||
u16_t options_offset;
|
||||
u16_t options_idx;
|
||||
u16_t options_idx_max;
|
||||
struct pbuf *q;
|
||||
@@ -1546,6 +1541,7 @@ dhcp_parse_reply(struct pbuf *p, struct dhcp *dhcp)
|
||||
options_idx_max = p->tot_len;
|
||||
again:
|
||||
q = p;
|
||||
options_offset = options_idx;
|
||||
while ((q != NULL) && (options_idx >= q->len)) {
|
||||
options_idx = (u16_t)(options_idx - q->len);
|
||||
options_idx_max = (u16_t)(options_idx_max - q->len);
|
||||
@@ -1619,7 +1615,7 @@ again:
|
||||
case (DHCP_OPTION_OVERLOAD):
|
||||
LWIP_DHCP_INPUT_ERROR("len == 1", len == 1, return ERR_VAL;);
|
||||
/* decode overload only in options, not in file/sname: invalid packet */
|
||||
LWIP_DHCP_INPUT_ERROR("overload in file/sname", options_idx == DHCP_OPTIONS_OFS, return ERR_VAL;);
|
||||
LWIP_DHCP_INPUT_ERROR("overload in file/sname", options_offset == DHCP_OPTIONS_OFS, return ERR_VAL;);
|
||||
decode_idx = DHCP_OPTION_IDX_OVERLOAD;
|
||||
break;
|
||||
case (DHCP_OPTION_MESSAGE_TYPE):
|
||||
|
||||
@@ -983,6 +983,14 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
|
||||
/* We don't re-send arp request in etharp_tmr, but we still queue packets,
|
||||
since this failure could be temporary, and the next packet calling
|
||||
etharp_query again could lead to sending the queued packets. */
|
||||
} else {
|
||||
/* ARP request successfully sent */
|
||||
if ((arp_table[i].state == ETHARP_STATE_PENDING) && !is_new_entry) {
|
||||
/* A new ARP request has been sent for a pending entry. Reset the ctime to
|
||||
not let it expire too fast. */
|
||||
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: reset ctime for entry %"S16_F"\n", (s16_t)i));
|
||||
arp_table[i].ctime = 0;
|
||||
}
|
||||
}
|
||||
if (q == NULL) {
|
||||
return result;
|
||||
|
||||
@@ -173,6 +173,8 @@ ip4addr_aton(const char *cp, ip4_addr_t *addr)
|
||||
}
|
||||
for (;;) {
|
||||
if (lwip_isdigit(c)) {
|
||||
if((base == 8) && ((u32_t)(c - '0') >= 8))
|
||||
break;
|
||||
val = (val * base) + (u32_t)(c - '0');
|
||||
c = *++cp;
|
||||
} else if (base == 16 && lwip_isxdigit(c)) {
|
||||
|
||||
@@ -1305,6 +1305,7 @@ ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
||||
ip6_addr_copy_from_packed(src_addr, ip6hdr->src);
|
||||
ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest);
|
||||
netif = ip6_route(&src_addr, &dest_addr);
|
||||
dest = &dest_addr;
|
||||
}
|
||||
|
||||
if (netif == NULL) {
|
||||
@@ -1364,6 +1365,7 @@ ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
||||
ip6_addr_copy_from_packed(src_addr, ip6hdr->src);
|
||||
ip6_addr_copy_from_packed(dest_addr, ip6hdr->dest);
|
||||
netif = ip6_route(&src_addr, &dest_addr);
|
||||
dest = &dest_addr;
|
||||
}
|
||||
|
||||
if (netif == NULL) {
|
||||
|
||||
@@ -781,7 +781,7 @@ ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest)
|
||||
return ERR_MEM;
|
||||
}
|
||||
LWIP_ASSERT("this needs a pbuf in one piece!",
|
||||
(p->len >= (IP6_HLEN)));
|
||||
(rambuf->len >= (IP6_HLEN)));
|
||||
SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN);
|
||||
ip6hdr = (struct ip6_hdr *)rambuf->payload;
|
||||
frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN);
|
||||
|
||||
@@ -890,7 +890,7 @@ tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err)
|
||||
lpcb->state = LISTEN;
|
||||
lpcb->prio = pcb->prio;
|
||||
lpcb->so_options = pcb->so_options;
|
||||
lpcb->netif_idx = NETIF_NO_INDEX;
|
||||
lpcb->netif_idx = pcb->netif_idx;
|
||||
lpcb->ttl = pcb->ttl;
|
||||
lpcb->tos = pcb->tos;
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
|
||||
@@ -58,7 +58,7 @@ extern "C" {
|
||||
/** For release candidates, this is set to 1..254
|
||||
* For official releases, this is set to 255 (LWIP_RC_RELEASE)
|
||||
* For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */
|
||||
#define LWIP_VERSION_RC 1
|
||||
#define LWIP_VERSION_RC LWIP_RC_RELEASE
|
||||
|
||||
/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */
|
||||
#define LWIP_RC_RELEASE 255
|
||||
|
||||
@@ -216,7 +216,8 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
|
||||
/***********************************/
|
||||
#if PPP_AUTH_SUPPORT
|
||||
void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd) {
|
||||
LWIP_ASSERT_CORE_LOCKED();
|
||||
LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD", pcb->phase == PPP_PHASE_DEAD);
|
||||
|
||||
#if PAP_SUPPORT
|
||||
pcb->settings.refuse_pap = !(authtype & PPPAUTHTYPE_PAP);
|
||||
#endif /* PAP_SUPPORT */
|
||||
@@ -238,6 +239,8 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas
|
||||
#if MPPE_SUPPORT
|
||||
/* Set MPPE configuration */
|
||||
void ppp_set_mppe(ppp_pcb *pcb, u8_t flags) {
|
||||
LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD", pcb->phase == PPP_PHASE_DEAD);
|
||||
|
||||
if (flags == PPP_MPPE_DISABLE) {
|
||||
pcb->settings.require_mppe = 0;
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#error "This tests needs LWIP_NETIF_EXT_STATUS_CALLBACK enabled"
|
||||
#endif
|
||||
|
||||
struct netif net_test;
|
||||
static struct netif net_test;
|
||||
|
||||
|
||||
/* Setups/teardown functions */
|
||||
@@ -215,13 +215,67 @@ START_TEST(test_netif_extcallbacks)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_netif_flag_set)
|
||||
{
|
||||
ip4_addr_t addr;
|
||||
ip4_addr_t netmask;
|
||||
ip4_addr_t gw;
|
||||
LWIP_UNUSED_ARG(_i);
|
||||
|
||||
IP4_ADDR(&addr, 0, 0, 0, 0);
|
||||
IP4_ADDR(&netmask, 0, 0, 0, 0);
|
||||
IP4_ADDR(&gw, 0, 0, 0, 0);
|
||||
|
||||
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
|
||||
|
||||
fail_if(netif_is_flag_set(&net_test, NETIF_FLAG_UP));
|
||||
fail_unless(netif_is_flag_set(&net_test, NETIF_FLAG_BROADCAST));
|
||||
fail_if(netif_is_flag_set(&net_test, NETIF_FLAG_LINK_UP));
|
||||
fail_unless(netif_is_flag_set(&net_test, NETIF_FLAG_ETHARP));
|
||||
fail_unless(netif_is_flag_set(&net_test, NETIF_FLAG_ETHERNET));
|
||||
fail_unless(netif_is_flag_set(&net_test, NETIF_FLAG_IGMP));
|
||||
fail_unless(netif_is_flag_set(&net_test, NETIF_FLAG_MLD6));
|
||||
|
||||
netif_remove(&net_test);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_netif_find)
|
||||
{
|
||||
struct netif net0;
|
||||
struct netif net1;
|
||||
LWIP_UNUSED_ARG(_i);
|
||||
|
||||
/* No netifs available */
|
||||
fail_unless(netif_find("ch0") == NULL);
|
||||
|
||||
/* Add netifs with known names */
|
||||
fail_unless(netif_add_noaddr(&net0, NULL, testif_init, ethernet_input) == &net0);
|
||||
net0.num = 0;
|
||||
fail_unless(netif_add_noaddr(&net1, NULL, testif_init, ethernet_input) == &net1);
|
||||
net1.num = 1;
|
||||
|
||||
fail_unless(netif_find("ch0") == &net0);
|
||||
fail_unless(netif_find("CH0") == NULL);
|
||||
fail_unless(netif_find("ch1") == &net1);
|
||||
fail_unless(netif_find("ch3") == NULL);
|
||||
/* atoi failure is not treated as zero */
|
||||
fail_unless(netif_find("chX") == NULL);
|
||||
fail_unless(netif_find("ab0") == NULL);
|
||||
|
||||
netif_remove(&net0);
|
||||
netif_remove(&net1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
/** Create the suite including all tests for this module */
|
||||
Suite *
|
||||
netif_suite(void)
|
||||
{
|
||||
testfunc tests[] = {
|
||||
TESTFUNC(test_netif_extcallbacks)
|
||||
TESTFUNC(test_netif_extcallbacks),
|
||||
TESTFUNC(test_netif_flag_set),
|
||||
TESTFUNC(test_netif_find)
|
||||
};
|
||||
return create_suite("NETIF", tests, sizeof(tests)/sizeof(testfunc), netif_setup, netif_teardown);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "lwip/etharp.h"
|
||||
#include "netif/ethernet.h"
|
||||
|
||||
struct netif net_test;
|
||||
static struct netif net_test;
|
||||
|
||||
static const u8_t broadcast[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
|
||||
|
||||
@@ -287,6 +287,43 @@ START_TEST(test_ip6_lladdr)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
/* Reproduces bug #57374 */
|
||||
START_TEST(test_ip6_frag_pbuf_len_assert)
|
||||
{
|
||||
ip_addr_t my_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x1);
|
||||
ip_addr_t peer_addr = IPADDR6_INIT_HOST(0x20010db8, 0x0, 0x0, 0x4);
|
||||
struct pbuf *payload, *hdr;
|
||||
err_t err;
|
||||
int i;
|
||||
|
||||
/* Configure and enable local address */
|
||||
test_netif6.mtu = 1500;
|
||||
netif_set_up(&test_netif6);
|
||||
netif_ip6_addr_set(&test_netif6, 0, ip_2_ip6(&my_addr));
|
||||
netif_ip6_addr_set_state(&test_netif6, 0, IP6_ADDR_VALID);
|
||||
|
||||
/* Create packet with lots of small pbufs around mtu limit */
|
||||
payload = pbuf_alloc(PBUF_RAW, 1400, PBUF_POOL);
|
||||
fail_unless(payload != NULL);
|
||||
for (i = 0; i < 16; i++) {
|
||||
struct pbuf *p = pbuf_alloc(PBUF_RAW, 32, PBUF_RAM);
|
||||
fail_unless(p != NULL);
|
||||
pbuf_cat(payload, p);
|
||||
}
|
||||
/* Prefix with header like UDP would */
|
||||
hdr = pbuf_alloc(PBUF_IP, 8, PBUF_RAM);
|
||||
fail_unless(hdr != NULL);
|
||||
pbuf_chain(hdr, payload);
|
||||
|
||||
/* Send it and don't crash while fragmenting */
|
||||
err = ip6_output_if_src(hdr, ip_2_ip6(&my_addr), ip_2_ip6(&peer_addr), 15, 0, IP_PROTO_UDP, &test_netif6);
|
||||
fail_unless(err == ERR_OK);
|
||||
|
||||
pbuf_free(hdr);
|
||||
pbuf_free(payload);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
/** Create the suite including all tests for this module */
|
||||
Suite *
|
||||
ip6_suite(void)
|
||||
@@ -296,7 +333,8 @@ ip6_suite(void)
|
||||
TESTFUNC(test_ip6_aton_ipv4mapped),
|
||||
TESTFUNC(test_ip6_ntoa_ipv4mapped),
|
||||
TESTFUNC(test_ip6_ntoa),
|
||||
TESTFUNC(test_ip6_lladdr)
|
||||
TESTFUNC(test_ip6_lladdr),
|
||||
TESTFUNC(test_ip6_frag_pbuf_len_assert)
|
||||
};
|
||||
return create_suite("IPv6", tests, sizeof(tests)/sizeof(testfunc), ip6_setup, ip6_teardown);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0)
|
||||
#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
|
||||
|
||||
#if (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13)
|
||||
typedef struct {
|
||||
TFun func;
|
||||
const char *name;
|
||||
@@ -24,6 +25,15 @@ typedef struct {
|
||||
#define tcase_add_named_test(tc,tf) \
|
||||
_tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1)
|
||||
|
||||
#else
|
||||
/* From 0.13.0 check keeps track of the method name internally */
|
||||
typedef const TTest * testfunc;
|
||||
|
||||
#define TESTFUNC(x) x
|
||||
|
||||
#define tcase_add_named_test(tc,tf) tcase_add_test(tc,tf)
|
||||
#endif
|
||||
|
||||
/** typedef for a function returning a test suite */
|
||||
typedef Suite* (suite_getter_fn)(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user