Lines Matching refs:heap
44 check_heap(struct min_heap *heap) in check_heap() argument
47 for (i = 1; i < heap->n; ++i) { in check_heap()
49 tt_want(evutil_timercmp(&heap->p[i]->ev_timeout, in check_heap()
50 &heap->p[parent_idx]->ev_timeout, >=)); in check_heap()
57 struct min_heap heap; in test_heap_randomized() local
62 min_heap_ctor_(&heap); in test_heap_randomized()
67 min_heap_push_(&heap, inserted[i]); in test_heap_randomized()
69 check_heap(&heap); in test_heap_randomized()
71 tt_assert(min_heap_size_(&heap) == 1024); in test_heap_randomized()
74 min_heap_erase_(&heap, inserted[i]); in test_heap_randomized()
76 check_heap(&heap); in test_heap_randomized()
78 tt_assert(min_heap_size_(&heap) == 512); in test_heap_randomized()
80 last_e = min_heap_pop_(&heap); in test_heap_randomized()
82 e = min_heap_pop_(&heap); in test_heap_randomized()
88 tt_assert(min_heap_size_(&heap) == 0); in test_heap_randomized()
93 min_heap_dtor_(&heap); in test_heap_randomized()