lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] test_mdns.c troubles


From: Gisle Vanem
Subject: [lwip-devel] test_mdns.c troubles
Date: Wed, 19 Dec 2018 15:05:33 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

Trying to build the unit-test on Windows (MSVC) with the newly
added test_mdns.c has given me lots of griefs:

  ../../src/apps/mdns/mdns.c(85): fatal error C1189:
  #error:  "If you want to use MDNS, you have to define LWIP_RAND=(random 
function)
  in your lwipopts.h"

But then further down (line 121):
  #ifdef LWIP_RAND
  /* first probe timeout SHOULD be random 0-250 ms*/

Why an '#error' and an '#ifdef' for the same condition?

AFAICS a good 'LWIP_RAND()' function for Windows
is supposed to be 'sys_win_rand()' in contrib/ports/win32/sys_arch.c.

But compiling this sys_arch.c from 'test/unit' picks up the
"wrong" sys_arch.h with a 'sema_t' incompatible with
'contrib/ports/win32/sys_arch.c'. In "unit-test mode", is
this 'sema_t' supposed to be this simple?

Carefully revising my '-I' paths fixed that. But having 2
sys_arch.c for the same program is IMHO not very pretty.
Can some 'sys_*' files be renamed to 'test_sys*' to avoid
more confusion?

Besides, I have some doubt regarding the Check lib.
Running 'lwip_unittests.exe', gives:
Running suite(s): IPv4
 IPv6
 UDP
 TCP
 TCP_OOS
 DEF
 MEM
 NETIF
 PBUF
Assertion "pbuf_copy() does not allow packet queues!" failed at line 1002 in 
../../src/core/pbuf.c
 TIMERS
 ETHARP
 DHCP
Assertion "overload in file/sname" failed at line 1589 in 
../../src/core/ipv4/dhcp.c
Assertion "overload in file/sname" failed at line 1589 in 
../../src/core/ipv4/dhcp.c
Assertion "overload in file/sname" failed at line 1589 in 
../../src/core/ipv4/dhcp.c
 MDNS
 MQTT
 SOCKETS
Assertion "tcp_connect: can only connect from state CLOSED" failed at line 1083 
in ../../src/core/tcp.c
Assertion "tcp_connect: can only connect from state CLOSED" failed at line 1083 
in ../../src/core/tcp.c
Assertion "tcp_connect: can only connect from state CLOSED" failed at line 1083 
in ../../src/core/tcp.c
Assertion "tcp_connect: can only connect from state CLOSED" failed at line 1083 
in ../../src/core/tcp.c
Assertion "tcp_connect: can only connect from state CLOSED" failed at line 1083 
in ../../src/core/tcp.c
100%: Checks: 110, Failures: 0, Errors: 0

Shouldn't these "Assertion" increment the "Failures:" count?

I see that '_ck_assert_failed()' is involved here, but this Check
function doesn't to anything for the statistics. Or is my Check-lib
from last year too old? I see that project has now moved from SF to
Github.

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]