diff --git a/tests/bipartite_index_list.cpp b/tests/bipartite_index_list.cpp index 364f894659..ac1aa8fd5d 100644 --- a/tests/bipartite_index_list.cpp +++ b/tests/bipartite_index_list.cpp @@ -335,11 +335,11 @@ BOOST_AUTO_TEST_CASE(end_itr) { BOOST_AUTO_TEST_CASE(at_member) { for (auto&& [str, idx] : idxs) { if (world.nproc() == 1) { - BOOST_CHECK_TA_ASSERT(idx.at(idx.size()), + BOOST_CHECK_THROW(idx.at(idx.size()), #ifdef BOOST_CONTAINER_USE_STD_EXCEPTIONS - std::out_of_range + std::out_of_range #else - boost::container::out_of_range + boost::container::out_of_range #endif ); } diff --git a/tests/block_range.cpp b/tests/block_range.cpp index 47f9d88e8f..0f3dd53fc7 100644 --- a/tests/block_range.cpp +++ b/tests/block_range.cpp @@ -111,7 +111,8 @@ BOOST_AUTO_TEST_CASE(block_zero_lower_bound) { ++count_invalid; // Check for exception with invalid input - BOOST_CHECK_THROW(BlockRange(r0, lower, upper), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(BlockRange(r0, lower, upper), + TiledArray::Exception); } } } @@ -258,7 +259,8 @@ BOOST_AUTO_TEST_CASE(block) { ++count_invalid; // Check for exception with invalid input - BOOST_CHECK_THROW(BlockRange(r, lower, upper), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(BlockRange(r, lower, upper), + TiledArray::Exception); } } } diff --git a/tests/dist_array.cpp b/tests/dist_array.cpp index 24a65f6015..eb1ee2d197 100644 --- a/tests/dist_array.cpp +++ b/tests/dist_array.cpp @@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(find_local) { } else { // Check that an exception is thrown when using a default constructed // object - BOOST_CHECK_THROW(a.find_local(tile_idx), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(a.find_local(tile_idx), TiledArray::Exception); } } } diff --git a/tests/dist_op_group.cpp b/tests/dist_op_group.cpp index b4846716f4..8027eab7e1 100644 --- a/tests/dist_op_group.cpp +++ b/tests/dist_op_group.cpp @@ -56,14 +56,14 @@ BOOST_AUTO_TEST_CASE(constructor_empty) { #if defined(MADNESS_ASSERTIONS_THROW) // Check that accessing group data throws exceptions for an empty group. - BOOST_CHECK_TA_ASSERT(empty_group.id(), madness::MadnessException); - BOOST_CHECK_TA_ASSERT(empty_group.get_world(), madness::MadnessException); - BOOST_CHECK_TA_ASSERT(empty_group.rank(), madness::MadnessException); - BOOST_CHECK_TA_ASSERT(empty_group.rank(0), madness::MadnessException); - BOOST_CHECK_TA_ASSERT(empty_group.world_rank(0), madness::MadnessException); + BOOST_CHECK_THROW(empty_group.id(), madness::MadnessException); + BOOST_CHECK_THROW(empty_group.get_world(), madness::MadnessException); + BOOST_CHECK_THROW(empty_group.rank(), madness::MadnessException); + BOOST_CHECK_THROW(empty_group.rank(0), madness::MadnessException); + BOOST_CHECK_THROW(empty_group.world_rank(0), madness::MadnessException); ProcessID parent, child1, child2; - BOOST_CHECK_TA_ASSERT(empty_group.make_tree(0, parent, child1, child2), - madness::MadnessException); + BOOST_CHECK_THROW(empty_group.make_tree(0, parent, child1, child2), + madness::MadnessException); #endif // MADNESS_ASSERTIONS_THROW } diff --git a/tests/distributed_storage.cpp b/tests/distributed_storage.cpp index 895b734911..ac331a31ff 100644 --- a/tests/distributed_storage.cpp +++ b/tests/distributed_storage.cpp @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(array_operator) { // Check throw for an out-of-range set. BOOST_CHECK_TA_ASSERT(t.get(t.max_size()), TiledArray::Exception); - BOOST_CHECK_THROW(t.get(t.max_size() + 2), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.get(t.max_size() + 2), TiledArray::Exception); } BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/eigen.cpp b/tests/eigen.cpp index 11ca7088b1..fa6b9f2ddf 100644 --- a/tests/eigen.cpp +++ b/tests/eigen.cpp @@ -283,7 +283,7 @@ BOOST_AUTO_TEST_CASE(array_to_matrix) { } } else { // Check that eigen_to_array throws when there is more than one node - BOOST_CHECK_THROW(array_to_eigen(arr), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(array_to_eigen(arr), TiledArray::Exception); // Fill local tiles with data GlobalFixture::world->srand(27); @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(array_to_vector) { } } else { // Check that eigen_to_array throws when there is more than one node - BOOST_CHECK_THROW(array_to_eigen(arr1), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(array_to_eigen(arr1), TiledArray::Exception); // Fill local tiles with data GlobalFixture::world->srand(27); @@ -533,8 +533,8 @@ BOOST_AUTO_TEST_CASE(array_to_tensor) { if (GlobalFixture::world->size() > 1) { // Check that array_to_eigen_tensor throws when there is more than one // node - BOOST_CHECK_THROW(array_to_eigen_tensor(arr), - TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(array_to_eigen_tensor(arr), + TiledArray::Exception); } // Distribute the data of arrayN to all nodes diff --git a/tests/expressions_impl.h b/tests/expressions_impl.h index 626927bcdd..2aace79950 100644 --- a/tests/expressions_impl.h +++ b/tests/expressions_impl.h @@ -749,7 +749,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(assign_subblock_block_base1, F, Fixtures, F) { // overriding trange of result block is not allowed ... (this is enforced // by a TA_ASSERT, so the throw only happens when assertions throw) #if TA_ASSERT_POLICY == TA_ASSERT_THROW - BOOST_REQUIRE_THROW( + BOOST_REQUIRE_TA_ASSERT( a_block("a,b,c") .block({0, 0, 0}, {2, 2, 2}) .set_trange_lobound({0, 0, 0}) = a_base1("a,b,c") diff --git a/tests/index_list.cpp b/tests/index_list.cpp index c53bdd9de7..35bd14839a 100644 --- a/tests/index_list.cpp +++ b/tests/index_list.cpp @@ -135,11 +135,11 @@ BOOST_AUTO_TEST_CASE(accessors) { BOOST_CHECK_EQUAL(v.at(3), "d"); // check last variable access BOOST_CHECK_EQUAL(v[0], "a"); // check 1st variable access BOOST_CHECK_EQUAL(v[3], "d"); // check last variable access - BOOST_CHECK_TA_ASSERT(v.at(4), + BOOST_CHECK_THROW(v.at(4), #ifdef BOOST_CONTAINER_USE_STD_EXCEPTIONS - std::out_of_range + std::out_of_range #else - boost::container::out_of_range + boost::container::out_of_range #endif ); // check for out of range throw. } diff --git a/tests/initializer_list.cpp b/tests/initializer_list.cpp index 3f5ad27b80..9582cf78b8 100644 --- a/tests/initializer_list.cpp +++ b/tests/initializer_list.cpp @@ -304,7 +304,7 @@ BOOST_AUTO_TEST_CASE(bad_matrix) { std::array buffer{}; matrix_il il{{1, 2}, {3, 4, 5}}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(flatten_il(il, buffer.begin()), Exception); + BOOST_CHECK_TA_ASSERT(flatten_il(il, buffer.begin()), Exception); } BOOST_AUTO_TEST_CASE(empty_matrix) { @@ -470,8 +470,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(vector, T, scalar_type_list) { TiledRange tr{{0, 2, 3}}; auto array = array_from_il>(world, tr, il); using tile_type = typename TArray::value_type; - std::vector corr{tile_type(tr.make_tile_range(0), {1.0, 2.0}), - tile_type(tr.make_tile_range(1), std::initializer_list{3.0})}; + std::vector corr{ + tile_type(tr.make_tile_range(0), {1.0, 2.0}), + tile_type(tr.make_tile_range(1), std::initializer_list{3.0})}; for (auto i = 0; i < array.size(); ++i) { if (!array.is_local(i)) continue; tile_type tile = array.find(i); @@ -484,10 +485,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(matrix, T, scalar_type_list) { TiledRange tr{{{0, 2, 3}, {0, 1, 3}}}; auto array = array_from_il>(world, tr, il); using tile_type = typename TArray::value_type; - std::vector corr{tile_type(tr.make_tile_range(0), {1.0, 4.0}), - tile_type(tr.make_tile_range(1), {2.0, 3.0, 5.0, 6.0}), - tile_type(tr.make_tile_range(2), std::initializer_list{7.0}), - tile_type(tr.make_tile_range(3), {8.0, 9.0})}; + std::vector corr{ + tile_type(tr.make_tile_range(0), {1.0, 4.0}), + tile_type(tr.make_tile_range(1), {2.0, 3.0, 5.0, 6.0}), + tile_type(tr.make_tile_range(2), std::initializer_list{7.0}), + tile_type(tr.make_tile_range(3), {8.0, 9.0})}; for (auto i = 0; i < array.size(); ++i) { if (!array.is_local(i)) continue; tile_type tile = array.find(i); @@ -501,14 +503,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(tensor, T, scalar_type_list) { TiledRange tr{{{0, 1, 2}, {0, 2, 3}, {0, 1, 3}}}; auto array = array_from_il>(world, tr, il); using tile_type = typename TArray::value_type; - std::vector corr{tile_type(tr.make_tile_range(0), {1.0, 4.0}), - tile_type(tr.make_tile_range(1), {2.0, 3.0, 5.0, 6.0}), - tile_type(tr.make_tile_range(2), std::initializer_list{7.0}), - tile_type(tr.make_tile_range(3), {8.0, 9.0}), - tile_type(tr.make_tile_range(4), {10.0, 13.0}), - tile_type(tr.make_tile_range(5), {11.0, 12.0, 14.0, 15.0}), - tile_type(tr.make_tile_range(6), std::initializer_list{16.0}), - tile_type(tr.make_tile_range(7), {17.0, 18.0})}; + std::vector corr{ + tile_type(tr.make_tile_range(0), {1.0, 4.0}), + tile_type(tr.make_tile_range(1), {2.0, 3.0, 5.0, 6.0}), + tile_type(tr.make_tile_range(2), std::initializer_list{7.0}), + tile_type(tr.make_tile_range(3), {8.0, 9.0}), + tile_type(tr.make_tile_range(4), {10.0, 13.0}), + tile_type(tr.make_tile_range(5), {11.0, 12.0, 14.0, 15.0}), + tile_type(tr.make_tile_range(6), std::initializer_list{16.0}), + tile_type(tr.make_tile_range(7), {17.0, 18.0})}; for (auto i = 0; i < array.size(); ++i) { if (!array.is_local(i)) continue; tile_type tile = array.find(i); @@ -529,7 +532,7 @@ BOOST_AUTO_TEST_CASE(scalar) { BOOST_AUTO_TEST_CASE_TEMPLATE(empty_vector, T, scalar_type_list) { vector_il il{}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(array_from_il>(world, il), Exception); + BOOST_CHECK_TA_ASSERT(array_from_il>(world, il), Exception); } BOOST_AUTO_TEST_CASE_TEMPLATE(vector, T, scalar_type_list) { @@ -550,13 +553,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(vector, T, scalar_type_list) { BOOST_AUTO_TEST_CASE_TEMPLATE(empty_matrix, T, scalar_type_list) { matrix_il il{{}}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(array_from_il>(world, il), Exception); + BOOST_CHECK_TA_ASSERT(array_from_il>(world, il), Exception); } BOOST_AUTO_TEST_CASE_TEMPLATE(bad_matrix, T, scalar_type_list) { matrix_il il{{1, 2}, {3, 4, 5}}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(array_from_il>(world, il), Exception); + BOOST_CHECK_TA_ASSERT(array_from_il>(world, il), Exception); } BOOST_AUTO_TEST_CASE_TEMPLATE(square_matrix, T, scalar_type_list) { @@ -611,13 +614,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(short_matrix, T, scalar_type_list) { BOOST_AUTO_TEST_CASE_TEMPLATE(empty_rank3, T, scalar_type_list) { tensor3_il il{{{}}}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(array_from_il>(world, il), Exception); + BOOST_CHECK_TA_ASSERT(array_from_il>(world, il), Exception); } BOOST_AUTO_TEST_CASE_TEMPLATE(bad_rank3, T, scalar_type_list) { tensor3_il il{{{1, 2}, {3, 4, 5}}}; if (world.rank() == 0) // only rank 0 does the work - BOOST_CHECK_THROW(array_from_il>(world, il), Exception); + BOOST_CHECK_TA_ASSERT(array_from_il>(world, il), Exception); } BOOST_AUTO_TEST_CASE_TEMPLATE(square_rank3, T, scalar_type_list) { diff --git a/tests/range.cpp b/tests/range.cpp index 71f20aeb3f..ba370fd174 100644 --- a/tests/range.cpp +++ b/tests/range.cpp @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(constructors) { BOOST_REQUIRE_NO_THROW( Range r(ranges::views::zip(p2, f2))); // uses zipped range of p2 and f2 - BOOST_CHECK_THROW(Range r2(f2, p2), Exception); // lobound > upbound + BOOST_CHECK_TA_ASSERT(Range r2(f2, p2), Exception); // lobound > upbound Range r2(p2, f2); BOOST_CHECK_EQUAL_COLLECTIONS( r2.lobound_data(), r2.lobound_data() + r2.rank(), p2.begin(), p2.end()); @@ -639,7 +639,7 @@ BOOST_AUTO_TEST_CASE(include) { BOOST_CHECK(r.includes_ordinal(o)); // equivalent: see below } BOOST_CHECK(!r.includes(o)); - BOOST_CHECK_THROW( + BOOST_CHECK_TA_ASSERT( r_1d.includes(0), TiledArray::Exception); // for 1-d Range can't distinguish // includes(integers...) and includes(ordinal) diff --git a/tests/tensor.cpp b/tests/tensor.cpp index 206ebad985..2b726aacc6 100644 --- a/tests/tensor.cpp +++ b/tests/tensor.cpp @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(default_constructor) { const_cast(x).end()); // check for element access error - BOOST_CHECK_THROW(x[0], Exception); + BOOST_CHECK_TA_ASSERT(x[0], Exception); } BOOST_AUTO_TEST_CASE(range_constructor) { @@ -408,8 +408,8 @@ BOOST_AUTO_TEST_CASE(element_access) { #endif // check out of range error - BOOST_CHECK_THROW(t[r.upbound()], Exception); - BOOST_CHECK_THROW(t[r.volume()], Exception); + BOOST_CHECK_TA_ASSERT(t[r.upbound()], Exception); + BOOST_CHECK_TA_ASSERT(t[r.volume()], Exception); } BOOST_AUTO_TEST_CASE(iteration) { diff --git a/tests/tot_dist_array_part1.cpp b/tests/tot_dist_array_part1.cpp index b16decf64b..f6b11c9b8a 100644 --- a/tests/tot_dist_array_part1.cpp +++ b/tests/tot_dist_array_part1.cpp @@ -409,15 +409,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(find, TestParam, test_params) { auto upbound = tile_range.upbound(); // Throw if coordinate index is out of bounds - BOOST_CHECK_THROW(t.find(upbound), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.find(upbound), TiledArray::Exception); // Throw if ordinal index is out of bounds - BOOST_CHECK_THROW(t.find(tile_range.volume()), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.find(tile_range.volume()), TiledArray::Exception); std::vector temp(upbound.begin(), upbound.end()); temp.push_back(1); // Throw if coordinate index has a different rank - BOOST_CHECK_THROW(t.find(temp), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.find(temp), TiledArray::Exception); } // Get the 0-th element by ordinate index @@ -506,7 +506,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_value, TestParam, test_params) { { if (m_world.nproc() == 1) { tensor_type t; - BOOST_CHECK_THROW(t.set(0, inner_type{}), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.set(0, inner_type{}), TiledArray::Exception); } } @@ -525,17 +525,17 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_value, TestParam, test_params) { // Throw if already initialized auto& t3 = std::get<2>(tr_t); - BOOST_CHECK_THROW(t3.set(lobound, inner_type{}), except_t); + BOOST_CHECK_TA_ASSERT(t3.set(lobound, inner_type{}), except_t); // Throw if coordinate index is out of bounds - BOOST_CHECK_THROW(t.set(upbound, inner_type{}), except_t); + BOOST_CHECK_TA_ASSERT(t.set(upbound, inner_type{}), except_t); // Throw if ordinal index is out of bounds - BOOST_CHECK_THROW(t.set(volume, inner_type{}), except_t); + BOOST_CHECK_TA_ASSERT(t.set(volume, inner_type{}), except_t); // Throw if coordinate index has a different rank std::vector bad_rank(tr.tiles_range().rank() + 1, 0); - BOOST_CHECK_THROW(t.set(bad_rank, inner_type{}), except_t); + BOOST_CHECK_TA_ASSERT(t.set(bad_rank, inner_type{}), except_t); } { @@ -588,7 +588,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_future, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.set(0, future_type{}), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.set(0, future_type{}), TiledArray::Exception); } for (auto tr_t : run_all()) { @@ -606,18 +606,18 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_future, TestParam, test_params) { future_type f; // Value doesn't matter for throwing // Throw if tile is already initialized - BOOST_CHECK_THROW(corr.set(0, f), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(corr.set(0, f), TiledArray::Exception); // Throw if coordinate index is out of bounds - BOOST_CHECK_THROW(t_by_idx.set(upbound, f), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(upbound, f), TiledArray::Exception); // Throw if ordinal index is out of bounds - BOOST_CHECK_THROW(t_by_idx.set(volume, f), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(volume, f), TiledArray::Exception); // Throw if coordinate index has a different rank std::vector temp(upbound.begin(), upbound.end()); temp.push_back(0); - BOOST_CHECK_THROW(t_by_idx.set(temp, f), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(temp, f), TiledArray::Exception); } for (auto tidx : tile_range) { @@ -658,7 +658,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_tile, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.set(0, tile_type{}), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.set(0, tile_type{}), TiledArray::Exception); } for (auto tr_t : run_all()) { @@ -676,18 +676,18 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(set_tile, TestParam, test_params) { tile_type t; // Value doesn't matter for throwing // Throw if tile is already initialized - BOOST_CHECK_THROW(corr.set(0, t), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(corr.set(0, t), TiledArray::Exception); // Throw if coordinate index is out of bounds - BOOST_CHECK_THROW(t_by_idx.set(upbound, t), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(upbound, t), TiledArray::Exception); // Throw if ordinal index is out of bounds - BOOST_CHECK_THROW(t_by_idx.set(volume, t), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(volume, t), TiledArray::Exception); // Throw if coordinate index has a different rank std::vector temp(upbound.begin(), upbound.end()); temp.push_back(0); - BOOST_CHECK_THROW(t_by_idx.set(temp, t), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t_by_idx.set(temp, t), TiledArray::Exception); } for (auto tidx : tile_range) { diff --git a/tests/tot_dist_array_part2.cpp b/tests/tot_dist_array_part2.cpp index 6129ccd8f8..f71b51e6d3 100644 --- a/tests/tot_dist_array_part2.cpp +++ b/tests/tot_dist_array_part2.cpp @@ -504,7 +504,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_local, TestParam, test_params) { // Throws if index has wrong rank std::vector bad_idx(upbound.size() + 1, 0); - BOOST_CHECK_THROW(corr.is_local(bad_idx), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(corr.is_local(bad_idx), TiledArray::Exception); } for (auto idx : corr.tiles_range()) { @@ -519,7 +519,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_local_init_list, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.is_local({0}), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.is_local({0}), TiledArray::Exception); } for (auto tr_t : run_all()) { @@ -533,13 +533,14 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_local_init_list, TestParam, test_params) { // Test throws if index is out of bounds if (rank == 1) - BOOST_CHECK_THROW(corr.is_local({upbound[0]}), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_local({upbound[0]}), except_t); else if (rank == 2) - BOOST_CHECK_THROW(corr.is_local({upbound[0], upbound[1]}), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_local({upbound[0], upbound[1]}), + except_t); // Throws if index has wrong rank std::initializer_list il2{0, 0, 0, 0, 0, 0}; - BOOST_CHECK_THROW(corr.is_local(il2), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_local(il2), except_t); } for (auto idx : corr.tiles_range()) { @@ -558,7 +559,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.is_zero(0), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.is_zero(0), TiledArray::Exception); } for (auto tr_t : run_all()) { @@ -569,11 +570,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero, TestParam, test_params) { const auto& upbound = tr.tiles_range().upbound(); // Test throws if index is out of bounds - BOOST_CHECK_THROW(corr.is_zero(upbound), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(corr.is_zero(upbound), TiledArray::Exception); // Throws if index has wrong rank std::vector bad_idx(upbound.size() + 1, 0); - BOOST_CHECK_THROW(corr.is_zero(bad_idx), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(corr.is_zero(bad_idx), TiledArray::Exception); } for (auto idx : corr.tiles_range()) { @@ -588,7 +589,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero_init_list, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.is_zero({0}), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.is_zero({0}), TiledArray::Exception); } for (auto tr_t : run_all()) { @@ -602,13 +603,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero_init_list, TestParam, test_params) { // Test throws if index is out of bounds if (rank == 1) - BOOST_CHECK_THROW(corr.is_zero({upbound[0]}), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_zero({upbound[0]}), except_t); else if (rank == 2) - BOOST_CHECK_THROW(corr.is_zero({upbound[0], upbound[1]}), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_zero({upbound[0], upbound[1]}), except_t); // Throws if index has wrong rank std::initializer_list il2{0, 0, 0, 0, 0, 0}; - BOOST_CHECK_THROW(corr.is_zero(il2), except_t); + BOOST_CHECK_TA_ASSERT(corr.is_zero(il2), except_t); } for (auto idx : corr.tiles_range()) { @@ -639,7 +640,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(make_replicated, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.make_replicated(), TiledArray::Exception); + BOOST_CHECK_TA_ASSERT(t.make_replicated(), TiledArray::Exception); } for (auto tr_t : run_all()) { diff --git a/tests/unit_test_config.h.in b/tests/unit_test_config.h.in index 59e485634f..01c04cf1ce 100644 --- a/tests/unit_test_config.h.in +++ b/tests/unit_test_config.h.in @@ -75,9 +75,9 @@ #define BOOST_WARN_TA_ASSERT( S, E ) \ BOOST_WARN_MESSAGE( false, "Skipped BOOST_WARN_TA_ASSERT(" BOOST_STRINGIZE(S) "," BOOST_STRINGIZE(E) ") due to TA_ASSERT_POLICY != TA_ASSERT_THROW" ) #define BOOST_CHECK_TA_ASSERT( S, E ) \ - BOOST_WARN_MESSAGE( false, "Skipped BOOST_CHECK_THROW(" BOOST_STRINGIZE(S) "," BOOST_STRINGIZE(E) ") due to TA_ASSERT_POLICY != TA_ASSERT_THROW" ) + BOOST_WARN_MESSAGE( false, "Skipped BOOST_CHECK_TA_ASSERT(" BOOST_STRINGIZE(S) "," BOOST_STRINGIZE(E) ") due to TA_ASSERT_POLICY != TA_ASSERT_THROW" ) #define BOOST_REQUIRE_TA_ASSERT( S, E ) \ - BOOST_WARN_MESSAGE( false, "Skipped BOOST_REQUIRE_THROW(" BOOST_STRINGIZE(S) "," BOOST_STRINGIZE(E) ") due to TA_ASSERT_POLICY != TA_ASSERT_THROW" ) + BOOST_WARN_MESSAGE( false, "Skipped BOOST_REQUIRE_TA_ASSERT(" BOOST_STRINGIZE(S) "," BOOST_STRINGIZE(E) ") due to TA_ASSERT_POLICY != TA_ASSERT_THROW" ) #endif