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:
parent
dc7c20adf9
commit
6e1210a09e
1 changed files with 0 additions and 5 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue