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

Function test_strlen

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

Source from the content-addressed store, hash-verified

6#include <tests/test.h>
7
8static void test_strlen(void **state)
9{
10 const char *str;
11
12 str = "coreboot";
13 assert_int_equal(__builtin_strlen(str), strlen(str));
14
15 str = "is\0very";
16 assert_int_equal(__builtin_strlen(str), strlen(str));
17
18 str = "nice\n";
19 assert_int_equal(__builtin_strlen(str), strlen(str));
20
21 assert_int_equal(0, strlen(""));
22}
23
24static void test_strnlen(void **state)
25{

Callers

nothing calls this directly

Calls 1

strlenFunction · 0.85

Tested by

no test coverage detected