3 #include "testing/testing.h"
62 stream <<
value.value;
101 TEST(cpp_type, DefaultConstruction)
121 TEST(cpp_type, DefaultConstructTrivial)
124 CPPType::get<int>().default_construct(&value);
128 TEST(cpp_type, ValueInitialize)
148 TEST(cpp_type, ValueInitializeTrivial)
151 CPPType::get<int>().value_initialize(&value);
175 TEST(cpp_type, CopyToUninitialized)
177 int buffer1[10] = {0};
178 int buffer2[10] = {0};
206 TEST(cpp_type, CopyToInitialized)
208 int buffer1[10] = {0};
209 int buffer2[10] = {0};
237 TEST(cpp_type, RelocateToUninitialized)
239 int buffer1[10] = {0};
240 int buffer2[10] = {0};
268 TEST(cpp_type, RelocateToInitialized)
270 int buffer1[10] = {0};
271 int buffer2[10] = {0};
299 TEST(cpp_type, FillInitialized)
302 int buffer2[10] = {0};
325 TEST(cpp_type, FillUninitialized)
328 int buffer2[10] = {0};
354 std::stringstream ss;
355 CPPType::get<int32_t>().print((
void *)&value, ss);
356 std::string text = ss.str();
363 bool found_unsupported_type =
false;
364 auto fn = [&](
auto type_tag) {
365 using T =
typename decltype(type_tag)::
type;
366 if constexpr (!std::is_same_v<T, void>) {
367 types.append(&CPPType::get<T>());
370 found_unsupported_type =
true;
373 CPPType::get<std::string>().to_static_type_tag<int,
float, std::string>(fn);
374 CPPType::get<float>().to_static_type_tag<int,
float, std::string>(fn);
375 EXPECT_FALSE(found_unsupported_type);
376 CPPType::get<int64_t>().to_static_type_tag<int,
float, std::string>(fn);
377 EXPECT_TRUE(found_unsupported_type);
384 TEST(cpp_type, CopyAssignCompressed)
386 std::array<std::string, 5>
array = {
"a",
"b",
"c",
"d",
"e"};
387 std::array<std::string, 3> array_compressed;
388 CPPType::get<std::string>().copy_assign_compressed(&
array, &array_compressed, {0, 2, 3});
typedef float(TangentPoint)[2]
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void destruct_indices(void *ptr, IndexMask mask) const
void relocate_construct_indices(void *src, void *dst, IndexMask mask) const
void copy_construct_n(const void *src, void *dst, int64_t n) const
void value_initialize_indices(void *ptr, IndexMask mask) const
void default_construct_n(void *ptr, int64_t n) const
void fill_assign_indices(const void *value, void *dst, IndexMask mask) const
void destruct_n(void *ptr, int64_t n) const
void default_construct_indices(void *ptr, IndexMask mask) const
void fill_assign_n(const void *value, void *dst, int64_t n) const
void copy_assign_indices(const void *src, void *dst, IndexMask mask) const
void relocate_assign_n(void *src, void *dst, int64_t n) const
void fill_construct_n(const void *value, void *dst, int64_t n) const
void relocate_construct(void *src, void *dst) const
void copy_assign_n(const void *src, void *dst, int64_t n) const
void value_initialize_n(void *ptr, int64_t n) const
void copy_construct(const void *src, void *dst) const
void destruct(void *ptr) const
void fill_construct_indices(const void *value, void *dst, IndexMask mask) const
int64_t alignment() const
void copy_assign(const void *src, void *dst) const
void relocate_assign_indices(void *src, void *dst, IndexMask mask) const
void relocate_construct_n(void *src, void *dst, int64_t n) const
void relocate_assign(void *src, void *dst) const
void default_construct(void *ptr) const
void value_initialize(void *ptr) const
void copy_construct_indices(const void *src, void *dst, IndexMask mask) const
BLI_CPP_TYPE_MAKE(GeometrySet, GeometrySet, CPPTypeFlags::Printable)
ccl_global float * buffer
static const CPPType & CPPType_TestType
static const int move_assigned_from_value
static const int move_constructed_from_value
static const int move_constructed_value
static const int copy_assigned_from_value
static const int copy_constructed_from_value
static const int move_assigned_value
TEST(any, DefaultConstructor)
static const int destructed_value
static const int default_constructed_value
static const int copy_assigned_value
static const int copy_constructed_value
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
unsigned __int64 uint64_t
friend std::ostream & operator<<(std::ostream &stream, const TestType &value)
TestType & operator=(TestType &&other) noexcept
friend bool operator==(const TestType &UNUSED(a), const TestType &UNUSED(b))
TestType & operator=(const TestType &other)
TestType(TestType &&other) noexcept
TestType(const TestType &other)