From 4f37a023b0fbc266a51aa332de188e55a96d7eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 12 Jul 2020 11:06:01 +0200 Subject: [PATCH] Enable user warnings in tests to be able to fix them. --- test/allocator_traits_test.cpp | 2 -- test/deque_test.cpp | 4 ---- test/list_test.cpp | 3 --- test/map_test.cpp | 3 --- test/pair_test.cpp | 3 --- test/scoped_allocator_adaptor_test.cpp | 2 -- test/scoped_allocator_usage_test.cpp | 3 --- test/set_test.cpp | 3 --- test/slist_test.cpp | 4 ---- test/stable_vector_test.cpp | 3 --- test/static_vector_test.cpp | 2 -- test/string_test.cpp | 3 --- test/uses_allocator_test.cpp | 2 -- test/vector_test.cpp | 24 ++++++++++++------------ 14 files changed, 12 insertions(+), 49 deletions(-) diff --git a/test/allocator_traits_test.cpp b/test/allocator_traits_test.cpp index 4014424..eb42e56 100644 --- a/test/allocator_traits_test.cpp +++ b/test/allocator_traits_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -444,4 +443,3 @@ int main() return ::boost::report_errors(); } -#include diff --git a/test/deque_test.cpp b/test/deque_test.cpp index 22b87f4..6d5ed74 100644 --- a/test/deque_test.cpp +++ b/test/deque_test.cpp @@ -7,8 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// - -#include #include #include #include @@ -442,5 +440,3 @@ int main () return 0; } - -#include diff --git a/test/list_test.cpp b/test/list_test.cpp index c4f9f41..821f7b0 100644 --- a/test/list_test.cpp +++ b/test/list_test.cpp @@ -8,7 +8,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include #include #include @@ -282,5 +281,3 @@ int main () return 0; } - -#include diff --git a/test/map_test.cpp b/test/map_test.cpp index 7448303..c36581b 100644 --- a/test/map_test.cpp +++ b/test/map_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include @@ -689,5 +688,3 @@ int main () return 0; } - -#include diff --git a/test/pair_test.cpp b/test/pair_test.cpp index 5ead7a4..59dfd5e 100644 --- a/test/pair_test.cpp +++ b/test/pair_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include "movable_int.hpp" #include "emplace_test.hpp" @@ -152,5 +151,3 @@ int main () #endif //#!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) return ::boost::report_errors(); } - -#include diff --git a/test/scoped_allocator_adaptor_test.cpp b/test/scoped_allocator_adaptor_test.cpp index 6a051e2..042820d 100644 --- a/test/scoped_allocator_adaptor_test.cpp +++ b/test/scoped_allocator_adaptor_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include // container/detail @@ -1374,4 +1373,3 @@ int main() return ::boost::report_errors(); } -#include diff --git a/test/scoped_allocator_usage_test.cpp b/test/scoped_allocator_usage_test.cpp index d16a1ea..019c0a4 100644 --- a/test/scoped_allocator_usage_test.cpp +++ b/test/scoped_allocator_usage_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include @@ -464,5 +463,3 @@ int main() return 1; return 0; } - -#include diff --git a/test/set_test.cpp b/test/set_test.cpp index a7d0b47..a6d1f58 100644 --- a/test/set_test.cpp +++ b/test/set_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -651,5 +650,3 @@ int main () return 0; } - -#include diff --git a/test/slist_test.cpp b/test/slist_test.cpp index 0894344..8cc64bd 100644 --- a/test/slist_test.cpp +++ b/test/slist_test.cpp @@ -7,7 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include @@ -285,6 +284,3 @@ int main () return 0; } - -#include - diff --git a/test/stable_vector_test.cpp b/test/stable_vector_test.cpp index e0fb586..77a4aac 100644 --- a/test/stable_vector_test.cpp +++ b/test/stable_vector_test.cpp @@ -8,7 +8,6 @@ // ////////////////////////////////////////////////////////////////////////////// #define STABLE_VECTOR_ENABLE_INVARIANT_CHECKING -#include #include #include @@ -223,5 +222,3 @@ int main() return 0; } - -#include diff --git a/test/static_vector_test.cpp b/test/static_vector_test.cpp index f47df2e..539eea8 100644 --- a/test/static_vector_test.cpp +++ b/test/static_vector_test.cpp @@ -7,7 +7,6 @@ // Use, modification and distribution is subject to 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) -#include #include #include #include @@ -824,4 +823,3 @@ int main(int, char* []) return boost::report_errors(); } -#include diff --git a/test/string_test.cpp b/test/string_test.cpp index b2d17f6..48b5784 100644 --- a/test/string_test.cpp +++ b/test/string_test.cpp @@ -8,7 +8,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -592,5 +591,3 @@ int main() return boost::report_errors(); } - -#include diff --git a/test/uses_allocator_test.cpp b/test/uses_allocator_test.cpp index 39807f0..cb88a2b 100644 --- a/test/uses_allocator_test.cpp +++ b/test/uses_allocator_test.cpp @@ -7,9 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include - #include #include "propagation_test_allocator.hpp" diff --git a/test/vector_test.cpp b/test/vector_test.cpp index c9b82cc..398eaa3 100644 --- a/test/vector_test.cpp +++ b/test/vector_test.cpp @@ -340,24 +340,24 @@ int main() typedef boost::container::vector cont; typedef cont::allocator_type allocator_type; typedef boost::container::allocator_traits::pointer pointer; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value && - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG + ( !boost::has_trivial_destructor_after_move::value || + (boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value) + , "has_trivial_destructor_after_move(default allocator) test failed" + ); } // std::allocator { typedef boost::container::vector > cont; typedef cont::allocator_type allocator_type; typedef boost::container::allocator_traits::pointer pointer; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value && - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG + ( !boost::has_trivial_destructor_after_move::value || + (boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value) + , "has_trivial_destructor_after_move(std::allocator) test failed" + ); } return 0;