From d3c815bd0831f46c18bb4bddc9f290b5f47e2c45 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 4 Nov 2018 13:27:10 +0300 Subject: BLI_heap: add an API function to directly read the top node value. It is very commonly needed in loop conditions to check if the items in the heap are good enough to continue. --- tests/gtests/blenlib/BLI_heap_test.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/gtests') diff --git a/tests/gtests/blenlib/BLI_heap_test.cc b/tests/gtests/blenlib/BLI_heap_test.cc index 69566d8dca6..26f3aa19b9f 100644 --- a/tests/gtests/blenlib/BLI_heap_test.cc +++ b/tests/gtests/blenlib/BLI_heap_test.cc @@ -176,6 +176,7 @@ static void random_heap_reinsert_helper( for (int out_test = 0; out_test < items_total; out_test++) { HeapNode *node_top = BLI_heap_top(heap); float out = BLI_heap_node_value(node_top); + EXPECT_EQ(out, BLI_heap_top_value(heap)); EXPECT_EQ((float)out_test, out); BLI_heap_pop_min(heap); } -- cgit v1.2.3