Commit 6e1210a0 authored by Keith Packard's avatar Keith Packard Committed by Carles Cufi
Browse files

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: default avatarKeith Packard <keithp@keithp.com>
parent dc7c20ad
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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));