1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-23 13:33:49 +01:00

1347 Commits

Author SHA1 Message Date
mguetschow
57de45cf89
Merge pull request #21308 from benpicco/dec_as_hex
sys/bcd: add bcd_buf_from_u32()
2025-04-03 10:48:33 +00:00
Joshua DeWeese
f265cec494 tests/unittests: fix include guards in doc example
This patch updates the example given to conform to the recomended
placement of include guards.

See issue #21335
2025-04-02 20:11:50 -04:00
Benjamin Valentin
8f4dec6559 tests/unittests: add test for bcd_buf_from_u32() 2025-04-02 19:00:48 +02:00
Benjamin Valentin
a104c3f3e0 tests/unittests: add test for reverse_buf() 2025-04-02 18:45:37 +02:00
Mikolai Gütschow
69c15e1754
boards: make BOARD=native an alias for BOARD=native32 2025-04-01 12:39:06 +02:00
Marian Buschsieweke
e22e357374
tests/unittests: add hack for nanocoap
nanocoap depends on sock_udp, which in turn needs `sock_types.h` to be
available. When no network stack is in use, that sadly is not the case.
To work around the issue, we just manually add the include paths if
`gnrc_sock` is not used.

This fixes an issue with compilation of only the nanocoap unit tests
without also including the GNRC tests.
2025-02-05 15:01:47 +01:00
mguetschow
e1cd685f16
Merge pull request #21167 from maribu/tests/unittests/nanocoap/invalid_option
tests/unittests: test parsing of out-of-bounds CoAP opt
2025-01-28 09:08:25 +00:00
Marian Buschsieweke
e64e5cd369
tests/unittests: test parsing of out-of-bounds CoAP opt
This adds a unit test to nanocoap that checks that nanocoap's
`coap_parse()` indeed returns `-EBADMSG` when a CoAP Option exceeds the
packet's boundaries. This is relied upon in the option parsing code
at various places by omitting the bounds checking, so we should better
make sure that bounds checking is done correctly here and those
functions can indeed rely upon bounds checking being done correctly
before.
2025-01-27 18:12:55 +01:00
Kevin "Tristate Tom" Weiss
19cde44b64
Merge pull request #20966 from crasbe/pr/remove_nrf6310
boards/nrf6310: Remove nRF6310 board from RIOT
2025-01-27 10:22:16 +00:00
Karl Fessel
254d1336d3 tests/test-rtc: test retrieval of unix-time 2025-01-24 16:35:17 +01:00
crasbe
80e94a5906 tests/*: remove nRF6310 board 2025-01-22 16:01:42 +01:00
benpicco
243ca3114b
Merge pull request #20843 from benpicco/string_writer
sys/string_utils: add string_writer helper
2024-12-20 16:36:09 +00:00
Benjamin Valentin
2bf4c715d8 unittests: add test for string_writer 2024-12-17 12:38:14 +01:00
Marian Buschsieweke
4d44abcc0e
Merge pull request #21073 from benpicco/sys/chunked_ringbuffer-start_discard
sys/chunked_ringbuffer: discard stale chunk when starting a new one
2024-12-14 09:28:14 +00:00
Benjamin Valentin
532f018b3a tests/unittests: chunked_ringbuffer: add test for half-written chunk 2024-12-13 16:30:28 +01:00
Marian Buschsieweke
c7af4b25a6
sys/net/nanocoap: fix invalid RST messages
An RST message has no token, so don't reply with a token when sending
RST.

This also adds unit tests to ensure this this exact bug does not sneak
back in.
2024-12-12 14:28:28 +01:00
Marian Buschsieweke
6b1279348a
sys/fmt: add scn_buf_hex()
This adds a function to convert a hex string to a byte array.
2024-12-12 14:28:28 +01:00
Benjamin Valentin
cb554fd342 tests/unittests: use proper initializers for gnrc_pktsnip_t 2024-11-16 16:39:32 +01:00
Marian Buschsieweke
2b6f65a08a
build_system/xfa: change API to fix alignment
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
2024-11-07 16:30:01 +01:00
Marian Buschsieweke
e52659c4cd
tests/unittests: Increase test coverage for coap_build_reply_header()
This increases test coverage for coap_build_reply_header() for the case
that extended tokens are used. The test validates the correctness of
the return value and the correctness of the assembled reply.
2024-11-04 21:18:08 +01:00
Marian Buschsieweke
2b3da3911c
tests/unittests: increase coverage for coap_get_total_hdr_len()
Previously the corner case when RFC 8974 extended TKL fields are used
the result of coap_get_totel_hdr_len() was not tested, resulting in a
bug slipping through the test. This increase the test coverage.
2024-11-01 13:59:20 +01:00
Marian Buschsieweke
8c9105c60c
tests/unittests: fix compilation with newlib and GCC 13.2.1
newlib (nano) is missing 64 bit support in stdio and inttypes.h. This
works around the issue.
2024-10-09 22:32:43 +02:00
Benjamin Valentin
0463b2705f
unittests: add test for dns_msg
Co-Authored-By: Martine Lenders <martine.lenders@tu-dresden.de>
2024-09-27 17:40:11 +02:00
xnumad
560d8c8ee5 gnrc_ipv6_nib: test: Force unspecified next hop addresses 2024-08-31 10:40:17 +02:00
Benjamin Valentin
312a550f1a treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
Marian Buschsieweke
48838f4b83
Merge pull request #20513 from maribu/sys/vfs/atomic_utils
sys/vfs: use atomic_utils rather C11 atomics
2024-04-16 06:04:18 +00:00
Teufelchen1
0ddbba3bef unittests: Move at test to driver tests 2024-04-05 13:17:04 +02:00
Teufelchen1
96e748d959 sys/phydat: Remove deprecated print function
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2024-04-03 15:29:19 +02:00
Marian Buschsieweke
45c473d721
sys/vfs: use atomic_utils rather C11 atomics
This has the following advantages:

- faster and leaner when C11 atomics are not efficient (e.g. on LLVM
  this is almost always the case, as LLVM will only use efficient
  atomics if it doesn't has to bail out to library calls even for
  exotic things)
    - Even for GCC e.g. on the nucleo-f429zi this safes 72 B of .text
      for examples/filesystem despite runtime checks added for
      over- and underflow
- less pain in the ass for C++ and rust users, as both C++ and
  c2rust are incompatible with C11 atomics
- adds test for overflow of the open file counter for more robust
  operation
- adds `assumes()` so that underflows are detected in non-production
  code
2024-03-27 11:26:15 +01:00
Karl Fessel
e6f03db4e2
Merge pull request #20423 from derMihai/mir/at_urc
drivers/at: fix URC handling and add better testing
2024-03-25 14:33:46 +00:00
Teufelchen
4982049904
Merge pull request #20484 from mguetschow/hashes-sha512-trunc
sys/hashes: support for SHA-{384,512/{224,256}}
2024-03-25 11:48:22 +00:00
Mikolai Gütschow
9300007cf1
sys/hashes: support for SHA-{384,512/{224,256}}
pkg/esp32_sdk: rename sha384_init to avoid name clash
2024-03-25 12:35:10 +01:00
Karin Lammers
623f78d0d6 tests/unittests/README: link to wiki updated
This commit changes the link about supported boards in the README from the wiki page to the RIOT-OS website.
Since the wiki is not up to date.
See also [this pull request](https://github.com/RIOT-OS/riot-os.org/pull/109/files) that fixed the same link on the website.
2024-03-22 16:09:45 +01:00
Mihai Renea
63e057cb50 drivers/at: Fix sync URC handling. at_send_cmd_get_lines() keeps EOL. 2024-03-20 14:32:09 +01:00
Dylan Laduranty
c5710392b2
Merge pull request #20464 from Enoch247/add-to-cib
core/lib/cib: add new functionality
2024-03-19 08:47:05 +00:00
Joshua DeWeese
b6481654ba core/lib/cib: add several new peek functions
This patch adds calls to be able to peek at items other than just the
oldest item in a cib based FIFO. It also adds an "unsafe" peek to match
the existing "unsafe" put and get functions.
2024-03-18 10:14:34 -04:00
Teufelchen1
79a77dbfa0 tests: Add cases to the scn_u32_hex unittest 2024-03-12 18:28:20 +01:00
Joshua DeWeese
45752a3002 core/lib/cib: remove superfluous init
This patch removes a superfluous init of the cib. The struct is already
initialized by the test fixture's setup function.
2024-03-12 12:54:46 -04:00
Joshua DeWeese
45f865965f core/lib/cib: remove magic number from unit test 2024-03-12 12:54:46 -04:00
Teufelchen1
4917b59005 tests: Cover API of scn_u32_hex in the unittest 2024-03-12 11:46:07 +01:00
Benjamin Valentin
b274e8a117 tests/unittests: report results to the environment on native 2024-03-04 14:43:31 +01:00
benpicco
d08fb3f144
Merge pull request #20043 from bergzand/pr/nanocoap_cache_options
nanocoap/cache: Extend with option-only cache keygen
2024-02-13 15:23:59 +00:00
Koen Zandberg
2c9bf3fbc2
unittests: Extend nanocoap_cache with option-only 2024-02-12 21:20:39 +01:00
mguetschow
de1efc6772
Merge pull request #20344 from Teufelchen1/chore/fmt_test_3
tests: Add NULL pointer argument test for fmt_lpad/to_lower/str
2024-02-09 10:41:17 +00:00
Teufelchen1
dbcfa1bdc8 tests: Add NULL pointer argument test for fmt_lpad/to_lower/str 2024-02-09 11:03:05 +01:00
Joshua DeWeese
fa7a577728 tests/unittests: add test for ABS() macro 2024-02-08 10:56:11 -05:00
Joshua DeWeese
b1cb2435d8 tests/unittests: add unit test for LIMIT() macro 2024-02-08 10:56:00 -05:00
Joshua DeWeese
8e3bbca8b5 tests/unittests: add tests for MAX()/MIN() macros 2024-02-08 10:55:37 -05:00
benpicco
4d9e8a8dde
Merge pull request #20335 from fzi-haxel/pr/native64-board
native64: Separate board for 64-bit native
2024-02-05 22:58:02 +00:00
Frederik Haxel
5ed0bafc92 examples, tests: Changes for the native64 board
- Adapted build system and test checks for the native boards to include native64
- Added `native64` to the same tests as `native`
2024-02-05 22:02:14 +01:00