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

Function test_strnlen

tests/commonlib/bsd/string-test.c:24–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24static void test_strnlen(void **state)
25{
26 /* maxlen is SIZE_MAX */
27 assert_int_equal(8, strnlen("coreboot", SIZE_MAX));
28
29 /* maxlen larger than string len */
30 assert_int_equal(8, strnlen("coreboot", 100));
31
32 /* maxlen equal to string len */
33 assert_int_equal(8, strnlen("coreboot", 8));
34
35 /* maxlen smaller than string len */
36 assert_int_equal(5, strnlen("coreboot", 5));
37
38 /* maxlen is 0 */
39 assert_int_equal(0, strnlen("coreboot", 0));
40
41 /* Empty string */
42 assert_int_equal(0, strnlen("", 3));
43}
44
45static void test_strcat(void **state)
46{

Callers

nothing calls this directly

Calls 1

strnlenFunction · 0.85

Tested by

no test coverage detected