Lines Matching refs:heap
45 check_heap(struct min_heap *heap) in check_heap() argument
48 for (i = 1; i < heap->n; ++i) { in check_heap()
50 tt_want(evutil_timercmp(&heap->p[i]->ev_timeout, in check_heap()
51 &heap->p[parent_idx]->ev_timeout, >=)); in check_heap()
58 struct min_heap heap; in test_heap_randomized() local
63 min_heap_ctor_(&heap); in test_heap_randomized()
68 min_heap_push_(&heap, inserted[i]); in test_heap_randomized()
70 check_heap(&heap); in test_heap_randomized()
72 tt_assert(min_heap_size_(&heap) == 1024); in test_heap_randomized()
75 min_heap_erase_(&heap, inserted[i]); in test_heap_randomized()
77 check_heap(&heap); in test_heap_randomized()
79 tt_assert(min_heap_size_(&heap) == 512); in test_heap_randomized()
81 last_e = min_heap_pop_(&heap); in test_heap_randomized()
83 e = min_heap_pop_(&heap); in test_heap_randomized()
89 tt_assert(min_heap_size_(&heap) == 0); in test_heap_randomized()
94 min_heap_dtor_(&heap); in test_heap_randomized()