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

tests/sys/snprintf: use printf_long_long

This is required to support printing 64 bit numbers, as is done in the
test.

In addition that 64 bit formatting test is feature gated, so that users
can simply comment out the `USEMODULE += printf_long_long` to fit tiny
boards.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
This commit is contained in:
Marian Buschsieweke 2025-08-21 10:35:46 +02:00
parent 3415656a4a
commit 4a84f6f58e
No known key found for this signature in database
GPG Key ID: 758BD52517F79C41
2 changed files with 13 additions and 1 deletions

View File

@ -4,4 +4,9 @@ include ../Makefile.sys_common
# to compile due to PRI*64 macros not being defined
FEATURES_BLACKLIST := arch_avr8
# This enables support for printing 64 bit numbers. You can comment this out
# to shrink the test app. The test will skip the corresponding test
# automatically if printf_long_long is not used.
USEMODULE += printf_long_long
include $(RIOTBASE)/Makefile.include

View File

@ -27,6 +27,8 @@
#include <string.h>
#include <unistd.h>
#include "modules.h"
static bool failed = false;
static void check(const char *expected, const char *got, int retval)
@ -277,7 +279,12 @@ int main(void)
test_int8();
test_int16();
test_int32();
test_int64();
if (IS_USED(MODULE_PRINTF_LONG_LONG)) {
test_int64();
}
else {
puts("WARNING: Module printf_long_long not used, skipping test for 64 bit");
}
test_size();
test_flags_widths();