Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/lib/libc/tests/string/memset_test.c
39485 views
1
/*-
2
* SPDX-License-Identifier: BSD-2-Clause
3
*
4
* Copyright (c) 2024 Strahinja Stanisic <[email protected]>
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);
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
24
ATF_TP_ADD_TCS(tp)
25
{
26
ATF_TP_ADD_TC(tp, int_char_conv);
27
return (atf_no_error());
28
}
29
30
31