9 #include <boost/test/unit_test.hpp>
16 #include <unordered_set>
18 #include <boost/mpl/list.hpp>
24 using Indices = boost::mpl::list<Index32, Index64>;
29 BOOST_CHECK(std::is_standard_layout_v<T>);
30 BOOST_CHECK(std::is_trivially_default_constructible_v<T>);
31 BOOST_CHECK(std::is_trivially_copy_constructible_v<T>);
32 BOOST_CHECK(std::is_trivially_move_constructible_v<T>);
33 BOOST_CHECK((std::is_trivially_assignable_v<T, T>));
34 BOOST_CHECK((std::is_trivially_copy_assignable_v<T>));
35 BOOST_CHECK((std::is_trivially_move_assignable_v<T>));
42 BOOST_CHECK_EQUAL(idx.
value(), 0xabcd2400
u);
43 BOOST_CHECK_EQUAL(idx.
level(0), 0xabcd
u);
44 BOOST_CHECK_EQUAL(idx.
level(1), 0x24
u);
45 BOOST_CHECK_EQUAL(idx.
level(2), 0x00
u);
50 BOOST_CHECK_EQUAL(idx.
value(), 0xabcd2400
u);
51 BOOST_CHECK_EQUAL(idx.
level(0), 0xabcd
u);
52 BOOST_CHECK_EQUAL(idx.
level(1), 0x24
u);
53 BOOST_CHECK_EQUAL(idx.
level(2), 0x00
u);
61 BOOST_CHECK_EQUAL(idx.
value(), 0x00180000
u);
62 BOOST_CHECK_EQUAL(idx.
level(0), 24
u);
63 BOOST_CHECK_EQUAL(idx.
level(1), 0
u);
64 BOOST_CHECK_EQUAL(idx.
level(2), 0
u);
67 BOOST_CHECK_EQUAL(idx.
value(), 0x001800ff
u);
68 BOOST_CHECK_EQUAL(idx.
level(0), 24
u);
69 BOOST_CHECK_EQUAL(idx.
level(1), 0
u);
70 BOOST_CHECK_EQUAL(idx.
level(2), 255
u);
82 for (
auto maxValue : maxValues) {
99 for (
auto maxValue : maxValues) {
109 BOOST_CHECK_EQUAL(idx3.level(0), 13
u);
110 BOOST_CHECK_EQUAL(idx3.level(1), 14
u);
111 BOOST_CHECK_EQUAL(idx3.level(2), 15
u);
114 BOOST_CHECK_EQUAL(idx2.level(0), 13
u);
115 BOOST_CHECK_EQUAL(idx2.level(1), 14
u);
116 BOOST_CHECK_EQUAL(idx2.level(2), 0
u);
119 BOOST_CHECK_EQUAL(idx1.level(0), 13
u);
120 BOOST_CHECK_EQUAL(idx1.level(1), 0
u);
121 BOOST_CHECK_EQUAL(idx1.level(2), 0
u);
125 BOOST_CHECK_EQUAL(idx0.value(), 0
u);
126 BOOST_CHECK_EQUAL(idx0.level(0), 0
u);
127 BOOST_CHECK_EQUAL(idx0.level(1), 0
u);
128 BOOST_CHECK_EQUAL(idx0.level(2), 0
u);
134 BOOST_CHECK_EQUAL(idx4.level(0), 23
u);
135 BOOST_CHECK_EQUAL(idx4.level(1), 14
u);
136 BOOST_CHECK_EQUAL(idx4.level(2), 15
u);
137 BOOST_CHECK_EQUAL(idx4.level(3), 17
u);
140 BOOST_CHECK_EQUAL(idx3.level(0), 23
u);
141 BOOST_CHECK_EQUAL(idx3.level(1), 14
u);
142 BOOST_CHECK_EQUAL(idx3.level(2), 15
u);
143 BOOST_CHECK_EQUAL(idx3.level(3), 0
u);
146 BOOST_CHECK_EQUAL(idx2.level(0), 23
u);
147 BOOST_CHECK_EQUAL(idx2.level(1), 14
u);
148 BOOST_CHECK_EQUAL(idx2.level(2), 0
u);
149 BOOST_CHECK_EQUAL(idx2.level(3), 0
u);
152 BOOST_CHECK_EQUAL(idx1.level(0), 23
u);
153 BOOST_CHECK_EQUAL(idx1.level(1), 0
u);
154 BOOST_CHECK_EQUAL(idx1.level(2), 0
u);
155 BOOST_CHECK_EQUAL(idx1.level(3), 0
u);
159 BOOST_CHECK_EQUAL(idx0.value(), 0
u);
160 BOOST_CHECK_EQUAL(idx0.level(0), 0
u);
161 BOOST_CHECK_EQUAL(idx0.level(1), 0
u);
162 BOOST_CHECK_EQUAL(idx0.level(2), 0
u);
163 BOOST_CHECK_EQUAL(idx0.level(3), 0
u);
178 BOOST_CHECK_EQUAL(
idx.makeNextSibling(3),
193 auto max1 = (1
u << 17) - 1
u;
194 auto max2 = (1
u << 21) - 1
u;
195 auto max3 = (1
u << 13) - 1
u;
196 BOOST_CHECK_EQUAL(
idx.makeLastDescendant(0),
198 BOOST_CHECK_EQUAL(
idx.makeLastDescendant(1),
200 BOOST_CHECK_EQUAL(
idx.makeLastDescendant(2),
203 BOOST_CHECK_EQUAL(
idx.makeLastDescendant(3),
208 std::unordered_set<Index32>
set;
216 BOOST_CHECK_EQUAL(
set.
size(), 3);
218 BOOST_CHECK(
set.
count(0x00010204u));
219 BOOST_CHECK(
set.
count(0x00010304u));
224 std::unordered_set<Index64>
set;
234 BOOST_CHECK_EQUAL(
set.
size(), 3);