From e5320df017a2e81e848582ddfc0fb8a8d6b7855e Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 31 Jan 2023 09:03:25 -0800 Subject: [PATCH] Fix msvc warnings --- test/unordered/noexcept_tests.cpp | 2 -- test/unordered/simple_tests.cpp | 32 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/test/unordered/noexcept_tests.cpp b/test/unordered/noexcept_tests.cpp index b33f7ab3..6ef5df8b 100644 --- a/test/unordered/noexcept_tests.cpp +++ b/test/unordered/noexcept_tests.cpp @@ -244,8 +244,6 @@ namespace noexcept_tests { template static void test_nothrow_move_when_noexcept(X*) { - X throwing_set; - if (have_is_nothrow_move) { BOOST_TEST(boost::is_nothrow_move_constructible::value); } diff --git a/test/unordered/simple_tests.cpp b/test/unordered/simple_tests.cpp index 84f1c362..a446f7c7 100644 --- a/test/unordered/simple_tests.cpp +++ b/test/unordered/simple_tests.cpp @@ -89,52 +89,52 @@ template void simple_test(X const& a) template static void simple_set_tests(X*) { - X set; + X x; - simple_test(set); + simple_test(x); - set.insert(1); - set.insert(2); - set.insert(1456); - simple_test(set); + x.insert(1); + x.insert(2); + x.insert(1456); + simple_test(x); } #ifndef BOOST_UNORDERED_FOA_TESTS template static void simple_multiset_tests(X*) { - X multiset; - simple_test(multiset); + X x; + simple_test(x); for (int i1 = 0; i1 < 1000; ++i1) { int count = rand() % 10, index = rand(); for (int j = 0; j < count; ++j) - multiset.insert(index); + x.insert(index); } - simple_test(multiset); + simple_test(x); } #endif template static void simple_map_tests(X*) { - X map; + X x; for (int i2 = 0; i2 < 1000; ++i2) { - map.insert(std::pair(rand(), rand())); + x.insert(std::pair(rand(), rand())); } - simple_test(map); + simple_test(x); } #ifndef BOOST_UNORDERED_FOA_TESTS template static void simple_multimap_tests(X*) { - X multimap; + X x; for (int i3 = 0; i3 < 1000; ++i3) { int count = rand() % 10, index = rand(); for (int j = 0; j < count; ++j) - multimap.insert(std::pair(index, rand())); + x.insert(std::pair(index, rand())); } - simple_test(multimap); + simple_test(x); } #endif