MCPcopy Create free account
hub / github.com/coreboot/coreboot / test_strcpy

Function test_strcpy

tests/lib/string-test.c:133–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133static void test_strcpy(void **state)
134{
135 char src[] = "Hello coreboot\n";
136 char dst[sizeof(src)];
137
138 /* Make sure that strcpy() sets '\0' by initializing a whole
139 dst array to fixed, non-'\0' value */
140 memset(dst, 'x', sizeof(dst));
141
142 strcpy(dst, src);
143
144 assert_int_equal(0, memcmp(dst, src, __builtin_strlen(src) + 1));
145}
146
147static void test_strcmp(void **state)
148{

Callers

nothing calls this directly

Calls 3

memsetFunction · 0.50
strcpyFunction · 0.50
memcmpFunction · 0.50

Tested by

no test coverage detected