Blender
V4.3
source
blender
blenlib
tests
BLI_bit_group_vector_test.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#include "testing/testing.h"
6
7
#include "
BLI_bit_group_vector.hh
"
8
9
#include "
BLI_strict_flags.h
"
/* Keep last. */
10
11
namespace
blender::bits::tests
{
12
13
TEST
(bit_group_vector, DefaultConstruct)
14
{
15
BitGroupVector<>
groups;
16
EXPECT_EQ
(groups.size(), 0);
17
}
18
19
TEST
(bit_group_vector, Construct)
20
{
21
BitGroupVector<>
groups(12, 5);
22
23
EXPECT_EQ
(groups.size(), 12);
24
EXPECT_EQ
(groups[0].
size
(), 5);
25
EXPECT_EQ
(groups[4].
size
(), 5);
26
}
27
28
TEST
(bit_group_vector, CopyConstruct)
29
{
30
BitGroupVector<>
groups(12, 5);
31
for
(
const
int64_t
i : groups.index_range()) {
32
MutableBoundedBitSpan
span = groups[i];
33
for
(
const
int64_t
j : span.
index_range
()) {
34
span[j].set(j % 2 == 0);
35
}
36
}
37
38
BitGroupVector<>
copy
(groups);
39
40
EXPECT_EQ
(groups.size(),
copy
.size());
41
EXPECT_EQ
(groups.group_size(),
copy
.group_size());
42
for
(
const
int64_t
i : groups.index_range()) {
43
BoundedBitSpan
span = groups[i];
44
BoundedBitSpan
copy_span =
copy
[i];
45
for
(
const
int64_t
j : span.
index_range
()) {
46
EXPECT_EQ
(span[j].test(), copy_span[j].test());
47
}
48
}
49
}
50
51
}
// namespace blender::bits::tests
BLI_bit_group_vector.hh
EXPECT_EQ
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
BLI_strict_flags.h
size
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition
btDbvt.cpp:52
blender::bits::BitGroupVector
Definition
BLI_bit_group_vector.hh:19
blender::bits::BitSpan::index_range
IndexRange index_range() const
Definition
BLI_bit_span.hh:97
blender::bits::BoundedBitSpan
Definition
BLI_bit_span.hh:176
blender::bits::MutableBitSpan::index_range
IndexRange index_range() const
Definition
BLI_bit_span.hh:239
blender::bits::MutableBoundedBitSpan
Definition
BLI_bit_span.hh:321
blender::bits::tests
Definition
BLI_bit_group_vector_test.cc:11
blender::bits::tests::TEST
TEST(bit_group_vector, DefaultConstruct)
Definition
BLI_bit_group_vector_test.cc:13
copy
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
Definition
node_texture_output.cc:130
int64_t
__int64 int64_t
Definition
stdint.h:89
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0