5#include "testing/testing.h"
16#define STACK_CHUNK_SIZE 8
19#define BLI_stack_new(esize, descr) BLI_stack_new_ex(esize, descr, esize *STACK_CHUNK_SIZE)
56 for (
in = 0;
in < tot;
in++) {
60 for (
in = tot - 1;
in >= 0;
in--) {
76 char in[] =
"hello world!";
81 for (i = 0; i < tot; i++) {
82 *(
reinterpret_cast<int *
>(
in)) = i;
86 for (i = tot - 1; i >= 0; i--) {
88 *(
reinterpret_cast<int *
>(
in)) = i;
90 EXPECT_STREQ(
in,
out);
103 const short in[] = {1, 10, 100, 1000};
107 for (i = 0; i < tot; i++) {
124 const int tot_rerun = 4;
135 for (rerun = 0; rerun < tot_rerun; rerun++) {
136 for (
in = 0;
in < tot;
in++) {
144 for (
in = 0;
in < tot;
in++) {
148 for (
in = tot - 1;
in >= 0;
in--) {
165 const int sizes[] = {3, 11, 81, 400, 999, 12, 1, 9721, 7, 99, 5, 0};
177 for (s = sizes; *s; s++) {
178 for (i = *s; i != 0; i--) {
191 for (s = sizes; *s; s++) {
192 for (i = *s; i >= 0; i--) {
195 for (i = *s; i > 0; i--) {
208 EXPECT_EQ(memcmp(sizes, sizes_test,
sizeof(sizes) -
sizeof(
int)), 0);
216 EXPECT_EQ(memcmp(sizes, sizes_test,
sizeof(sizes) -
sizeof(
int)), 0);
#define EXPECT_FALSE(result)
#define EXPECT_GT(result, expect)
#define EXPECT_TRUE(result)
void BLI_stack_clear(BLI_Stack *stack) ATTR_NONNULL()
bool BLI_stack_is_empty(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_stack_free(BLI_Stack *stack) ATTR_NONNULL()
void BLI_stack_pop(BLI_Stack *stack, void *dst) ATTR_NONNULL()
void BLI_stack_discard(BLI_Stack *stack) ATTR_NONNULL()
size_t BLI_stack_count(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void * BLI_stack_peek(BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void BLI_stack_push(BLI_Stack *stack, const void *src) ATTR_NONNULL()
void BLI_stack_pop_n(BLI_Stack *stack, void *dst, unsigned int n) ATTR_NONNULL()
BLI_Stack * BLI_stack_new(size_t elem_size, const char *description) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()