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

Function test_skip_atoi

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

Source from the content-addressed store, hash-verified

114}
115
116static void test_skip_atoi(void **state)
117{
118 int i;
119 char *ptr, *copy;
120 const struct str_with_u_val_t {
121 char *str;
122 uint32_t value;
123 uint32_t offset;
124 } str_with_u_val[] = {
125 {"42aa", 42, 2},
126 {"a", 0, 0},
127 {"0", 0, 1},
128 {"4a2", 4, 1},
129 };
130
131 for (i = 0; i < ARRAY_SIZE(str_with_u_val); i++) {
132 ptr = str_with_u_val[i].str;
133 copy = ptr;
134 assert_true(str_with_u_val[i].value == skip_atoi(&ptr));
135 assert_int_equal(str_with_u_val[i].offset, ptr - copy);
136 }
137}
138
139int main(void)
140{

Callers

nothing calls this directly

Calls 1

skip_atoiFunction · 0.85

Tested by

no test coverage detected