Blender V5.3
BLI_array_utils_test.cc File Reference
#include "testing/testing.h"
#include "BLI_array_utils.hh"
#include "BLI_array_utils_c.hh"
#include "BLI_utildefines.hh"
#include "BLI_utildefines_stack.hh"
#include "BLI_vector_set.hh"
#include "BLI_virtual_array.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define STACK_PUSH_AND_CHECK_FORWARD(v, i)
#define STACK_PUSH_AND_CHECK_BACKWARD(v, i)
#define STACK_PUSH_AND_CHECK_BOTH(v, i)
#define BINARY_AND_TEST(data_cmp, data_a, data_b, data_combine, length)
#define BINARY_OR_TEST(data_cmp, data_a, data_b, data_combine, length)
#define DEDUPLICATE_ORDERED_TEST(data, data_cmp)

Functions

 blender::TEST (array_utils, ReverseStringEmpty)
 blender::TEST (array_utils, ReverseStringSingle)
 blender::TEST (array_utils, ReverseString4)
 blender::TEST (array_utils, ReverseInt4)
 blender::TEST (array_utils, FindIndexStringEmpty)
 blender::TEST (array_utils, FindIndexStringSingle)
 blender::TEST (array_utils, FindIndexStringSingleMissing)
 blender::TEST (array_utils, FindIndexString4)
 blender::TEST (array_utils, FindIndexInt4)
 blender::TEST (array_utils, FindIndexInt4_DupeEnd)
 blender::TEST (array_utils, FindIndexInt4_DupeMid)
 blender::TEST (array_utils, FindIndexPointer)
 blender::TEST (array_utils, BinaryAndInt4Zero)
 blender::TEST (array_utils, BinaryAndInt4Mix)
 blender::TEST (array_utils, BinaryOrInt4Alternate)
 blender::TEST (array_utils, BinaryOrInt4Mix)
 blender::TEST (array_utils, DeduplicateOrdered1)
 blender::TEST (array_utils, DeduplicateOrdered2)
 blender::TEST (array_utils, DeduplicateOrdered2Same)
 blender::TEST (array_utils, DeduplicateOrdered3Same)
 blender::TEST (array_utils, DeduplicateOrdered3)
static void blender::find_all_ranges_test (const Span< bool > data, const Span< IndexRange > data_cmp)
 blender::TEST (array_utils, FindAllRanges1)
 blender::TEST (array_utils, FindAllRanges2)
 blender::TEST (array_utils, FindAllRanges3)
 blender::TEST (array_utils, FindAllRanges4)
 blender::TEST (array_utils, FindAllRanges5)
static void blender::find_max_element_test (const VArray< int > &values, const std::optional< int64_t > expect_index)
 blender::TEST (array_utils, FindMaxElement1)
 blender::TEST (array_utils, FindMaxElement2)
 blender::TEST (array_utils, FindMaxElement3)
 blender::TEST (array_utils, FindMaxElement4)
static void blender::group_ids_to_indices_test (const Span< int > ids, const IndexMask &mask)
 blender::TEST (array_utils, GroupIdsToIndicesEmpty)
 blender::TEST (array_utils, GroupIdsToIndicesDense)
 blender::TEST (array_utils, GroupIdsToIndicesSparse)
 blender::TEST (array_utils, GroupIdsToIndicesMask)
 blender::TEST (array_utils, GroupIdsToIndicesLarge)

Macro Definition Documentation

◆ BINARY_AND_TEST

#define BINARY_AND_TEST ( data_cmp,
data_a,
data_b,
data_combine,
length )
Value:
{ \
BLI_array_binary_and(data_combine, data_a, data_b, length); \
EXPECT_EQ_ARRAY(data_cmp, data_combine, length); \
} \
((void)0)
float length(VecOp< float, D >) RET

Definition at line 153 of file BLI_array_utils_test.cc.

Referenced by blender::TEST(), and blender::TEST().

◆ BINARY_OR_TEST

#define BINARY_OR_TEST ( data_cmp,
data_a,
data_b,
data_combine,
length )
Value:
{ \
BLI_array_binary_or(data_combine, data_a, data_b, length); \
EXPECT_EQ_ARRAY(data_combine, data_cmp, length); \
} \
((void)0)

Definition at line 178 of file BLI_array_utils_test.cc.

Referenced by blender::TEST(), and blender::TEST().

◆ DEDUPLICATE_ORDERED_TEST

#define DEDUPLICATE_ORDERED_TEST ( data,
data_cmp )
Value:
{ \
const uint data_len_new = BLI_array_deduplicate_ordered(data, ARRAY_SIZE(data)); \
EXPECT_EQ(data_len_new, ARRAY_SIZE(data_cmp)); \
EXPECT_EQ_ARRAY(data, data_cmp, data_len_new); \
\
const uint data_len_test = BLI_array_deduplicate_ordered(data, data_len_new); \
EXPECT_EQ(data_len_test, ARRAY_SIZE(data_cmp)); \
EXPECT_EQ_ARRAY(data, data_cmp, data_len_new); \
} \
((void)0)
#define BLI_array_deduplicate_ordered(arr, arr_len)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept

Definition at line 201 of file BLI_array_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ STACK_PUSH_AND_CHECK_BACKWARD

#define STACK_PUSH_AND_CHECK_BACKWARD ( v,
i )
Value:
{ \
STACK_PUSH(data, v); \
EXPECT_EQ(BLI_array_rfindindex(data, STACK_SIZE(data), &(v)), i); \
} \
((void)0)
#define BLI_array_rfindindex(arr, arr_len, p)
#define STACK_SIZE(stack)

Referenced by blender::TEST().

◆ STACK_PUSH_AND_CHECK_BOTH

#define STACK_PUSH_AND_CHECK_BOTH ( v,
i )
Value:
{ \
STACK_PUSH(data, v); \
EXPECT_EQ(BLI_array_findindex(data, STACK_SIZE(data), &(v)), i); \
EXPECT_EQ(BLI_array_rfindindex(data, STACK_SIZE(data), &(v)), i); \
} \
((void)0)
#define BLI_array_findindex(arr, arr_len, p)

Referenced by blender::TEST().

◆ STACK_PUSH_AND_CHECK_FORWARD

#define STACK_PUSH_AND_CHECK_FORWARD ( v,
i )
Value:
{ \
STACK_PUSH(data, v); \
EXPECT_EQ(BLI_array_findindex(data, STACK_SIZE(data), &(v)), i); \
} \
((void)0)

Referenced by blender::TEST().