5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_TESTING_DEQUE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_TESTING_DEQUE_HPP_
8#include <gtest/gtest.h>
18#include "arene/base/stdlib_choice/addressof.hpp"
19#include "arene/base/stdlib_choice/conditional.hpp"
20#include "arene/base/stdlib_choice/cstddef.hpp"
21#include "arene/base/stdlib_choice/declval.hpp"
22#include "arene/base/stdlib_choice/forward.hpp"
23#include "arene/base/stdlib_choice/ignore.hpp"
24#include "arene/base/stdlib_choice/initializer_list.hpp"
25#include "arene/base/stdlib_choice/integer_sequence.hpp"
26#include "arene/base/stdlib_choice/is_assignable.hpp"
27#include "arene/base/stdlib_choice/is_constructible.hpp"
28#include "arene/base/stdlib_choice/is_copy_assignable.hpp"
29#include "arene/base/stdlib_choice/is_copy_constructible.hpp"
30#include "arene/base/stdlib_choice/is_default_constructible.hpp"
31#include "arene/base/stdlib_choice/is_move_assignable.hpp"
32#include "arene/base/stdlib_choice/is_move_constructible.hpp"
33#include "arene/base/stdlib_choice/is_trivially_copyable.hpp"
34#include "arene/base/stdlib_choice/iterator_tags.hpp"
35#include "arene/base/stdlib_choice/move.hpp"
36#include "arene/base/stdlib_choice/numeric_limits.hpp"
43#include "testlibs/utilities/iterator_types.hpp"
50ARENE_IGNORE_ALL(
"-Wfloat-equal",
"These tests don't perform arithmetic, so equality is OK even for floating point");
72template <
typename T,
typename ElementType,
typename = constra
ints<>>
75template <
typename T,
typename ElementType>
87template <
typename Deque>
89 using T =
typename Deque::value_type;
97 "Constexpr-compatible types must have constexpr specializations of test_value_array or test_value"
106 return ::arene::base::testing::test_value<T>(idx);
111 static constexpr auto construct() noexcept(noexcept(Deque())) -> Deque {
return Deque(); }
120 return ::arene::base::testing::test_deque<Deque>(begin, end);
147 for (
std::size_t i{}; i < Deque::capacity / 2U; ++i) {
159 return ::arene::base::testing::test_initializer_list<T, Indices...>();
165 template <std::
size_t Size>
179template <
typename Deque>
186template <
typename TypeParam>
195 TypeParam
const deque;
196 EXPECT_EQ(deque.size(), 0);
198 auto maybe_deque = TypeParam::try_construct();
199 ASSERT_TRUE(maybe_deque.has_value());
200 EXPECT_EQ(maybe_deque->size(), 0);
218 deque.push_front(TestFixture::test_value(0));
219 EXPECT_EQ(deque.size(), 1);
226 deque.push_back(TestFixture::test_value(0));
227 EXPECT_EQ(deque.size(), 1);
233 auto& front_ref = deque.emplace_front(TestFixture::test_value(0));
240 auto& back_ref = deque.emplace_back(TestFixture::test_value(0));
248 deque.push_front(TestFixture::test_value(0));
249 ASSERT_EQ(deque.size(), 1);
250 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
251 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
254 EXPECT_EQ(
as_const.front(), TestFixture::test_value(0));
255 EXPECT_EQ(
as_const.back(), TestFixture::test_value(0));
262 deque.push_back(TestFixture::test_value(0));
263 ASSERT_EQ(deque.size(), 1);
264 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
265 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
268 EXPECT_EQ(
as_const.back(), TestFixture::test_value(0));
269 EXPECT_EQ(
as_const.front(), TestFixture::test_value(0));
276 for (
typename TypeParam::size_type i = 0; i < TypeParam::capacity(); i++) {
277 deque.push_front(TestFixture::test_value(i));
279 EXPECT_EQ(deque.size(), TypeParam::capacity());
286 for (
typename TypeParam::size_type i = 0; i < TypeParam::capacity(); i++) {
287 deque.push_back(TestFixture::test_value(i));
289 EXPECT_EQ(deque.size(), TypeParam::capacity());
296 for (
typename TypeParam::size_type i = 0; i < TypeParam::capacity(); i++) {
297 deque.push_front(TestFixture::test_value(i));
300 ASSERT_DEATH(deque.push_front(TestFixture::test_value(TypeParam::capacity())),
"Precondition violation");
306 using deque_impl = arene::base::inline_deque_detail::inline_deque_impl<
307 typename TypeParam::value_type,
308 TypeParam::capacity(),
309 TypeParam::wrapping_allowed
313 for (
typename TypeParam::size_type i = 0; i < TypeParam::capacity(); i++) {
314 deque.push_front(TestFixture::test_value(i));
317 if (deque.wrapping_allowed()) {
318 EXPECT_EQ(deque.front(), TestFixture::test_value(TypeParam::capacity() - 1U));
319 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
320 deque.push_front(TestFixture::test_value(TypeParam::capacity()));
321 EXPECT_EQ(deque.front(), TestFixture::test_value(TypeParam::capacity()));
322 EXPECT_EQ(deque.back(), TestFixture::test_value(1));
324 ASSERT_DEATH(deque.push_front(TestFixture::test_value(TypeParam::capacity())),
"Precondition violation");
332 for (
typename TypeParam::size_type i = 0; i < TypeParam::capacity(); i++) {
333 deque.push_back(TestFixture::test_value(i));
336 if (deque.wrapping_allowed()) {
337 EXPECT_EQ(deque.back(), TestFixture::test_value(TypeParam::capacity() - 1U));
338 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
339 deque.push_back(TestFixture::test_value(TypeParam::capacity()));
340 EXPECT_EQ(deque.back(), TestFixture::test_value(TypeParam::capacity()));
341 EXPECT_EQ(deque.front(), TestFixture::test_value(1));
343 ASSERT_DEATH(deque.push_back(TestFixture::test_value(TypeParam::capacity())),
"Precondition violation");
349 using value_type =
typename TypeParam::value_type;
351 auto inserter = [](
auto& deque,
352 auto&& value)
noexcept(
noexcept(deque.insert(deque.begin(),
std::forward<
decltype(value)>(value)))
353 ) ->
decltype(deque.insert(deque.begin(),
std::forward<
decltype(value)>(value))) {
return {}; };
357 constexpr bool move_insert_ok = shift_ok;
362 constexpr bool shift_noexcept =
364 constexpr bool copy_insert_noexcept =
366 constexpr bool move_insert_noexcept = move_insert_ok && shift_noexcept;
385 using index_type =
typename TypeParam::iterator::difference_type;
387 TypeParam deque = TestFixture::half_test_deque();
388 for (
typename TypeParam::size_type i = 0U; i < TypeParam::capacity() / 2U; ++i) {
390 auto const pos =
next(deque.cbegin(),
static_cast<index_type
>(2U * i));
392 typename TypeParam::value_type
const new_value = TestFixture::test_value((TypeParam::capacity() / 2U) + i);
393 auto new_iter = deque.insert(pos, new_value);
396 EXPECT_EQ(
distance(deque.begin(), new_iter),
static_cast<index_type
>(2U * i));
399 for (
typename TypeParam::size_type i = 0U; i < TypeParam::capacity() / 2U; ++i) {
400 EXPECT_EQ(deque[
static_cast<index_type
>(2U * i)], TestFixture::test_value(TypeParam::capacity() / 2U + i));
401 EXPECT_EQ(deque[
static_cast<index_type
>((2U * i) + 1U)], TestFixture::test_value(i));
412 using index_type =
typename TypeParam::iterator::difference_type;
414 TypeParam deque = TestFixture::half_test_deque();
415 for (
typename TypeParam::size_type i = 0U; i < TypeParam::capacity() / 2U; ++i) {
417 auto const pos =
next(deque.cbegin(),
static_cast<index_type
>(2U * i));
419 deque.insert(pos, TestFixture::test_value((TypeParam::capacity() / 2U) + i));
422 for (
typename TypeParam::size_type i = 0U; i < TypeParam::capacity() / 2U; ++i) {
423 EXPECT_EQ(deque[
static_cast<index_type
>(2U * i)], TestFixture::test_value(TypeParam::capacity() / 2U + i));
424 EXPECT_EQ(deque[
static_cast<index_type
>((2U * i) + 1U)], TestFixture::test_value(i));
435 typename TypeParam::value_type
const value = TestFixture::test_value(TypeParam::capacity() / 2U);
437 TypeParam deque = TestFixture::half_test_deque();
438 typename TypeParam::size_type expected_size = deque.size();
440 if (deque.size() == deque.capacity()) {
445 deque.insert(deque.cend(), value);
446 EXPECT_EQ(deque.size(), expected_size);
447 EXPECT_EQ(deque.back(), value);
457 typename TypeParam::value_type
const value = TestFixture::test_value(TypeParam::capacity() / 2U);
458 typename TypeParam::value_type value_again = TestFixture::test_value(TypeParam::capacity() / 2U);
460 TypeParam deque = TestFixture::half_test_deque();
461 typename TypeParam::size_type expected_size = deque.size();
463 if (deque.size() == deque.capacity()) {
468 deque.insert(deque.cend(),
std::move(value_again));
469 EXPECT_EQ(deque.size(), expected_size);
470 EXPECT_EQ(deque.back(), value);
476 NonWrappingInsertOneWhenFull,
480 TypeParam deque = TestFixture::full_test_deque();
482 auto pos =
next(deque.begin());
483 for (
typename TypeParam::size_type i{0U}; i <= deque.capacity(); ++i) {
484 ASSERT_DEATH(deque.insert(pos, TestFixture::test_value(TypeParam::capacity() + i)),
"Precondition violation");
495 for (
std::size_t i = 0; i < 2 * TypeParam::capacity(); i++) {
496 deque.push_front(TestFixture::test_value(i));
497 EXPECT_EQ(deque.back(), TestFixture::test_value(i));
508 for (
std::size_t i = 0; i < 2 * TypeParam::capacity(); i++) {
509 deque.push_back(TestFixture::test_value(i));
510 EXPECT_EQ(deque.front(), TestFixture::test_value(i));
521 BasicFunctionFromFront,
526 deque.push_front(TestFixture::test_value(0));
527 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
529 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
531 deque.push_front(TestFixture::test_value(1));
532 EXPECT_EQ(deque.size(), 2);
534 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
536 EXPECT_EQ(deque.back(), TestFixture::test_value(1));
537 EXPECT_EQ(deque.size(), 1);
547 deque.push_back(TestFixture::test_value(0));
548 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
550 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
552 deque.push_back(TestFixture::test_value(1));
553 EXPECT_EQ(deque.size(), 2);
555 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
557 EXPECT_EQ(deque.front(), TestFixture::test_value(1));
558 EXPECT_EQ(deque.size(), 1);
565 CanObserveAndModifyFromFront,
569 deque.push_front(TestFixture::test_value(0));
570 deque.push_front(TestFixture::test_value(1));
571 EXPECT_EQ(deque.back(), TestFixture::test_value(0));
572 deque.back() = TestFixture::test_value(2);
573 EXPECT_EQ(deque.back(), TestFixture::test_value(2));
574 EXPECT_EQ(deque.size(), 2);
576 EXPECT_EQ(deque.back(), TestFixture::test_value(1));
583 deque.push_back(TestFixture::test_value(0));
584 deque.push_back(TestFixture::test_value(1));
585 EXPECT_EQ(deque.front(), TestFixture::test_value(0));
586 deque.front() = TestFixture::test_value(2);
587 EXPECT_EQ(deque.front(), TestFixture::test_value(2));
588 EXPECT_EQ(deque.size(), 2);
590 EXPECT_EQ(deque.front(), TestFixture::test_value(1));
596 PushFrontCopiesLvalues,
599 auto deque = TestFixture::construct();
600 auto const value = TestFixture::test_value(0);
601 deque.push_front(value);
602 EXPECT_EQ(deque.front(), value);
608 auto deque = TestFixture::construct();
609 auto const value = TestFixture::test_value(0);
610 deque.push_back(value);
611 EXPECT_EQ(deque.back(), value);
618 ASSERT_DEATH(deque.back(),
"Precondition violation");
624 TypeParam
const deque;
625 ASSERT_DEATH(deque.back(),
"Precondition violation");
631 ASSERT_DEATH(deque.pop_front(),
"Precondition violation");
637 ASSERT_DEATH(deque.pop_back(),
"Precondition violation");
643 ASSERT_DEATH(deque.front(),
"Precondition violation");
649 TypeParam
const deque;
650 ASSERT_DEATH(deque.front(),
"Precondition violation");
658 "inline_deque<T> should be copy-constructible if and only if T is"
667 "inline_deque<T> should be move-constructible if and only if T is"
675 "inline_deque<T> should be copy-assignable if and only if T is copy-constructible and -assignable"
683 "inline_deque<T> should be move-assignable if and only if T is move-constructible and -assignable"
689 constexpr auto deque = TestFixture::full_test_deque();
690 STATIC_ASSERT_EQ(deque.size(), deque.capacity());
691 STATIC_ASSERT_EQ(deque.front(), TestFixture::test_value(0));
692 STATIC_ASSERT_EQ(deque.back(), TestFixture::test_value(deque.size() - 1U));
697 using random_access_it =
typename TypeParam::value_type
const*;
698 using bidirectional_it = ::testing::demoted_iterator<random_access_it, std::bidirectional_iterator_tag>;
699 using forward_it = ::testing::demoted_iterator<random_access_it, std::forward_iterator_tag>;
700 using input_it = ::testing::demoted_iterator<random_access_it, std::input_iterator_tag>;
719 using ::testing::throws_on;
720 using value_type =
typename TypeParam::value_type;
722 using normal_it = ::testing::noexcept_configurable_random_access_iterator<throws_on::nothing, value_type>;
724 using throwing_it = ::testing::noexcept_configurable_random_access_iterator<throws_on::minus_self, value_type>;
739 auto const init_list = TestFixture::full_test_initializer_list();
740 TypeParam
const deque(init_list.begin(), init_list.end());
742 ASSERT_EQ(deque.size(), init_list.size());
743 EXPECT_TRUE(::arene::base::equal(deque.begin(), deque.end(), init_list.begin()));
745 auto const try_deque = TypeParam::try_construct(init_list.begin(), init_list.end());
746 ASSERT_TRUE(try_deque.has_value());
747 EXPECT_TRUE(::arene::base::equal(try_deque->begin(), try_deque->end(), init_list.begin()));
752 TypeParam
const deque(
758 auto const init_list = TestFixture::full_test_initializer_list();
759 ASSERT_EQ(deque.size(), init_list.size());
760 EXPECT_TRUE(::arene::base::equal(deque.begin(), deque.end(), init_list.begin()));
762 auto const try_deque = TypeParam::try_construct(
766 ASSERT_TRUE(try_deque.has_value());
767 EXPECT_TRUE(::arene::base::equal(try_deque->begin(), try_deque->end(), init_list.begin()));
793 auto const init_list = TestFixture::full_test_initializer_list();
794 TypeParam
const deque(init_list);
796 ASSERT_EQ(deque.size(), init_list.size());
797 EXPECT_TRUE(::arene::base::equal(deque.begin(), deque.end(), init_list.begin()));
799 auto const try_deque = TypeParam::try_construct(init_list);
800 ASSERT_TRUE(try_deque.has_value());
801 EXPECT_TRUE(::arene::base::equal(try_deque->begin(), try_deque->end(), init_list.begin()));
808 TypeParam
const deque_from_ilist(init_list);
809 EXPECT_EQ(deque_from_ilist.size(), 0U);
811 TypeParam
const deque_from_range(init_list.begin(), init_list.end());
812 EXPECT_EQ(deque_from_range.size(), 0U);
814 auto const try_deque_from_ilist = TypeParam::try_construct(init_list);
815 ASSERT_TRUE(try_deque_from_ilist.has_value());
816 EXPECT_EQ(try_deque_from_ilist->size(), 0U);
818 auto const try_deque_from_range = TypeParam::try_construct(init_list.begin(), init_list.end());
819 ASSERT_TRUE(try_deque_from_range.has_value());
820 EXPECT_EQ(try_deque_from_range->size(), 0U);
826 CopyConstructFromBackwardRange,
829 auto const init_list = TestFixture::full_test_initializer_list();
830 ASSERT_DEATH(TypeParam(init_list.end(), init_list.begin()),
"Precondition");
836 TryCopyConstructFromBackwardRange,
839 auto const init_list = TestFixture::full_test_initializer_list();
840 EXPECT_FALSE(TypeParam::try_construct(init_list.end(), init_list.begin()).has_value());
846 CopyConstructFromOversizedRange,
850 ASSERT_DEATH(TypeParam(init_list.begin(), init_list.end()),
"Precondition");
856 TryCopyConstructFromOversizedRange,
860 EXPECT_FALSE(TypeParam::try_construct(init_list.begin(), init_list.end()).has_value());
876 EXPECT_FALSE(TypeParam::try_construct(
896 EXPECT_FALSE(TypeParam::try_construct(
906 ConstructFromOversizedInitializerList,
910 ASSERT_DEATH(
static_cast<void>(TypeParam(init_list)),
"Precondition");
916 TryConstructFromOversizedInitializerList,
920 EXPECT_FALSE(TypeParam::try_construct(init_list).has_value());
925 auto org = TestFixture::full_test_deque();
927 EXPECT_EQ(org.size(), org.capacity());
928 EXPECT_EQ(org.size(), dst.size());
930 EXPECT_EQ(TestFixture::test_value(i), dst.front());
931 EXPECT_EQ(org.front(), dst.front());
935 EXPECT_TRUE(org.empty());
936 EXPECT_TRUE(dst.empty());
941 auto org = TestFixture::full_test_deque();
942 auto dst = TypeParam::try_construct(org);
944 ASSERT_TRUE(dst.has_value());
945 EXPECT_TRUE(::arene::base::equal(org.begin(), org.end(), dst->begin()));
950 auto org = TestFixture::full_test_deque();
951 EXPECT_EQ(org.size(), org.capacity());
953 EXPECT_EQ(dst.size(), dst.capacity());
955 EXPECT_EQ(TestFixture::test_value(i), dst.front());
958 EXPECT_TRUE(dst.empty());
963 auto org = TestFixture::full_test_deque();
964 auto tmp = TestFixture::full_test_deque();
965 auto dst = TypeParam::try_construct(
std::move(tmp));
967 ASSERT_TRUE(dst.has_value());
968 EXPECT_TRUE(::arene::base::equal(org.begin(), org.end(), dst->begin()));
973 auto org = TestFixture::full_test_deque();
975 EXPECT_EQ(org.size(), org.capacity());
976 EXPECT_EQ(dst.size(), 0);
978 EXPECT_EQ(org.size(), org.capacity());
979 EXPECT_EQ(dst.size(), org.capacity());
981 EXPECT_EQ(TestFixture::test_value(i), dst.front());
982 EXPECT_EQ(org.front(), dst.front());
986 EXPECT_TRUE(org.empty());
987 EXPECT_TRUE(dst.empty());
992 TypeParam deque = TestFixture::full_test_deque();
995 ARENE_IGNORE_CLANG(
"-Wself-assign-overloaded",
"We're specifically testing self assignment");
998 ASSERT_EQ(deque.size(), deque.capacity());
1002 EXPECT_EQ(deque.front(), TestFixture::test_value(i));
1009 auto org = TestFixture::full_test_deque();
1011 ASSERT_EQ(org.size(), org.capacity());
1012 ASSERT_EQ(dst.size(), 0);
1015 ASSERT_EQ(dst.size(), org.capacity());
1016 for (
std::size_t i = 0; i < org.capacity(); i++) {
1017 EXPECT_EQ(TestFixture::test_value(i), dst.front());
1020 EXPECT_TRUE(dst.empty());
1025 TypeParam deque = TestFixture::full_test_deque();
1028 ASSERT_EQ(deque.size(), deque.capacity());
1031 EXPECT_EQ(deque.front(), TestFixture::test_value(i));
1038 auto org = TestFixture::full_test_deque();
1039 auto dst = TestFixture::full_test_deque();
1042 while (dst.size() > dst.capacity() / 2U) {
1047 ASSERT_EQ(dst.size(), org.capacity());
1048 for (
std::size_t i = 0; i < org.capacity(); i++) {
1049 EXPECT_EQ(TestFixture::test_value(i), dst.front());
1056 auto org = TestFixture::full_test_deque();
1057 auto dst = TestFixture::full_test_deque();
1061 while (org.size() > org.capacity() / 2U) {
1067 ASSERT_EQ(dst.size(), org.capacity() / 2U);
1068 for (
std::size_t i = 0; i < org.capacity() / 2U; i++) {
1069 EXPECT_EQ(TestFixture::test_value(i + removed_count), dst.front());
1076 auto org = TestFixture::full_test_deque();
1077 auto dst = TestFixture::full_test_deque();
1080 while (dst.size() > dst.capacity() / 2U) {
1085 ASSERT_EQ(dst.size(), org.capacity());
1086 for (
std::size_t i = 0; i < org.capacity(); i++) {
1087 EXPECT_EQ(TestFixture::test_value(i), dst.front());
1094 auto org = TestFixture::full_test_deque();
1095 auto dst = TestFixture::full_test_deque();
1099 while (org.size() > org.capacity() / 2U) {
1105 ASSERT_EQ(dst.size(), org.capacity() / 2U);
1106 for (
std::size_t i = 0; i < org.capacity() / 2U; i++) {
1107 EXPECT_EQ(TestFixture::test_value(i + removed_count), dst.front());
1128 using iterator =
typename TypeParam::iterator;
1129 using const_iterator =
typename TypeParam::const_iterator;
1134 TypeParam deque = TestFixture::full_test_deque();
1136 EXPECT_EQ(deque.begin(), deque.cbegin());
1141 TypeParam
const deque = TestFixture::full_test_deque();
1144 for (
auto const& element : deque) {
1145 EXPECT_EQ(element, TestFixture::test_value(value_idx));
1152 TypeParam
const deque = TestFixture::wrapped_test_deque();
1156 for (
auto const& element : deque) {
1157 EXPECT_EQ(element, TestFixture::test_value(value_idx));
1165 TypeParam deque = TestFixture::wrapped_test_deque();
1169 for (
auto& element : deque) {
1170 element = TestFixture::test_value(value_idx);
1176 for (
auto itr = deque.cbegin(); itr != deque.cend(); ++itr) {
1177 EXPECT_EQ(*itr, TestFixture::test_value(value_idx));
1184 TypeParam
const deque = TestFixture::wrapped_test_deque();
1187 std::size_t idx{deque.capacity() + (deque.capacity() / 2U) - 1U};
1188 for (
auto itr = deque.crbegin(); itr != deque.crend(); ++itr) {
1189 EXPECT_EQ(*itr, TestFixture::test_value(idx));
1197 TypeParam deque = TestFixture::wrapped_test_deque();
1201 for (
auto itr = deque.rbegin(); itr != deque.rend(); ++itr) {
1202 *itr = TestFixture::test_value(value_idx);
1207 for (
auto const& element : deque) {
1209 EXPECT_EQ(element, TestFixture::test_value(value_idx));
1216 TypeParam deque = TestFixture::test_deque(2U);
1218 auto itr = deque.cbegin();
1219 for (
std::size_t value_idx{}; value_idx / 3U < TypeParam::capacity(); ++value_idx) {
1220 EXPECT_EQ(*itr, TestFixture::test_value(value_idx));
1223 deque.push_back(TestFixture::test_value(value_idx + 2U));
1230 IteratorsNotInvalidatedByPopBack,
1239 TypeParam deque = TestFixture::construct();
1240 deque.push_front(TestFixture::test_value(0U));
1241 deque.push_front(TestFixture::test_value(1U));
1242 deque.push_front(TestFixture::test_value(2U));
1244 auto itr = deque.crbegin();
1246 for (
std::size_t value_idx{1U}; value_idx / 3U < TypeParam::capacity(); ++value_idx) {
1247 EXPECT_EQ(*itr, TestFixture::test_value(value_idx));
1250 deque.push_front(TestFixture::test_value(value_idx + 2U));
1256 using difference_type =
typename TypeParam::iterator::difference_type;
1258 TypeParam deque = TestFixture::full_test_deque();
1261 for (difference_type diff{}; diff <= static_cast<difference_type>(deque.size()); ++diff) {
1262 auto begin_copy = deque.begin();
1264 EXPECT_EQ(begin_copy, deque.begin() + diff);
1265 EXPECT_EQ(begin_copy, diff + deque.begin());
1267 auto cbegin_copy = deque.cbegin();
1268 cbegin_copy += diff;
1269 EXPECT_EQ(cbegin_copy, deque.cbegin() + diff);
1270 EXPECT_EQ(cbegin_copy, diff + deque.cbegin());
1276 using difference_type =
typename TypeParam::iterator::difference_type;
1278 TypeParam deque = TestFixture::full_test_deque();
1281 for (difference_type diff{}; diff <= static_cast<difference_type>(deque.size()); ++diff) {
1282 auto end_copy = deque.end();
1284 EXPECT_EQ(end_copy, deque.end() - diff);
1286 auto cend_copy = deque.cend();
1288 EXPECT_EQ(cend_copy, deque.cend() - diff);
1294 using difference_type =
typename TypeParam::iterator::difference_type;
1296 TypeParam deque = TestFixture::full_test_deque();
1298 for (difference_type diff{}; diff < static_cast<difference_type>(deque.size()); ++diff) {
1309 using difference_type =
typename TypeParam::iterator::difference_type;
1311 TypeParam deque = TestFixture::full_test_deque();
1312 TypeParam
const& const_deque = deque;
1314 for (difference_type diff{}; diff < static_cast<difference_type>(deque.size()); ++diff) {
1322 using difference_type =
typename TypeParam::iterator::difference_type;
1326 using deque_array = std::
1329 deques[0U] = TestFixture::full_test_deque();
1330 if (deques.size() >= 2U) {
1331 deques[1U] = TestFixture::half_test_deque();
1334 for (
auto& deque : deques) {
1335 auto const signed_size =
static_cast<difference_type
>(deque.size());
1337 auto current = deque.begin();
1338 auto const_current = deque.cbegin();
1339 for (difference_type current_pos{}; current_pos <= signed_size; ++current_pos) {
1342 auto test_iter = deque.begin();
1343 auto const_test_iter = deque.cbegin();
1344 for (difference_type diff{-current_pos}; diff < (signed_size - current_pos); ++diff) {
1345 EXPECT_EQ(test_iter - current, diff);
1346 EXPECT_EQ(const_test_iter - const_current, diff);
1360 using difference_type =
typename TypeParam::iterator::difference_type;
1362 TypeParam deque = TestFixture::full_test_deque();
1363 auto curr = deque.begin();
1364 auto const_curr = deque.cbegin();
1365 for (difference_type diff{}; diff <= static_cast<difference_type>(deque.size()); ++diff) {
1366 EXPECT_EQ(deque.begin() + diff, curr);
1369 EXPECT_EQ(deque.cbegin() + diff, const_curr);
1376 using difference_type =
typename TypeParam::iterator::difference_type;
1378 TypeParam deque = TestFixture::full_test_deque();
1379 auto curr = deque.end();
1380 auto const_curr = deque.cend();
1381 for (difference_type diff{}; diff <= static_cast<difference_type>(deque.size()); ++diff) {
1382 EXPECT_EQ(deque.end() - diff, curr);
1385 EXPECT_EQ(deque.cend() - diff, const_curr);
1392 using difference_type =
typename TypeParam::iterator::difference_type;
1394 TypeParam deque = TestFixture::full_test_deque();
1395 auto start = deque.begin();
1396 auto const_start = deque.cbegin();
1397 for (
auto diff =
static_cast<difference_type
>(deque.size()); diff >= 0; --diff) {
1398 EXPECT_EQ(start + diff, deque.end());
1399 EXPECT_EQ(const_start + diff, deque.cend());
1407 TypeParam deque = TestFixture::construct();
1408 EXPECT_EQ(deque.begin(), deque.end());
1409 EXPECT_EQ(deque.cbegin(), deque.cend());
1410 EXPECT_EQ(deque.rbegin(), deque.rend());
1411 EXPECT_EQ(deque.crbegin(), deque.crend());
1415template <
typename T>
1417 EXPECT_TRUE(first < second);
1418 EXPECT_TRUE(first <= second);
1419 EXPECT_FALSE(first > second);
1420 EXPECT_FALSE(first >= second);
1422 EXPECT_FALSE(second < first);
1423 EXPECT_FALSE(second <= first);
1424 EXPECT_TRUE(second > first);
1425 EXPECT_TRUE(second >= first);
1430 TypeParam deque = TestFixture::full_test_deque();
1432 auto curr = deque.begin();
1433 auto const_curr = deque.cbegin();
1434 for (
std::size_t i{}; i + 1U < deque.size(); ++i) {
1447 TypeParam deque = TestFixture::full_test_deque();
1448 ASSERT_DEATH(*deque.end(),
"Precondition");
1449 ASSERT_DEATH(*deque.cend(),
"Precondition");
1450 ASSERT_DEATH(
static_cast<void>(*deque.rend()),
"Precondition");
1451 ASSERT_DEATH(
static_cast<void>(*deque.crend()),
"Precondition");
1456 TypeParam deque = TestFixture::construct();
1457 ASSERT_DEATH(*deque.begin(),
"Precondition");
1458 ASSERT_DEATH(*deque.cbegin(),
"Precondition");
1459 ASSERT_DEATH(
static_cast<void>(*deque.rbegin()),
"Precondition");
1460 ASSERT_DEATH(
static_cast<void>(*deque.crbegin()),
"Precondition");
1465 TypeParam deque = TestFixture::full_test_deque();
1467 typename TypeParam::iterator default_it;
1468 EXPECT_NE(default_it, deque.begin());
1469 EXPECT_NE(default_it, deque.end());
1470 ASSERT_DEATH(*default_it,
"Precondition");
1471 ASSERT_DEATH(default_it += 0,
"Precondition");
1476 TypeParam deque = TestFixture::full_test_deque();
1478 typename TypeParam::const_iterator default_it;
1479 EXPECT_NE(default_it, deque.cbegin());
1480 EXPECT_NE(default_it, deque.cend());
1481 ASSERT_DEATH(*default_it,
"Precondition");
1482 ASSERT_DEATH(default_it += 0,
"Precondition");
1487 TypeParam deque1 = TestFixture::full_test_deque();
1488 TypeParam deque2 = TestFixture::full_test_deque();
1490 ASSERT_DEATH(
std::ignore = (deque1.begin() < deque2.begin()),
"Precondition");
1491 ASSERT_DEATH(
std::ignore = (deque1.begin() <= deque2.begin()),
"Precondition");
1492 ASSERT_DEATH(
std::ignore = (deque1.begin() > deque2.begin()),
"Precondition");
1493 ASSERT_DEATH(
std::ignore = (deque1.begin() >= deque2.begin()),
"Precondition");
1498 TypeParam deque = TestFixture::full_test_deque();
1503 ASSERT_DEATH(
std::ignore = (deque.begin() - minimum_value),
"Precondition");
1504 ASSERT_DEATH(
std::ignore = (deque.cbegin() - minimum_value),
"Precondition");
1512 CapacityIsAsSpecified,
1515 PushFrontOneElement,
1517 EmplaceFrontReturnsReference,
1518 EmplaceBackReturnsReference,
1519 FrontPushedElementIsCorrect,
1520 BackPushedElementIsCorrect,
1521 PushFrontWithinCapacity,
1522 PushBackWithinCapacity,
1523 PushFrontDetailCoverage,
1529 GoCircularFromFront,
1531 BasicFunctionFromFront,
1532 BasicFunctionFromBack,
1533 CanObserveAndModifyFromFront,
1534 CanObserveAndModifyFromBack,
1535 PushFrontCopiesLvalues,
1536 PushBackCopiesLvalues,
1537 NotCopyConstructibleIfDataTypeNotCopyConstructible,
1538 NotMoveConstructibleIfDataTypeNotMoveConstructible,
1539 NotCopyAssignableIfDataTypeNotCopyConstructibleAndCopyAssignable,
1540 NotMoveAssignableIfDataTypeNotMoveConstructibleAndMoveAssignable,
1541 CanConstructAtCompileTime,
1542 RangeConstructionSfinae,
1543 RangeConstructionNoexcept,
1544 CopyConstructFromRange,
1545 MoveConstructFromRange,
1546 InitializerListConstructionSfinae,
1547 InitializerListConstructionNoexcept,
1548 ConstructFromInitializerList,
1549 ConstructFromEmptyList,
1550 TryCopyConstructFromBackwardRange,
1551 TryCopyConstructFromOversizedRange,
1552 TryMoveConstructFromBackwardRange,
1553 TryMoveConstructFromOversizedRange,
1554 TryConstructFromOversizedInitializerList,
1556 CanCopyTryConstruct,
1558 CanMoveTryConstruct,
1563 CopyAssignIntoPartiallyFull,
1564 CopyAssignFromPartiallyFull,
1565 MoveAssignIntoPartiallyFull,
1566 MoveAssignFromPartiallyFull,
1567 IteratorsAreRandomAccessAndNoexcept,
1568 NonConstIteratorsImplicitlyConvertibleToConst,
1569 InspectWithIterators,
1570 IteratorsWrapAround,
1571 MutableIteratorsWork,
1572 InspectWithReverseIterators,
1573 MutableReverseIteratorsWork,
1574 IteratorsNotInvalidatedByPopFront,
1575 IteratorsNotInvalidatedByPopBack,
1576 BinaryPlusEquivalentToPlusEquals,
1577 BinaryMinusEquivalentToMinusEquals,
1578 IteratorBracketOperatorEquivalentToBinaryPlus,
1579 ContainerBracketOperatorEquivalentToIteratorBracketOperator,
1580 AnyIteratorDifferenceReturnsDistance,
1581 IteratorForwardMovementIsTheSameAsRepeatedIncrementing,
1582 IteratorBackwardMovementIsTheSameAsRepeatedDecrementing,
1583 IteratorsIncrementedOutOfBoundsBecomeEnd,
1584 EmptyDequeBeginEqualsEnd,
1590 PushFrontMoreThanCapacity,
1591 PushBackMoreThanCapacity,
1592 NonWrappingInsertOneWhenFull,
1598 ConstFrontWhenEmpty,
1599 CopyConstructFromBackwardRange,
1600 CopyConstructFromOversizedRange,
1601 MoveConstructFromBackwardRange,
1602 MoveConstructFromOversizedRange,
1603 ConstructFromOversizedInitializerList,
1604 DereferencingEndIteratorIsPreconditionViolation,
1605 DereferencingBeginOfEmptyDequeIsPreconditionViolation,
1606 DefaultConstructedIteratorCantBeUsed,
1607 DefaultConstructedConstIteratorCantBeUsed,
1608 IteratorOrderingFromDifferentDequesIsPreconditionViolation,
1609 SubtractingIteratorByMinimumValueIsPreconditionViolation
The death tests use the same fixture as the non-death tests, but as a distinct type to improve log ou...
Definition deque.hpp:180
Test fixture for all type-parameterized inline_deque tests.
Definition deque.hpp:88
static constexpr auto construct() noexcept(noexcept(Deque())) -> Deque
Return an empty Deque, allowing to call as this->construct, which becomes useful with the ....
Definition deque.hpp:111
static constexpr auto test_deque(std::size_t size) noexcept(noexcept(test_deque(0, size))) -> Deque
Return a Deque containing the test values [0,size) of T.
Definition deque.hpp:126
static constexpr auto test_deque(std::size_t begin, std::size_t end) noexcept(noexcept(::arene::base::testing::test_deque< Deque >(begin, end))) -> Deque
Return a Deque containing the test values [begin,end) of T.
Definition deque.hpp:117
static constexpr auto wrapped_test_deque() noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
Return a Deque containing the test values [capacity/2, 3*capacity/2) of T.
Definition deque.hpp:145
static constexpr auto test_initializer_list() noexcept -> std::initializer_list< T >
Return a std::initializer_list containing user-parameterized test_values.
Definition deque.hpp:166
static constexpr auto half_test_deque() noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
Return a Deque containing the test values [0,capacity/2) of T.
Definition deque.hpp:132
static constexpr bool constexpr_compatible
Whether the type parameter is constexpr compatible for this test.
Definition deque.hpp:93
static constexpr auto full_test_initializer_list() noexcept -> std::initializer_list< T >
Return a std::initializer_list containing Deque::capacity user-parameterized test_values.
Definition deque.hpp:172
static constexpr auto full_test_deque() noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
Return a Deque containing the test values [0,capacity) of T.
Definition deque.hpp:138
static constexpr auto test_value(std::size_t idx) noexcept(noexcept(::arene::base::testing::test_value< T >(idx))) ->
Return the idx 'th test value of the current T , parameterized by test suite users.
Definition deque.hpp:104
static constexpr auto test_initializer_list(std::index_sequence< Indices... >) noexcept -> std::initializer_list< T >
Return a std::initializer_list containing user-parameterized test_values.
Definition deque.hpp:158
A fixed-size array of T objects.
Definition array.hpp:77
An iterator whose i'th position yields an rvalue reference to test_value(i) of the given type.
Definition customization.hpp:174
Implementation of std::initializer_list for brace initialization.
Definition initializer_list.hpp:21
static constexpr value_type value
Definition integral_constant.hpp:34
Type trait to detect if a type is constructible from arguments of the specified types.
Definition is_constructible.hpp:29
Type trait to detect if a type is constructible from arguments of the specified types and is noexcept...
Definition is_constructible.hpp:84
static constexpr auto lowest() noexcept -> T
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:238
#define COND_STATIC_ASSERT_EQ(left_arg, right_arg)
Call Google Test ASSERT_EQ at runtime, and also statically if TypeParam is compatible.
Definition conditional_assertions.hpp:68
Provides macros used to disable and enable compiler specific diagnostics using the _Pragma operator.
#define ARENE_IGNORE_END()
Ends a region of a suppressed diagnostic.
Definition diagnostics.hpp:136
#define ARENE_IGNORE_CLANG(s, comment)
Pushes an ignore for a diagnostic into the compiler for clang only.
Definition diagnostics.hpp:116
#define ARENE_IGNORE_START()
Begins a region of a suppressed diagnostic.
Definition diagnostics.hpp:131
#define ARENE_IGNORE_ALL(s, comment)
Pushes an ignore for a diagnostic into the compiler for any compiler.
Definition diagnostics.hpp:122
Provides implementation of a backport of C++20's version of std::equal.
Definition customization.hpp:31
constexpr customization_detail::init_list_holder< T, has_constexpr_test_value< T >, Indices... > test_initializer_list
A function object returning a std::initializer_list of one test_value per index in the given pack.
constexpr auto test_deque(std::size_t begin, std::size_t end) noexcept(std::is_nothrow_copy_constructible< typename T::value_type >::value) -> T
Create a test deque containing a range of test values.
Definition deque.hpp:58
constexpr bool is_list_initializable_v
A type trait to check if a type is list-initializable using a brace-enclosed list of values with a gi...
Definition deque.hpp:73
constexpr auto test_value(std::size_t idx) noexcept(noexcept(customization_detail::test_value_generator< T >::test_value(idx))) -> T
Get the idx 'th test value of type T.
Definition customization.hpp:108
constexpr std::size_t ExternalVectorTest< T >::capacity
Definition external_vector.hpp:224
TYPED_TEST_SUITE_P(ExternalVectorTest)
TYPED_TEST_P(ExternalVectorTest, CanConstructAnEmptyVector)
Definition external_vector.hpp:236
REGISTER_TYPED_TEST_SUITE_P(ExternalVectorTest, ADLSwapSwapsContentsForBasicTypes, AfterClearVectorIsEmpty, AfterPushBackCanGetLastElement, AfterPushBackVectorIsNotEmpty, AssignFromInitListUsingAssignFunctionIsConditionallyNoexcept, AssignFromSizeAndValueIsConditionallyNoexcept, AtIndexSizeOrLargerThrows, AtIndexSizeOrLargerThrowsWithConstVec, AtOnConstVectorReturnsConstReference, AtReturnsReference, BackIsNoexcept, BackReturnsReference, CanAccessMultipleValuesWithAt, CanAccessMultipleValuesWithAtWithConstVec, CanAccessMultipleValuesWithIndexOperator, CanAssignFromBiggerCapacityVector, CanAssignFromInitListUsingAssignFunction, CanAssignFromInputIteratorRange, CanAssignFromIteratorRange, CanAssignFromSizeAndValue, CanCompareForOrdering, CanConstructAnEmptyVector, CanConstructFromInitializerList, CanConstructFromIteratorRange, CanConstructWithSize, CanConstructWithSizeAndValue, CanConstructWithSizeViaTryConstruct, CanCopyViaConstruct, CanCopyViaConstructFromLargerWithFewerElements, CanCopyViaConstructFromSmaller, CanCopyViaTryConstruct, CanCopyViaTryConstructFromLargerWithFewerElements, CanCopyViaTryConstructFromSmaller, CanDefaultConstructViaTryConstruct, CanEmplaceBack, CanEraseAtBeginning, CanEraseInMiddle, CanEraseRange, CanGetCBeginAndEnd, CanGetFront, CanGetIterator, CanInsertAtEndOfExistingVector, CanInsertInEmptyVector, CanInsertInMiddleOfExistingVector, CanIterateOverConstValues, CanIterateOverValues, CanMoveViaConstruct, CanMoveViaTryConstruct, CanPopBack, CanPushBackAValue, CanTryConstructFromInitializerList, CanTryConstructFromIteratorRange, CannotConstructWithSizeForANonDefaultConstructibleType, CannotTryConstructWithSizeForANonDefaultConstructibleType, CapacityIsAsSpecified, CapacityIsNoexcept, ConstBackReturnsConstReference, ConstructWithExcessiveSizeViaTryConstructFails, ConstructWithSizeViaNormalConstructWithDefaultConstructorNotNoexceptIsNotNoexcept, ConstructWithSizeViaTryConstructNotNoexceptIfDefaultConstructorNotNoexcept, CopyAssignOverLargerVectorDestroysExcess, CopyAssignOverLargerVectorFromInitListDestroysExcess, CopyAssignOverSmallerVectorCopiesElements, CopyAssignOverSmallerVectorFromInitListCopiesElements, CopyAssignmentIsConditionallyNoexcept, CopyingVectorCopiesElements, Data, DefaultEmplaceIsConditionallyNoexcept, DefaultTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept, EmplaceAtPositionIsConditionallyNoexcept, EmplaceBackIsConditionallyNoexcept, EmplaceInsert, EmptyIfJustStorage, EmptyIsNoexcept, EmptybyDefault, EraseIsNoexceptIfTypeHasNoexceptMove, FailToCopyViaTryConstructFromLargerWithMoreElements, FailToMoveViaTryConstructFromLargerWithMoreElements, IndexOperatorIsNoexcept, IndexOperatorOnConstVectorIsNoexcept, IndexOperatorOnConstVectorReturnsConstReference, IndexOperatorReturnsReference, InitialSizeIsZero, InputIteratorRangeAssignmentIsConditionallyNoexcept, InputIteratorRangeConstructionIsConditionallyNoexcept, InputIteratorRangeTryConstructionIsConditionallyNoexcept, InsertFromIteratorRangeInMiddle, InsertFromIteratorRangeIsConditionallyNoexcept, InsertIsConditionallyNoexcept, InsertNAtEndInsertsElements, InsertNInMiddleInsertsElements, InsertWithCountIsConditionallyNoexcept, IteratorRangeAssignmentIsConditionallyNoexcept, IteratorRangeConstructionIsConditionallyNoexcept, IteratorRangeTryConstructionIsConditionallyNoexcept, IteratorTypedefs, MaxSizeEqualsCapacity, MoveAssignOverLargerVectorDestroysExcess, MoveAssignOverSmallerVectorMovesElements, MoveAssignmentIsConditionallyNoexcept, MovingVectorMovesElements, MovingVectorWithNewStorageMovesElements, NoStorageDataIsNull, NotConstructibleWithSizeAndSourceIfDataNotCopyable, NotCopyConstructible, NotCopyConstructibleIfDataTypeNotCopyConstructible, NotMoveConstructibleIfDataTypeNotMoveConstructible, PopBackIsNoexcept, PushBackIsConditionallyNoexcept, ResizeIsConditionallyNoexcept, ResizeWithValueIsConditionallyNoexcept, ResizingFromLargeToSmallLeavesElements, ResizingFromSmallToLargeConstructsElementsAsCopiesOfSpecified, RetrievingAValueWithAtReturnsValueAfterPushBack, RetrievingAValueWithAtThrowsOnEmpty, ReverseIteration, SecondPushBackChangesLastValue, SizeIsCorrect, SizeIsNoexcept, StorageOnlyTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept, SwapNoexceptMatchesElementType, TryConstructFromTooLargeInitializerListReturnsEmpty, Typedefs, ZeroSizeVectorIsEmpty)
Definition accumulate.hpp:37
constexpr std::integral_constant< std::size_t, N > array< T, N >::size
Definition array.hpp:534
constexpr auto as_const(T &obj) noexcept -> std::add_const_t< T > &
Obtain an lvalue-reference to a const object of type T.
Definition as_const.hpp:29
constexpr bool is_invocable_v
Determine if a functor type is invocable with the specified argument types.
constexpr bool is_random_access_iterator_v
Definition iterator_category_traits.hpp:332
constexpr bool is_movable_v
Backport for the C++20 movable concept.
ARENE_NODISCARD constexpr auto next(Iterator itr, typename std::iterator_traits< Iterator >::difference_type steps=1) noexcept(noexcept(::arene::base::advance(itr, steps))) -> Iterator
Produces the Nth successor (or predecessor if steps is negative) of an iterator.
Definition next.hpp:38
auto check_ordering(T const &first, T const &second) noexcept -> void
Check that the first value is ordered strictly before the second.
Definition deque.hpp:1416
constexpr bool is_double_ended
Type trait to see if a particular TypeParam is double-ended or not; used to exclude some tests.
Definition deque.hpp:187
constexpr auto distance(Iterator first, Iterator last) noexcept(noexcept(distance_impl::do_distance(first, last, typename std::iterator_traits< Iterator >::iterator_category{}))) -> typename std::iterator_traits< Iterator >::difference_type
Find the number of elements between first and last.
Definition distance.hpp:79
constexpr bool is_copyable_v
Backport for the C++20 copyable concept.
constexpr std::integral_constant< typename inline_map< Key, Value, Capacity, Compare >::size_type, Capacity > inline_map< Key, Value, Capacity, Compare >::capacity
Definition map.hpp:2305
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
constexpr bool is_implicitly_constructible_v
Type trait to detect if a type is implicitly constructible from arguments of the specified types.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
make_integer_sequence< size_t, Size > make_index_sequence
A helper alias template for make_integer_sequence<size_t, Size>
Definition integer_sequence.hpp:224
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...
static constexpr auto const & ignore
An object to which anything can be assigned, which ignores the assigned value.
Definition ignore.hpp:72
constexpr auto addressof(T &value) noexcept -> T *
Obtains the actual address of the object or function arg, even in presence of overloaded operator&.
Definition addressof.hpp:24
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24
#define CONDITIONAL_TYPED_TEST_P(SuiteName, TestName,...)
Adds a type-parameterized test to a Google Test suite which is conditionally run based on the third p...
Definition conditional_tests.hpp:33