5#include "testing/testing.h"
20static void range_fl(
float *array_tar,
const int size)
22 float *array_pt = array_tar + (size - 1);
25 *(array_pt--) =
float(i);
42 const char *
in =
"test";
57 const int items_total =
SIZE;
59 for (
int in = 0;
in < items_total;
in++) {
62 for (
int out_test = 0; out_test < items_total; out_test++) {
69TEST(heap, SimpleRangeReverse)
71 const int items_total =
SIZE;
73 for (
int in = 0;
in < items_total;
in++) {
76 for (
int out_test = items_total - 1; out_test >= 0; out_test--) {
83TEST(heap, SimpleDuplicates)
85 const int items_total =
SIZE;
87 for (
int in = 0;
in < items_total;
in++) {
90 for (
int out_test = 0; out_test < items_total; out_test++) {
103 for (
int i = 0; i < items_total; i++) {
106 for (
int out_test = 0; out_test < items_total; out_test++) {
A min-heap / priority queue ADT.
Read Blender memory allocation and freeing.
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define EXPECT_FALSE(result)
#define EXPECT_TRUE(result)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
uint BLI_heapsimple_len(const HeapSimple *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_num, unsigned int seed)
void * BLI_heapsimple_pop_min(HeapSimple *heap) ATTR_NONNULL(1)
static void random_heapsimple_helper(const int items_total, const int random_seed)
void BLI_heapsimple_free(HeapSimple *heap, HeapSimpleFreeFP ptrfreefp) ATTR_NONNULL(1)
HeapSimple * BLI_heapsimple_new() ATTR_WARN_UNUSED_RESULT
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void BLI_heapsimple_insert(HeapSimple *heap, float value, void *ptr) ATTR_NONNULL(1)
static void range_fl(float *array_tar, const int size)
bool BLI_heapsimple_is_empty(const HeapSimple *heap) ATTR_NONNULL(1)