zephyr/tests/unit
Nicolas Pitre 5a384b9ea8 lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats
There might be a sign extension when a long is promoted to
int_value_type and the former type is smaller than the later.
This produces the wrong output if the specified format is unsigned.

Let's avoid this problem by handling signed and unsigned cases
explicitly. When the type already matches int_value_type then the
compiler is smart enough to recognize the redundancy and removes
unneeded duplications automatically, meaning that the code will stay
small when code size matters.

A similar issue also existed in the restricted %llu case.
The fix is the same as above.

Those fixes exposed wrong results in the printk.c test with %llx
so fix that as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-02 19:37:06 -04:00
..
base64 cmake: make find_package(ZephyrUnittest...) REQUIRED 2020-06-12 11:10:23 +02:00
cbprintf lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats 2021-09-02 19:37:06 -04:00
crc crc: Add Test for crc32c implementation 2021-03-02 14:08:30 +01:00
intmath cmake: make find_package(ZephyrUnittest...) REQUIRED 2020-06-12 11:10:23 +02:00
list kernel: dlist: add test cases to cover APIs 2021-01-15 11:42:48 -05:00
math_extras cmake: make find_package(ZephyrUnittest...) REQUIRED 2020-06-12 11:10:23 +02:00
net_timeout net: timeout: refactor to fix multiple problems 2021-01-07 11:14:38 +02:00
rbtree kernel: rbtree: test rbtree minmax api 2021-03-18 11:53:44 -04:00
timeutil tests: timeutil: test large linearity 2021-08-08 08:18:23 -04:00
util Revert "tests: unit: util: Add test for REVERSE_ARGS" 2021-02-25 10:01:31 -05:00