Skip to content

Commit

Permalink
Disable test_noexcept tests with MSVC
Browse files Browse the repository at this point in the history
std::list is not std::is_nothrow_move_constructible with MSVC making
(b)hopscotch_map/set not std::is_nothrow_move_constructible in that
case
  • Loading branch information
Tessil committed Sep 14, 2024
1 parent add641d commit 95df683
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/hopscotch_map_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,11 +1510,13 @@ BOOST_AUTO_TEST_CASE(test_precalculated_hash) {
BOOST_CHECK_EQUAL(map.erase(4, map.hash_function()(2)), 0);
}

#ifndef _MSC_VER
BOOST_AUTO_TEST_CASE_TEMPLATE(test_noexcept, HSet, test_types) {
static_assert(std::is_nothrow_default_constructible<HSet>::value, "");
static_assert(std::is_nothrow_move_constructible<HSet>::value, "");
static_assert(std::is_nothrow_move_assignable<HSet>::value, "");
static_assert(std::is_nothrow_swappable<HSet>::value, "");
}
#endif

BOOST_AUTO_TEST_SUITE_END()
2 changes: 2 additions & 0 deletions tests/hopscotch_set_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_insert_transparent_hint, HSet,
BOOST_CHECK_EQUAL(*otherIt, 2);
}

#ifndef _MSC_VER
BOOST_AUTO_TEST_CASE_TEMPLATE(test_noexcept, HSet, test_types) {
static_assert(std::is_nothrow_default_constructible<HSet>::value, "");
static_assert(std::is_nothrow_move_constructible<HSet>::value, "");
static_assert(std::is_nothrow_move_assignable<HSet>::value, "");
static_assert(std::is_nothrow_swappable<HSet>::value, "");
}
#endif

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 95df683

Please sign in to comment.