William Skellenger
748cd807c7
more broken test cases for ipv6
2024-06-07 15:40:31 -04:00
William Skellenger
2a29247081
test passing
2024-06-07 13:54:46 -04:00
William Skellenger
5da7e95fa9
block with five characters is now handled correctly
2024-06-07 13:40:15 -04:00
William Skellenger
930c187c75
added new ipv6 valid addr test
2024-05-28 18:42:59 -04:00
Erik Ekman
1cc1536e6a
test/unit: fix inconsistent nullness check error
...
Inside a testcase, but still. Trying to address #160
2024-04-09 20:11:39 +02:00
Erik Ekman
20c9b117e1
test: Fix speling issues
...
Found by codespell
2023-10-14 17:51:01 +02:00
Simon Goldschmidt
9e2fb2806f
unittests: fix compiling in release mode
2023-10-10 20:14:52 +02:00
Simon Goldschmidt
66ef250b8c
Fix running IPv6 reassembly unit tests on 64-bit
2023-10-10 19:59:06 +02:00
Simon Goldschmidt
c8f42025ce
ipv6 reassembly: fix detecting holes in reassembled packets
...
Added unit test for reassembly.
See bug #64767
2023-10-10 16:31:16 +02:00
Simon Goldschmidt
14444c1c7f
mqtt: support binary Will Message
...
see patch #10049
2023-09-29 22:08:03 +02:00
Simon Goldschmidt
9672405eb9
test: unit: tcp: fix tcp state tests to not break other tests
...
On platform where check cannot fork (win32), the tcp_state tests crashed other tests.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 21:32:20 +02:00
Simon Goldschmidt
90c9a482a6
ci: fix compiling test_tcp_state.c; add to msvc project
2023-05-11 20:26:21 +02:00
Chen Yu Dong
f50c87da6f
ci: Add unit test suite to validate tcp state transitions
2023-05-10 22:02:43 +02:00
Simon Goldschmidt
64f75dbd89
pppos: fix compiling new pppos unit test
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-05-10 20:58:23 +02:00
David Cermak
6b734bbb2c
PPP: Add test exhibiting empty packet null-deref
...
Also updates lcp.c to compile with PPP_AUTH_SUPPORT=0 in clang
2023-05-10 20:42:27 +02:00
Florian La Roche
7c3aab2ea2
gcc warning for sign conversion
...
See patch #10143
2021-12-30 22:48:18 +01:00
Simon Goldschmidt
bb5ee3783a
fix compiling/running tests on win32
...
- new files
- different warning settings
- all tests run in a single process (no fork)
2021-05-21 22:00:49 +02:00
Erik Ekman
988ce1e80e
netif: Add test for netif_find
2021-02-27 12:28:14 +01:00
Erik Ekman
74231d6873
netif: Add test for netif_is_flag_set()
2021-02-08 19:29:33 +01:00
Erik Ekman
c825eb3604
tcp: Check tcp_output return values in tests
...
Found with clang-analyzer
2021-01-19 20:19:02 +01:00
Erik Ekman
21fba21054
test/unit: Update convenience makefile
...
Allow cleaning - useful when switching compiler between GCC/clang.
2021-01-19 20:19:02 +01:00
Erik Ekman
7b77378ed8
test/unit: Fix compilation of ip4 test
...
../../../../src/../test/unit/ip4/test_ip4.c: In function ‘test_ip4_icmp_replylen_short’:
../../../../src/../test/unit/ip4/test_ip4.c:291:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
fail_unless(linkoutput_byte_ctr == icmp_len + sizeof(unknown_proto));
Plus minor cleanup in second icmp reply test
2021-01-13 21:31:19 +01:00
Erik Ekman
d0c214feff
test/unit: Add convenience Makefile
...
To allow running them easily on *nix without changing directory.
2021-01-13 20:57:23 +01:00
Erik Ekman
35550eeab3
icmp: Fix copied length in response packets
...
Fixes bug #59364 , reported by Yi Guai
2021-01-13 20:31:55 +01:00
Erik Ekman
264a5a3e97
Rename IP and Ethernet equality checkers from _cmp to _eq
...
Functions ending in cmp are expected to return 0 on equality but these
return non-zero.
eth_addr_cmp -> eth_addr_eq
ip_addr_cmp -> ip_addr_eq
ip4_addr_cmp -> ip4_addr_eq
ip6_addr_cmp -> ip6_addr_eq
ip_addr_netcmp -> ip_addr_net_eq
ip4_addr_netcmp -> ip4_addr_net_eq
ip6_addr_netcmp -> ip6_addr_net_eq
ip_addr_cmp_zoneless -> ip_addr_zoneless_eq
ip6_addr_cmp_zoneless -> ip6_addr_zoneless_eq
ip6_addr_cmp_zone -> ip6_addr_zone_eq
ip6_addr_netcmp_zoneless -> ip6_addr_net_zoneless_eq
ip6_addr_nethostcmp -> ip6_addr_nethost_eq
ip6_addr_cmp_packed -> ip6_addr_packed_eq
ip6_addr_cmp_solicitednode -> ip6_addr_solicitednode_eq
All call sites have been changed, and fallback macros have been added to not
break external users.
2020-07-07 18:51:45 +02:00
Erik Ekman
047f3b3306
dns: Verify setting/getting servers in unit test
2020-07-04 18:57:41 +02:00
Erik Ekman
5b7524e10e
unit: Enable DNS
...
Avoid allocating in dns_init by enabling random source port.
2020-07-04 14:24:40 +02:00
Erik Ekman
2bf8fcd7c2
pbuf: Add pbuf_copy_partial_pbuf library function
...
Like pbuf_copy, but can copy part of a pbuf to an offset in another.
pbuf_copy now uses this function internally.
Replace pbuf_take_at loop in icmp6 with pbuf_copy_partial_pbuf().
2020-07-03 18:55:02 +02:00
Erik Ekman
942ca825d0
ip4: Fix missing END_TEST in ip4 test case
2020-07-01 21:09:49 +02:00
Erik Ekman
ec5f3a1563
ip6: Add ipv6 fragmentation test
...
Seems to work the same as ipv4, and that I was just confused by all the
loops when reading the code.
2020-07-01 20:17:29 +02:00
Erik Ekman
0bda621d3d
ip4: Verify ipv4 fragmentation sends all chunks right away
...
Ahead of investigation how ipv6 code behaves.
2020-07-01 20:16:24 +02:00
Erik Ekman
2faa2d7009
ip6: Rename pbuf in unit test
...
../../../../src/../test/unit/ip6/test_ip6.c: In function ‘test_ip6_dest_unreachable_chained_pbuf’:
../../../../src/../test/unit/ip6/test_ip6.c:314:16: error: ‘main’ is usually a function [-Werror=main]
struct pbuf *main = pbuf_alloc(PBUF_RAW, sizeof(udp_hdr), PBUF_ROM);
^~~~
cc1: all warnings being treated as errors
2020-07-01 10:46:33 +02:00
Erik Ekman
e2ae25d158
ip6: Add test for fragmenting special packet
...
Reproduces bug #57374 (Found by Hiromasa Ito).
2020-06-30 01:27:32 +02:00
Erik Ekman
90b3e45c31
pbuf: Add pbuf_copy test operating on chained pbufs
...
With the payload lengths not matching between source and destination.
Also remove redundant allocation check in other test, it is now done
in the test setup code.
2020-06-29 19:45:18 +02:00
Erik Ekman
bc1da0bddb
pbuf: Remove redundant tests that pbufs are freed
...
Already checked by lwip_check_ensure_no_alloc() in teardown function.
2020-06-24 01:00:12 +02:00
Erik Ekman
dd913250a9
icmp6: add test case for returning copy of chained pbufs
...
Currently fails due to bug #58553
2020-06-24 01:00:12 +02:00
Erik Ekman
b58e0061e0
unit: Improve message when the mem heap has usage
...
Show "mem heap still has 216 bytes allocated"
instead of "Assertion 'lwip_stats.mem.used == 0' failed"
2020-06-24 01:00:02 +02:00
Erik Ekman
ff67ce6e07
unit: Improve message when a memp pool has entries
...
Show "memp pool 'PBUF_REF/ROM' still has 2 entries allocated"
instead of "Assertion 'lwip_stats.memp[i]->used == 0' failed"
2020-06-22 00:51:09 +02:00
Erik Ekman
ea111c511e
unit: Support check v0.13.0 and later
...
Function name no longer needs to be fed separately when adding tests.
Also fix collision of non-static net_test variables in dhcp and netif
tests.
2020-06-19 15:39:15 +02:00
Simon Goldschmidt
74cd9a8644
ip4: add unit test for ip4addr_aton
2020-03-05 21:28:52 +01:00
Simon Goldschmidt
1ffcc5079c
Fix-more-typos-using-codespell
...
Committing nearly all changes done by 'codespell_check.sh -w'
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:53 +01:00
jona
d6a6b661d9
Fix typos using codespell
...
Conservative strategy was used, maybe other typos remain.
Rebased: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:41 +01:00
Simon Goldschmidt
dae8eb8d6e
adapt unit test to new netif ext callback reason
2020-01-13 19:37:59 +01:00
Joan Lledó
785b7aba3c
Sockets: Unit tests and apps corrections
...
* Include lwip/inet.h in some unit tests and apps
* Since they use htons() and pals.
* test/unit/api/test_sockets.c:
* write() could be declared by external socket headers
* Call lwip_write() instead.
* Code expects fcntl() to return 6
* But O_RDWR could have another value if external
socket headers are present
* Replace 6 by O_RDWR.
* apps/tftp/tftp.c:
* recv() could be declared by external socket headers
* Rename it to tftp_recv()
2019-08-11 20:12:47 +02:00
Joan Lledó
f92d6702bc
Sockets: declare msghdr->msg_iovlen as msg_iovlen_t
...
* Lwip declares msghdr->msg_iovlen as int, but when
using external socket headers, some systems declare
msg_iovlen as size_t or others.
* This patch creates a new type msg_iovlen_t and
expects users to typedef it to the type they need
for their system.
2019-08-11 20:12:02 +02:00
Simon Goldschmidt
2ebebe7287
fix compiling unit tests after adding compile-time check for LWIP_NETCONN_FULLDUPLEX
2019-07-10 21:29:13 +02:00
Simon Goldschmidt
752cdb1a53
udp: fix udp_bind for IPADDR_TYPE_ANY
...
See bug #55171
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-02-26 14:48:44 +01:00
Simon Goldschmidt
2037ec371c
test: fix compiling unit test on win32
2019-01-30 14:53:41 +01:00
Jacob Kroon
2f098c42a7
Fix compile of UDP unit test
...
Fix building unit tests via contrib/ports/unix/check on Debian 9, gcc 6.3.0.
Fixes:
<snip>/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘ip1’ will never be NULL [-Werror=address]
#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr),iptype); }}while(0)
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
2019-01-03 07:09:51 +01:00
Dirk Ziegelmeier
91037b4c28
Add testcase for bug #55171 : Binding UDP PCB with different IP type PCBs does not work
2018-12-06 14:40:20 +01:00