Blender V5.3
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
9namespace blender::tests {
10
11TEST(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
25{
26 {
27 int bounded_char[5];
29 }
30
31 {
32 int *bounded_char[5];
34 }
35
36 {
37 struct MyType {
38 int array[12];
39 };
40
42 }
43}
44
45} // namespace blender::tests
TEST(any_virtual, DefaultConstructor)
constexpr std::enable_if_t< blenlib_internal::IsBoundedArray< T >::value, size_t > BOUNDED_ARRAY_TYPE_SIZE() noexcept
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept