From 1de8801c08c41f06a8fd64389150a65cef95b421 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Fri, 14 Oct 2022 11:28:40 -0700 Subject: [PATCH] Add scary_tests --- test/Jamfile.v2 | 1 + test/unordered/scary_tests.cpp | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 572fa265..f1b4b641 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -131,3 +131,4 @@ build_foa transparent_tests ; build_foa reserve_tests ; build_foa contains_tests ; build_foa erase_if ; +build_foa scary_tests ; diff --git a/test/unordered/scary_tests.cpp b/test/unordered/scary_tests.cpp index 383af13a..f4508519 100644 --- a/test/unordered/scary_tests.cpp +++ b/test/unordered/scary_tests.cpp @@ -2,14 +2,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// clang-format off -#include "../helpers/prefix.hpp" -#include -#include -#include "../helpers/postfix.hpp" -// clang-format on - #include "../helpers/test.hpp" +#include "../helpers/unordered.hpp" #include "../objects/test.hpp" #include @@ -107,8 +101,7 @@ public: // ever using it with an int with has a trivial destructor so it eliminates // the code and generates a warning about an unused variable // - template - void destroy(U* p) + template void destroy(U* p) { (void)p; p->~U(); @@ -192,8 +185,7 @@ public: // ever using it with an int with has a trivial destructor so it eliminates // the code and generates a warning about an unused variable // - template - void destroy(U* p) + template void destroy(U* p) { (void)p; p->~U(); @@ -226,11 +218,13 @@ template void scary_test() BOOST_TEST_EQ(x.bucket_count(), 0u); +#ifndef BOOST_UNORDERED_FOA_TESTS typename C2::local_iterator lbegin(x.begin(0)); BOOST_TEST(lbegin == x.end(0)); typename C2::const_local_iterator clbegin(x.cbegin(0)); BOOST_TEST(clbegin == x.cend(0)); +#endif } template < @@ -316,11 +310,16 @@ void set_scary_test() } UNORDERED_AUTO_TEST (scary_tests) { +#ifdef BOOST_UNORDERED_FOA_TESTS + map_scary_test(); + set_scary_test(); +#else map_scary_test(); map_scary_test(); set_scary_test(); set_scary_test(); +#endif } RUN_TESTS()