| 2 | #include "read-cache-ll.h" |
| 3 | |
| 4 | static void check_strcmp_offset(const char *string1, const char *string2, |
| 5 | int expect_result, uintmax_t expect_offset) |
| 6 | { |
| 7 | size_t offset; |
| 8 | int result = strcmp_offset(string1, string2, &offset); |
| 9 | |
| 10 | /* |
| 11 | * Because different CRTs behave differently, only rely on signs of the |
| 12 | * result values. |
| 13 | */ |
| 14 | result = (result < 0 ? -1 : |
| 15 | result > 0 ? 1 : |
| 16 | 0); |
| 17 | |
| 18 | cl_assert_equal_i(result, expect_result); |
| 19 | cl_assert_equal_i((uintmax_t)offset, expect_offset); |
| 20 | } |
| 21 | |
| 22 | void test_strcmp_offset__empty(void) |
| 23 | { |