xref: /freebsd/lib/libc/tests/string/memset_test.c (revision f0d1236f0fc944165b657306a39d44fcc6aaa709)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2024 Strahinja Stanisic <strajabot@FreeBSD.org>
5  */
6 
7 #include <assert.h>
8 #include <string.h>
9 
10 #include <atf-c.h>
11 
12 ATF_TC_WITHOUT_HEAD(int_char_conv);
ATF_TC_BODY(int_char_conv,tc)13 ATF_TC_BODY(int_char_conv, tc)
14 {
15 	char b[64];
16 	int c = 0xDEADBEEF;
17 	memset(&b, c, 64);
18 	for(int i = 0; i < 64; i++) {
19 		assert(b[i] == (char)c);
20 	}
21 
22 }
23 
ATF_TP_ADD_TCS(tp)24 ATF_TP_ADD_TCS(tp)
25 {
26 	ATF_TP_ADD_TC(tp, int_char_conv);
27 	return (atf_no_error());
28 }
29 
30