summaryrefslogtreecommitdiff
path: root/testcases.c
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2014-10-29 22:20:04 -0500
committerBobby Bingham <koorogi@koorogi.info>2014-10-29 22:20:04 -0500
commit9499a9f80823bf936c6b525a3fe3ae8ee8c17e80 (patch)
treef89d8d82d3b250159a5ca66735411f51592448a5 /testcases.c
parent8a27889d505b07d91ecd03ad1cfeb818b9b440f7 (diff)
Add debugging assertion
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;
}
}