blob: 01af91bb3d565913141a986f144c181274a7d738 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "array_size.h"
#include <library/cpp/testing/unittest/registar.h>
Y_UNIT_TEST_SUITE(ArraySizeTest) {
Y_UNIT_TEST(Test1) {
int x[100];
Y_UNUSED(x); /* Make MSVC happy. */
UNIT_ASSERT_VALUES_EQUAL(Y_ARRAY_SIZE(x), 100);
}
Y_UNIT_TEST(Test2) {
struct T {
};
T x[1];
Y_UNUSED(x); /* Make MSVC happy. */
UNIT_ASSERT_VALUES_EQUAL(Y_ARRAY_SIZE(x), 1);
}
}
|