tests/c_lib: Don't test undefined behavior of asctime and asctime_r

These functions requre non-null parameters; passing them NULL
values is undefined. Remove tests which are not valid.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2024-09-12 15:46:31 -07:00 committed by Carles Cufí
commit 6e1210a09e

View file

@ -1118,11 +1118,6 @@ ZTEST(libc_common, test_time_asctime)
zassert_equal(strncmp("Fri Jun 1 14:30:10 2024\n", asctime(&tp), sizeof(buf)), 0);
if (IS_ENABLED(CONFIG_COMMON_LIBC_ASCTIME_R)) {
zassert_is_null(asctime_r(NULL, buf));
zassert_is_null(asctime(NULL));
zassert_is_null(asctime_r(&tp, NULL));
tp.tm_wday = 8;
zassert_is_null(asctime_r(&tp, buf));
zassert_is_null(asctime(&tp));