Blender
V5.3
source
blender
blenlib
tests
BLI_utildefines_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 "
BLI_utildefines.hh
"
6
7
#include "testing/testing.h"
8
9
namespace
blender::tests
{
10
11
TEST
(BLI_utildefines,
ARRAY_SIZE
)
12
{
13
{
14
int
bounded_char[5];
15
static_assert
(
ARRAY_SIZE
(bounded_char) == 5);
16
}
17
18
{
19
int
*bounded_char[5];
20
static_assert
(
ARRAY_SIZE
(bounded_char) == 5);
21
}
22
}
23
24
TEST
(BLI_utildefines,
BOUNDED_ARRAY_TYPE_SIZE
)
25
{
26
{
27
int
bounded_char[5];
28
static_assert
(
BOUNDED_ARRAY_TYPE_SIZE<decltype(bounded_char)>
() == 5);
29
}
30
31
{
32
int
*bounded_char[5];
33
static_assert
(
BOUNDED_ARRAY_TYPE_SIZE<decltype(bounded_char)>
() == 5);
34
}
35
36
{
37
struct
MyType {
38
int
array
[12];
39
};
40
41
static_assert
(
BOUNDED_ARRAY_TYPE_SIZE<decltype(MyType::array)>
() == 12);
42
}
43
}
44
45
}
// namespace blender::tests
BLI_utildefines.hh
array
Definition
cycles/util/array.h:22
blender::tests
Definition
BLF_tests.cc:13
blender::tests::TEST
TEST(any_virtual, DefaultConstructor)
Definition
BLI_any_derived_test.cc:41
blender::BOUNDED_ARRAY_TYPE_SIZE
constexpr std::enable_if_t< blenlib_internal::IsBoundedArray< T >::value, size_t > BOUNDED_ARRAY_TYPE_SIZE() noexcept
Definition
BLI_utildefines.hh:626
blender::ARRAY_SIZE
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
Definition
BLI_utildefines.hh:608
Generated on
for Blender by
doxygen
1.18.0