summaryrefslogtreecommitdiff
path: root/testcases.c
diff options
context:
space:
mode:
Diffstat (limited to 'testcases.c')
-rw-r--r--testcases.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/testcases.c b/testcases.c
index a41cd89..6526d1e 100644
--- a/testcases.c
+++ b/testcases.c
@@ -8,10 +8,11 @@
int buffer[MAX_SIZE];
-void assert_sorted(size_t size, cmpfun cmp)
+void assert_sorted(char *base, size_t nmel, size_t width, cmpfun cmp)
{
- for (size_t i = 1; i < size; i++) {
- if (cmp(buffer + i-1, buffer + i) > 0) abort();
+ for (size_t i = 1; i < nmel; i++) {
+ if (cmp(base, base+width) > 0) abort();
+ base += width;
}
}