1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

1330 Commits

Author SHA1 Message Date
benpicco
59eb017448
Merge pull request #20198 from Teufelchen1/chore/fmt_test
tests: Slightly increase coverage of fmt unittests
2024-01-02 14:02:59 +00:00
Frederik Haxel
475a55136a unittests/tests-fib: test cleanup
- Added helper function to avoid 'format-truncation' warning
- Changed all `size_t` types to `unsigned`
- Changed function names from `_FIB_` to `_fib_`
2023-12-21 12:06:51 +01:00
Frederik Haxel
fa0cf05d0a tests: Use size_t print format specifier
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-12-21 12:02:37 +01:00
Teufelchen1
4a62b9ff31 tests: Slightly increase coverage of fmt unittests 2023-12-19 18:11:28 +01:00
Benjamin Valentin
d6ca03aaa9 tests/unittests: coap_get_uri_query() -> coap_get_uri_query_string() 2023-12-19 14:02:28 +01:00
Benjamin Valentin
d525807598 unittests/tests-mtd: expect mtd_write() to always succeed
The MTD layer now takes care of splitting up writes, so it
should always work (as long as the destination address is
within the memory region)
2023-12-13 16:50:41 +01:00
Frederik Haxel
4a1d07ab64 tests/unittests/tests-hashes: fixes wrong string length 2023-12-11 14:15:50 +01:00
Gunar Schorcht
cfc2232f11 tests/unittests: fix MTD unit test compilation 2023-12-07 15:32:49 +01:00
Mikolai Gütschow
6935ea21e7
sys/hashes: add SHA-512 support 2023-11-29 19:18:51 +01:00
Benjamin Valentin
b8ec36aef3 tests/unittests: coap_get_code() -> coap_get_code_decimal() 2023-11-28 13:11:11 +01:00
Marian Buschsieweke
e5725f2194
tests/unittests: add a unit test for ztimer
This adds test coverage for removing ztimers with focus on ensuring that
offsets are correctly updated on subsequent timers (e.g. not having
timers fire too early).
2023-10-23 15:44:52 +02:00
bors[bot]
eee4ce1050
Merge #19958
19958: tests/unittests: blacklist LLVM on native r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-10-23 07:24:36 +00:00
31df2ba0aa
Fletcher32: Add incremental API 2023-10-18 13:22:44 +02:00
Benjamin Valentin
7c718ae34b tests/unittests: blacklist LLVM on native
This test is randomly failing CI, so disable it.
2023-09-29 10:38:43 +02:00
Gunar Schorcht
4591cebeef boards/sipeed-longan-nano-tft: blacklist in tests and examples 2023-08-06 12:56:36 +02:00
bors[bot]
72ca81b65c
Merge #19487 #19808
19487: nanocoap: implement extended tokens (RFC 8974) r=benpicco a=benpicco



19808: boards: add ESP32-S3-USB-OTG support r=benpicco a=gschorcht

### Contribution description

This PR provides the support for the [ESP32-S3-USB-OTG](https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/user_guide.html) board.

The SD card can only be used in SPI mode at the moment. As soon as PR #19786 is merged, the SD/MMC support can be enabled and the SD card can then be used in SD mode with 4-bit data bus width.

The display uses uses the ST7789 driver IC that is compatible with the ST7735. For that purpose the ST7735 driver is extended by a pseudomodule definition `st7789` for the ST7789 which is enabled by the board and enables automatically the `st7789` (e57c48a33ee2a869c15603788e5306ba066f91cf). Vise versa, board's `Makefile.dep` enables automatically the `st7789` pseudomodule if the `st7735` is used. The pseudomodule `st7789` is just used to increase the upper limit for supported lines. This change is also part of PR #19807.

~The PR includes a very small documentation fix for ESP32-S3-DevKit board that was noticed during the development of this board definition (1155b6ac1b8efa39d8a0bd7150e602095159fdc1).~

### Testing procedure

The board has been tested with all basic tests for supported hardware including `tests/driver/st3375`:

