diff options
Diffstat (limited to 'source/tests/array_ref.test.c')
-rw-r--r-- | source/tests/array_ref.test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/tests/array_ref.test.c b/source/tests/array_ref.test.c index 921e9fd..036e802 100644 --- a/source/tests/array_ref.test.c +++ b/source/tests/array_ref.test.c @@ -26,8 +26,14 @@ TEST("array ref equal") { REQUIRE(AR_EQUAL(foo_ref, bar_ref)); } -static int compare(int *left, int *right) { - return *left - *right; +static i8 compare(void *left_, void *right_) { + int *left = (int *) left_; + int *right = (int *) right_; + if (*left < *right) + return -1; + if (*left > *right) + return 1; + return 0; } TEST("array ref compare") { |