6 #include "testing/testing.h"
16 TEST(linear_allocator, AllocationAlignment)
33 TEST(linear_allocator, PackedAllocation)
55 TEST(linear_allocator, CopyString)
69 TEST(linear_allocator, AllocateArray)
77 TEST(linear_allocator, Construct)
81 std::array<int, 5> values = {1, 2, 3, 4, 5};
88 TEST(linear_allocator, ConstructElementsAndPointerArray)
92 std::array<int, 7> values = {1, 2, 3, 4, 5, 6, 7};
105 TEST(linear_allocator, ConstructArrayCopy)
112 EXPECT_NE(span1.
data(), span2.
data());
119 TEST(linear_allocator, AllocateLarge)
122 void *buffer1 = allocator.
allocate(1024 * 1024, 8);
123 void *buffer2 = allocator.
allocate(1024 * 1024, 8);
124 EXPECT_NE(buffer1, buffer2);
127 TEST(linear_allocator, ManyAllocations)
131 for (
int i = 0; i < 1000; i++) {
135 EXPECT_NE(
buffer,
nullptr);
139 TEST(linear_allocator, ConstructArray)
147 for (std::string &
string : strings) {
148 string.~basic_string();
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
MINLINE int is_power_of_2_i(int n)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
#define POINTER_AS_UINT(i)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
MutableSpan< T > construct_array_copy(Span< T > src)
StringRefNull copy_string(StringRef str)
Span< T * > construct_elements_and_pointer_array(int64_t n, Args &&...args)
void provide_buffer(void *buffer, uint size)
MutableSpan< T > allocate_array(int64_t size)
destruct_ptr< T > construct(Args &&...args)
void * allocate(const int64_t size, const int64_t alignment)
MutableSpan< T > construct_array(int64_t size, Args &&...args)
constexpr int64_t size() const
constexpr T * data() const
constexpr int64_t size() const
constexpr const char * data() const
Span< T > as_span() const
ccl_global float * buffer
static bool is_aligned(void *ptr, uint alignment)
TEST(any, DefaultConstructor)
_W64 unsigned int uintptr_t