![IMG_20230707_105556](https://github.com/RIOT-OS/RIOT/assets/31932013/88d4ac11-0c02-4339-a423-7900e1c0904c)

- [x] tests/drivers/st3375
- [x] tests/periph/gpio
- [x] tests/periph/pwm
- [x] tests/periph/spi
- [x] tests/periph/uart
- [x] tests/sys/usbus_cdc_ecm 

### Issues/PRs references


Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-07 17:41:40 +00:00
Marian Buschsieweke
e0b5d63021
tests/unittests: improve int size detection
Deduce from the value of `INT_MAX` whether `int` is 16 bit or 32 bit,
rather than check CPU names.
2023-06-19 14:01:56 +02:00
bors[bot]
35d3896d47
Merge #19706
19706: boards/olimex-msp430-h2618: add new board r=maribu a=maribu

### Contribution description

This adds support of the Olimex MSP430-H2618 board. This board has plenty of RAM and ROM for an MSP430 board (even more than the z1), but still is easily obtainable.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-06-09 05:09:49 +00:00
Marian Buschsieweke
d28d4cdfa3
boards/olimex-msp430-h2618: add new board 2023-06-08 23:42:50 +02:00
Benjamin Valentin
7634f4c7e9 tests/unittests: avoid float in tests-bloom 2023-06-08 15:53:03 +02:00
Benjamin Valentin
c01c470e8f tests/unittests: nanocoap: add test for extended token 2023-06-05 18:35:29 +02:00
Karl Fessel
8f8e29d9bd unittest/sys_color: extend test 2023-06-05 13:00:23 +02:00
bors[bot]
67c011f5a4
Merge #19686 #19687
19686: sys/string_utils: add memchk() r=maribu a=benpicco



19687: tests/unittests: remove old workaround for SAML1X and gcc9.X bug r=maribu a=dylad

### Contribution description
This reverts #13462, this workaround is no longer needed with newer GCC version.

### Testing procedure

Try to compile tests/unittests for `saml11-xpro` or `saml10-xpro`

### Issues/PRs references

This is a revert of #13462.


Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-30 23:26:16 +00:00
Dylan Laduranty
6499b698fa tests/unittests: remove old workaround for SAML1X and gcc9.X bug
This reverts #13462, this workaround is no longer needed with newer GCC version

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-30 21:44:22 +02:00
Benjamin Valentin
55dc66e942 tests/unittests: libc: add test for memchk() 2023-05-30 20:40:28 +02:00
Marian Buschsieweke
e7d1c4abc0
boards/olimex-msp430-h1611: new board 2023-05-16 15:03:12 +02:00
bors[bot]
718a4513b5
Merge #19368 #19529 #19531
19368: debug: add DEBUG_BREAKPOINT() macro, set breakpoint on failed assertion r=benpicco a=benpicco



19529: cpu/stm32/periph/dac: optimize setting DAC r=benpicco a=Enoch247

### Contribution description

The current implmentation right shifted the 16 bit value passed into `dac_set()` down to the 12 bits that the DAC is actually capable of. This patch drops the shift and instead writes the 16 bit value to the DAC's left aligned 12 bit wide data holding register.


### Testing procedure

do something like:
``` c
#include "perip/dac.h"

int main(void)
{
    dac_set(DAC_LINE(0), 0xffff/2);
    return 0;
}
```
- observe DAC's output is half of vref


### Issues/PRs references

- none known


19531: tests/unittests: allow passing `UNIT_TESTS` via env r=benpicco a=kaspar030



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-05-02 18:08:42 +00:00
2c583851fa tests/unittests: tests-core-mbox: add missing container.h include 2023-05-02 13:57:44 +02:00
bf768cbccb tests/unittests: allow passing UNIT_TESTS via env 2023-05-02 13:54:01 +02:00
Gunar Schorcht
0cdcac96bc tests/unittests/test-mtd: use emulated MTD as test mockup 2023-04-12 06:27:12 +02:00
Benjamin Valentin
eb9fbfb790 tests/unittests: add test for bf_clear_all() 2023-03-17 00:08:16 +01:00
bors[bot]
4ccf0af0b1
Merge #19320
19320: sys/vfs: add force option to vfs_umount() r=miri64 a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-02-28 16:55:56 +00:00
Martine Lenders
2658eb151b
tests: test the -EBUSY case for vfs_umount() 2023-02-28 17:36:32 +01:00
Benjamin Valentin
c19c25e078 tests: adapt to vfs_umount() API change 2023-02-28 17:24:03 +01:00
Marian Buschsieweke
7e58bea1bd
examples,tests: Update Makefile.cis 2023-02-27 12:31:04 +01:00
bors[bot]
4809b687b6
Merge #19292 #19307
19292: sys/phydat: Fix unit confusion r=miri64 a=maribu

### Contribution description

Previously, `UNIT_G` was used for g-force with the correct symbol `g`, `UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs` (which is an alternative correct symbol).

To avoid confusion between G-Force, Gauss, and Gram the units have been renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition, gram now uses the correct symbol `g`; which sadly is the same as for g-force. But usually there is enough context to tell them apart.

### Testing procedure

Green CI

### Issues/PRs references

None

19307: nanocoap_link_format: fix off-by-one error r=miri64 a=benpicco



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-23 21:25:12 +00:00
bors[bot]
72a0f1972d
Merge #18746 #19161
18746: sys/clif: Fixing out of bounds read under certain conditions r=maribu a=Teufelchen1

Hi 😈

This fixes a potential out of bounds read in clif_encode_link. There is no code in RIOT that can be exploited.
The fix does not break the current API but alters the behaviour slightly. Before the change, the length attributes of `clif_attr_t` where optional. If missing, the length was deduced using `strlen()`. This fix makes those parameters required and if they are `0` it operates as if the length really is `0`. This might not be ideal but it is the only non api breaking fix I could think off. 
```c
typedef struct {
    char *value;                  
    unsigned value_len;    NO LONGER OPTIONAL
    const char *key;               
    unsigned key_len;       NO LONGER OPTIONAL
} clif_attr_t;
```
Depends on #18744

cc `@leandrolanzieri` 

19161: bors.yaml: re-activate labels check + add block_labels r=miri64 a=miri64



Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-02-23 16:39:44 +00:00
Marian Buschsieweke
3c287c058d
sys/phydat: Fix unit confusion
Previously, `UNIT_G` was used for g-force with the correct symbol `g`,
`UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which
would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs`
(which is an uncommon but correct symbol).

To avoid confusion between G-Force, Gauss, and Gram the units have been
renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition,
gram now uses the correct symbol `g` and Gauss uses `G`.
2023-02-23 16:44:24 +01:00
Teufelchen1
8c295ab7cf sys/clif: Fixing out of bounds read under certain conditions 2023-02-23 15:45:03 +01:00
chrysn
5db24d4f51 gcoap: Rename gcoap_get_resource_list_tl to gcoap_get_resource_list
This is an API change in the latter, which would typically now take an
extra argument GCOAP_SOCKET_TYPE_UNDEF.

Follow-Up-For: https://github.com/RIOT-OS/RIOT/pull/16688
2023-02-21 20:22:46 +01:00
bors[bot]
f341ad6c9c
Merge #17045 #19243
17045: sys/coding: add XOR based coding module r=benpicco a=benpicco



19243: cpu/gd32v: add periph_gpio_ll and periph_gpio_ll_irq support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_gpio_ll` and `periph_gpio_ll_irq` support for GD32VF103. Level triggered interrupts are emulated.

`periph_gpio_ll_irq` could be split off from this PR as a separate PR if necessary.

### Testing procedure

Use any GD32V board and connect PA0 -> PB0 and PA1 -> PB1 where PA is the output port and PB the input port. With these connections `tests/periph_gpio_ll` should work.
```
BOARD=sipeed-longan-nano make -j8 -C tests/periph_gpio_ll flash term
```

If necessary, change the input and output pins by setting the environment variables and connect the corresponding pins, for example for `seeedstudio-gd32` PA1 -> PB8 and PA8 -> PB9:
```
PIN_OUT_0=1 PIN_OUT_1=8  PIN_IN_0=8 PIN_IN_1=9 BOARD=seedstudio-gd32 make -j8 -C tests/periph_gpio_ll flash term
```

### Issues/PRs references


Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-02-07 17:39:20 +00:00
Benjamin Valentin
24cb2dada8 tests/coding: add tests for XOR codding 2023-02-07 14:09:39 +01:00
Gunar Schorcht
42ec4f04eb tests: add sipeed-longan-nano to Makefile.ci 2023-01-24 00:39:55 +01:00
bors[bot]
096ed0048a
Merge #18950
18950: tests/unittests: add unit tests for core_mbox r=benpicco a=maribu

### Contribution description

As the title says

### Testing procedure

The test cases are run on `native` by Murdock anyway.

### Issues/PRs references

Split out of https://github.com/RIOT-OS/RIOT/pull/18949

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-03 22:19:39 +00:00
Marian Buschsieweke
d2a3ff3d83
boards/{bluepill*,blackpill*}: rename and improve doc
- renamed:
    - `bluepill` --> `bluepill-stm32f103c8`
    - `bluepill-128kib` --> `bluepill-stm32f103cb`
    - `blackpill` --> `blackpill-stm32f103c8`
    - `blackpill-128kib` --> `blackpill-stm32f103cb`
- doc:
    - added link to corresponding hardware page on the STM32-base
      project
    - added picture
2023-01-02 16:23:10 +01:00
Marian Buschsieweke
9b3df5b4ff
tests/unittests: add unit tests for core_mbox 2022-12-09 14:47:11 +01:00
Juergen Fitschen
71a606a1db
Merge pull request #17607 from jue89/feature/ztimer-ondemand
ztimer: add ztimer_ondemand module for implicit power management
2022-12-06 18:30:16 +01:00
Kevin "Tristate Tom" Weiss
16b616218c
Merge pull request #18734 from Teufelchen1/tests/uri_parser
unittests/uri_parser: Rework tests to be more verbose
2022-11-29 19:43:34 +01:00
Teufelchen1
49efb727da unittests/uri_parser: Rework tests to be more verbose 2022-11-29 16:47:07 +01:00
Karl Fessel
54ada3685a tests: add missing includes 2022-11-22 13:39:35 +01:00
Jue
9fbb4d3391 ztimer/convert: only extend the clocks if ztimer_ondemand isn't used 2022-11-22 00:25:34 +01:00
Jue
4013dff1fd ztimer: acquire and release clock for running timers 2022-11-22 00:25:34 +01:00
Jue
a228ca7548 ztimer: introduce ztimer_acquire() and ztimer_release() 2022-11-22 00:25:34 +01:00
Marian Buschsieweke
bec46c55bd
Merge pull request #18879 from benpicco/bf_popcnt
sys/bitfield: add bf_popcnt()
2022-11-11 11:35:14 +01:00
Benjamin Valentin
867ba0666a tests/unittests: add tests for bf_popcnt() 2022-11-10 23:52:35 +01:00
Karl Fessel
aa31dd7d66 core/macros: rewrite DIV_ROUND, DIV_ROUND_UP; add DIV_ROUND_INF 2022-11-09 17:59:18 +01:00
Karl Fessel
228d8e72c0 unittest/core-macros: add negtive cases for DIV_ROUND and DIV_ROUND_UP 2022-11-09 17:59:18 +01:00
Marian Buschsieweke
e402e3f57a
Merge pull request #18849 from benpicco/core-SIGNOF
core/macros: fix SIGNOF() macro when applied to size_t
2022-11-09 17:54:00 +01:00
Benjamin Valentin
8f8bb6ce84 tests/unittests: core: add test for SIGNOF(size_t) 2022-11-09 14:23:51 +01:00
Benjamin Valentin
17374301c9 tests/unittests: add tests for bf_set_all() 2022-11-04 16:48:49 +01:00
Benjamin Valentin
6185715aea tests/unittests: add tests for new bitfield functions 2022-11-02 13:06:06 +01:00
Martine Lenders
3c7c9fefd6
tests/unittests: fix get_frame_hdr_len tests for hardened parsing 2022-10-29 00:58:35 +02:00
Karl Fessel
c29d2f1afb test/unittest: cleanup most vera++ complains 2022-10-27 16:31:59 +02:00
Martine Lenders
d485598b3a
Merge pull request #18744 from Teufelchen1/fix/clif_0
sys/clif: Fixing out of bounds read under certain conditions
2022-10-26 23:38:43 +02:00
Teufelchen1
499b635ae9 sys/clif: Fixing out of bounds read under certain conditions 2022-10-26 13:44:01 +02:00
Jan Romann
61d1516c6f tests/nanocoap: add unit test for Accept option helper 2022-10-19 16:44:13 +02:00
chrysn
982ec4dcda
gnrc_netreg: Use locks around netreg
This eliminates race conditions around unregistering netdevs.

gnrc_netreg_lookup-style functions perform a DEVELHELP check on whether
that lock is held.
2022-10-14 03:35:15 +02:00
Benjamin Valentin
c46d9d7360 tests/unittests: sock_util: test with schema of uneven length 2022-10-10 19:04:15 +02:00
Benjamin Valentin
eb527d3481 tests/unittests: add test for CRC-32 checksum 2022-10-04 15:40:53 +02:00
benpicco
c35a4ba577
Merge pull request #18621 from benpicco/strscpy
sys/string_utils: add strscpy()
2022-09-28 19:11:42 +02:00
Benjamin Valentin
3fc4d9d98c tests/unittests: add tests for libc module 2022-09-26 19:06:46 +02:00
benpicco
4737d8148a
Merge pull request #17702 from benpicco/core/macros/math
core/macros: add math helper macros
2022-09-22 14:14:24 +02:00
Benjamin Valentin
27b3c115d2 tests/unittests: add tests core math macros 2022-09-21 16:00:26 +02:00
Martine Lenders
d5e63a5e46
Merge pull request #18096 from Teufelchen1/feat/port_parsing
sys/uri_parser: Adding the port as uint16_t
2022-09-19 13:40:53 +02:00
Teufelchen1
df8fe4476d sys/uri_parser: Adding the port as uint16 2022-09-08 11:32:49 +02:00
Marian Buschsieweke
754ad23de5
Merge pull request #18539 from miri64/hashes_cmac/cleanup/rename
hashes_cmac: rename to hashes_aes128_cmac
2022-08-31 19:06:21 +02:00
Martine Lenders
27e68787c5
tests: rename cmac to aes128_cmac 2022-08-31 10:43:25 +02:00
Teufelchen1
a25934ca16 sys/checksum: Adding four crc16 variations: ccitt-aug/false/kermit/mcrf4xx 2022-08-30 15:37:04 +02:00
Martine Lenders
f15fbb3c15
Merge pull request #18441 from miri64/dns_cache/fix/ttl0
dns_cache: handle TTL=0 properly
2022-08-23 02:58:13 +02:00
Jose Alamos
f6fd8fafd8
unittests/bhp_msg: add initial unittests 2022-08-19 12:01:31 +02:00
benpicco
fc33f887b5
Merge pull request #18438 from Ziesie1/Ziesie1-patch-1
tests/unittests: Correct typo in documentation
2022-08-16 18:07:52 +02:00
Martine Lenders
7d2c4c4cbc
tests/unittests/tests-dns_cache: add test case for TTL=0 2022-08-11 14:07:54 +02:00
Ziesie
dc928108b9
tests/unittests: Correct typo in Documentation 2022-08-11 11:32:28 +02:00
Jose Alamos
c80e0e1559
unittests/bhp_event: add initial unittests 2022-08-11 10:57:54 +02:00
Karl Fessel
c48f53f8df test/unittest: initilize ztimer64 is required, use xtimer test-fib
test-fib has direct use of xtimer -> it needs to use the module
2022-07-25 13:54:59 +02:00
Karl Fessel
1f80bfc898 unittest/main: do not intialize xtimer if ztimer_xtimer_compat 2022-07-21 14:48:43 +02:00
Martine Lenders
8bec9c1115
sock_dns_cache: move to dns_cache
Also piggy-back some fixes to the unittests and submodule handling
2022-07-18 15:27:58 +02:00
Benjamin Valentin
d09d29a581 tests/unittests: add tests sock_dns_cache 2022-07-15 00:03:49 +02:00
Teufelchen1
1231807bab Documentation: Renaming OS X to macOS 2022-06-23 17:25:48 +02:00
Martine Lenders
f91c8799c6
unittests: fix assertion for nanocoap_cache_key_compare()
The doc states only that the result is <0, not -1. The result isn't the
latter for some platforms (see
https://github.com/RIOT-OS/RIOT/runs/6534330788?check_suite_focus=true#step:13:696)
2022-05-23 12:22:58 +02:00
chrysn
dc7bc9f854
Merge pull request #17683 from chrysn-pull-requests/mtd-granularity
mtd: Introduce write granularity
2022-05-20 11:52:03 +02:00
Marian Buschsieweke
158203fe71
Merge pull request #17651 from benpicco/fs/constfs-cleanup
sys/fs/constfs: drop dummy implementations
2022-05-19 23:23:49 +02:00
Benjamin Valentin
a587069b18 vfs: return -EROFS if remove operation is not implemented 2022-05-19 11:43:08 +02:00
benpicco
025af7534f
Merge pull request #18067 from kfessel/p-unittest_sock-read
unittest/sock_util: move test_strings to their tests
2022-05-17 09:37:53 +02:00
Cenk Gündoğan
fb3f1a2138
Merge pull request #17888 from miri64/gcoap/enh/caching
gcoap: add nanocoap_cache support for clients
2022-05-13 15:39:10 +02:00
Martine Lenders
9a54e7ef7f
Merge pull request #18099 from kaspar030/unittests_native_asan
unittests: enable ASAN on native
2022-05-13 14:11:59 +02:00
Martine Lenders
dbed2b48ea
nanocoap_cache: add helper function to check if entry is stale 2022-05-13 12:14:55 +02:00
Martine Lenders
e6a9443932
tests/unittests/tests-gcoap: adapt for automatically added ETag option 2022-05-13 12:14:55 +02:00
dcf5cda260 tests/unittests/uri_parser: increase VEC_MSG_LEN
Previous value tripped ASAN. Increase to sth with room to spare.
2022-05-13 11:47:17 +02:00
3a0e5fd775 tests/unittests: enable address sanitizer for native 2022-05-11 21:49:57 +02:00