| 20 | }; |
| 21 | |
| 22 | static void test_hexstrtobin(void **state) |
| 23 | { |
| 24 | uint8_t *buf; |
| 25 | size_t res, len; |
| 26 | |
| 27 | for (int i = 0; i < ARRAY_SIZE(hexstr); i++) { |
| 28 | len = strlen(hexstr[i].str) / 2 + 1; |
| 29 | buf = malloc(len); |
| 30 | res = hexstrtobin(hexstr[i].str, buf, len); |
| 31 | |
| 32 | assert_int_equal(hexstr[i].res, res); |
| 33 | |
| 34 | for (int j = 0; j < res; j++) |
| 35 | assert_int_equal(hexstr[i].val[j], buf[j]); |
| 36 | |
| 37 | free(buf); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | int main(void) |
| 42 | { |
nothing calls this directly
no test coverage detected