| 114 | } |
| 115 | |
| 116 | static 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 | |
| 139 | int main(void) |
| 140 | { |
nothing calls this directly
no test coverage detected