libosmocore/tests/utils
Vadim Yanitskiy 653c31e875 tests/utils: do not test strbuf_example2() with buf=NULL
The following can be seen when building with CC=clang:

utils/utils_test.c:1239:2: runtime error: applying non-zero offset 99 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior utils/utils_test.c:1239:2 in
utils/utils_test.c:1241:3: runtime error: applying non-zero offset 99 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior utils/utils_test.c:1241:3 in
utils/utils_test.c:1242:2: runtime error: applying non-zero offset 99 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior utils/utils_test.c:1242:2 in
44. testsuite.at:274: 44. utils (testsuite.at:274): FAILED (testsuite.at:278)

This makes utils_test fail due to unexpected UBSan's output.

Even though passing NULL to the strbuf API is relatively safe, it makes
no sense and the API user should ensure that this never happens.  And
so we should not be testing this case.

Change-Id: Icd2323e93ec64afc1822d48e5e1d090083edf539
2024-01-03 09:54:46 +00:00
..
utils_test.c tests/utils: do not test strbuf_example2() with buf=NULL 2024-01-03 09:54:46 +00:00
utils_test.err utils_test: check stderr to catch sanitizer issues 2018-07-20 14:02:21 +00:00
utils_test.ok tests/utils: do not test strbuf_example2() with buf=NULL 2024-01-03 09:54:46 +00:00