Update
This commit is contained in:
1 parent
179df4bda5
commit
1d15adcef8
2 files changed
+9
-2
No files matched your search
+2
-2
@@ -140,7 +140,7 @@
|
||||
static inline size_t \
|
||||
M_C(name, _i_rchild)(size_t i) \
|
||||
{ \
|
||||
assert(i <= ((-(size_t)1)-2)/2); \
|
||||
assert(i <= ((-(size_t)1)-2)/2); \
|
||||
return 2*i + 2; \
|
||||
} \
|
||||
\
|
||||
@@ -181,7 +181,7 @@
|
||||
static inline type * \
|
||||
M_C(name, _front)(prioqueue_t p) \
|
||||
{ \
|
||||
return M_C(name, _array_get)(p->array, 0); \
|
||||
return M_C(name, _array_get)(p->array, 0); \
|
||||
} \
|
||||
\
|
||||
static inline void \
|
||||
|
||||
@@ -32,6 +32,13 @@ static void test1(void)
|
||||
assert (x == 60);
|
||||
assert (int_pqueue_empty_p(p));
|
||||
assert (int_pqueue_size(p) == 0);
|
||||
int_pqueue_push(p, 10);
|
||||
int_pqueue_push(p, 30);
|
||||
int_pqueue_pop(&x, p);
|
||||
assert (x == 10);
|
||||
int_pqueue_push(p, 5);
|
||||
int_pqueue_pop(&x, p);
|
||||
assert (x == 5);
|
||||
|
||||
int_pqueue_clear(p);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user