6 #include "testing/testing.h"
10 TEST(span, FromSmallVector)
20 TEST(span, AddConstToPointer)
23 std::vector<int *> vec = {&
a};
31 int array[] = {3, 5, 8};
65 TEST(span, DropFrontLargeN)
90 TEST(span, TakeFrontLargeN)
187 TEST(span, FromInitializerList)
194 std::vector<int>
a = {1, 2, 3, 4};
205 std::array<int, 2>
a = {5, 6};
214 std::array<int, 5>
a = {4, 5, 6, 7, 8};
226 std::array<int, 5>
a = {0, 0, 0, 0, 0};
238 std::array<int, 10>
a;
246 std::array<int, 4>
a = {6, 7, 8, 9};
252 TEST(span, FirstLast_OneElement)
262 std::array<int, 3>
a = {5, 6, 7};
273 std::array<int, 3>
a = {5, 6, 7};
280 int *ptr_before =
reinterpret_cast<int *
>(
reinterpret_cast<uintptr_t>(
a.data()) - 1);
287 std::array<int, 5>
a = {4, 5, 4, 2, 5};
298 std::array<int *, 4>
a = {&value,
nullptr,
nullptr,
nullptr};
306 EXPECT_EQ(new_a_span[0], (
float *)&value);
311 std::array<uint32_t, 4>
a = {3, 4, 5, 6};
321 std::array<uint16_t, 4>
a = {4, 5, 6, 7};
341 std::array<int, 4> src = {5, 6, 7, 8};
342 std::array<int, 4> dst = {1, 2, 3, 4};
354 std::array<int, 4> src = {4, 5, 6, 7};
358 for (
auto it = span.
rbegin(); it != span.
rend(); ++it) {
362 EXPECT_EQ_ARRAY(reversed_vec.
data(),
Span({7, 6, 5, 4}).
data(), 4);
365 TEST(span, MutableReverseIterator)
367 std::array<int, 4> src = {4, 5, 6, 7};
371 for (
auto it = span.
rbegin(); it != span.
rend(); ++it) {
376 EXPECT_EQ_ARRAY(reversed_vec.
data(),
Span({7, 6, 5, 4}).
data(), 4);
377 EXPECT_EQ_ARRAY(src.data(),
Span({14, 15, 16, 17}).
data(), 4);
382 static constexpr std::array<int, 3> src = {3, 2, 1};
389 std::integral_constant<bool, span.first_index(1) == 2> ic;
395 TEST(span, ImplicitConversions)
409 std::array<int, 3>
a = {3, 4, 5};
410 std::array<int, 4> b = {3, 4, 5, 6};
414 EXPECT_TRUE(
Span(
a) ==
Span(b).take_front(3));
420 EXPECT_FALSE(
Span(
a) !=
Span(b).take_front(3));
#define BLI_STATIC_ASSERT(a, msg)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute Attribute Fill
constexpr int64_t size() const
constexpr void fill(const T &value)
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr bool is_empty() const
constexpr MutableSpan take_back(const int64_t n) const
constexpr MutableSpan drop_front(const int64_t n) const
constexpr void fill_indices(Span< int64_t > indices, const T &value)
constexpr void copy_from(Span< T > values)
constexpr std::reverse_iterator< T * > rend() const
constexpr std::reverse_iterator< T * > rbegin() const
constexpr MutableSpan take_front(const int64_t n) const
constexpr std::reverse_iterator< const T * > rend() const
constexpr Span drop_front(int64_t n) const
constexpr std::reverse_iterator< const T * > rbegin() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr int64_t size_in_bytes() const
constexpr Span take_back(int64_t n) const
constexpr const T & last() const
constexpr Span drop_back(int64_t n) const
constexpr T get(int64_t index, const T &fallback) const
constexpr int64_t count(const T &value) const
constexpr const T & first() const
constexpr int64_t first_index(const T &search_value) const
constexpr int64_t size() const
constexpr Span< NewT > cast() const
constexpr Span take_front(int64_t n) const
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
constexpr bool contains_ptr(const T *ptr) const
void append(const T &value)
static void test_ref_from_initializer_list(Span< int > span)
TEST(array, DefaultConstructor)
_W64 unsigned int uintptr_t