3 #include "testing/testing.h"
10 TEST(inplace_priority_queue, BuildSmall)
12 Array<int> values = {1, 5, 2, 8, 5, 6, 5, 4, 3, 6, 7, 3};
24 TEST(inplace_priority_queue, DecreasePriority)
36 TEST(inplace_priority_queue, IncreasePriority)
48 TEST(inplace_priority_queue, PopAll)
52 const int amount = 1000;
53 for (
int i = 0; i < amount; i++) {
59 int last_value = amount;
61 const int value = priority_queue.
pop();
62 EXPECT_LE(value, last_value);
67 TEST(inplace_priority_queue, ManyPriorityChanges)
71 const int amount = 1000;
72 for (
int i = 0; i < amount; i++) {
78 for (
int i = 0; i < amount; i++) {
79 const int index = rng.
get_int32() % amount;
80 const int new_priority = rng.
get_int32() % amount;
81 values[index] = new_priority;
85 int last_value = amount;
87 const int value = priority_queue.
pop();
88 EXPECT_LE(value, last_value);
93 TEST(inplace_priority_queue, IndicesAccess)
95 Array<int> values = {4, 6, 2, 4, 8, 1, 10, 2, 5};
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
Span< int64_t > active_indices() const
Span< int64_t > inactive_indices() const
Span< int64_t > all_indices() const
void priority_decreased(const int64_t index)
void priority_increased(const int64_t index)
void priority_changed(const int64_t index)
constexpr int64_t size() const
void append(const T &value)
TEST(any, DefaultConstructor)