aboutsummaryrefslogtreecommitdiff
path: root/tests/test_pqueue.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-06-09 01:42:18 +0800
committerMistivia <i@mistivia.com>2025-06-09 01:42:52 +0800
commit12eeb35015aba138a4e543c28c2ecee58d532440 (patch)
tree11a7776977c661f5f5a7c013bed290ba96fa2c23 /tests/test_pqueue.c
parent55f3a89f40a676fca7fb820037457c74cbdebb92 (diff)
pass by value in basic traits
Diffstat (limited to 'tests/test_pqueue.c')
-rw-r--r--tests/test_pqueue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_pqueue.c b/tests/test_pqueue.c
index 6503174..436a583 100644
--- a/tests/test_pqueue.c
+++ b/tests/test_pqueue.c
@@ -8,7 +8,7 @@
typedef Int MinInt;
-int MinInt_cmp(Int *lhs, Int *rhs) {
+int MinInt_cmp(Int lhs, Int rhs) {
return -Int_cmp(lhs, rhs);
}
@@ -26,7 +26,7 @@ int main() {
int elems[10] = {1, 3, 2, 4, 6, 5, 9, 7, 8, 10};
for (int i = 0; i < 10; i++) {
int e = elems[i];
- IntPQueue_push(&pq, &e);
+ IntPQueue_push(&pq, e);
}
for (int i = 10; i >= 1; i--) {
int *top = IntPQueue_top(&pq);
@@ -40,7 +40,7 @@ int main() {
MinIntPQueue_init(&minpq);
for (int i = 0; i < 10; i++) {
int e = elems[i];
- MinIntPQueue_push(&minpq, &e);
+ MinIntPQueue_push(&minpq, e);
}
for (int i = 1; i <= 10; i++) {
int *top = MinIntPQueue_top(&minpq);
@@ -54,7 +54,7 @@ int main() {
int expected[10] = {-10, -8, -7, -7, -5, -5, -4, -2, -2, -1};
for (int i = 0; i < 10; i++) {
int e = elems2[i];
- IntPQueue_push(&pq, &e);
+ IntPQueue_push(&pq, e);
int *top = IntPQueue_top(&pq);
assert(*top == expected[i]);
}