Skip to content

Commit 6e1210a

Browse files
keith-packardcarlescufi
authored andcommitted
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 <[email protected]>
1 parent dc7c20a commit 6e1210a

File tree

1 file changed

+0
-5
lines changed
  • tests/lib/c_lib/common/src

1 file changed

+0
-5
lines changed

tests/lib/c_lib/common/src/main.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,11 +1118,6 @@ ZTEST(libc_common, test_time_asctime)
11181118
zassert_equal(strncmp("Fri Jun 1 14:30:10 2024\n", asctime(&tp), sizeof(buf)), 0);
11191119

11201120
if (IS_ENABLED(CONFIG_COMMON_LIBC_ASCTIME_R)) {
1121-
zassert_is_null(asctime_r(NULL, buf));
1122-
zassert_is_null(asctime(NULL));
1123-
1124-
zassert_is_null(asctime_r(&tp, NULL));
1125-
11261121
tp.tm_wday = 8;
11271122
zassert_is_null(asctime_r(&tp, buf));
11281123
zassert_is_null(asctime(&tp));

0 commit comments

Comments
 (0)