Skip to content

Commit cd438ba

Browse files
committed
tests: guard assign_subblock REQUIRE_THROW on TA_ASSERT_POLICY
The "overriding trange of result block is not allowed" check is enforced by a TA_ASSERT, so it only throws when TA_ASSERT_POLICY == TA_ASSERT_THROW. Under the Release default (TA_ASSERT_IGNORE) the assert is a no-op, so BOOST_REQUIRE_THROW failed with "Exception expected but not raised". Only expect the throw when assertions actually throw.
1 parent 9602d4f commit cd438ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/expressions_impl.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,14 +746,17 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(assign_subblock_block_base1, F, Fixtures, F) {
746746
a_base1("a,b,c")
747747
.block({3, 3, 3}, {5, 5, 5})
748748
.set_trange_lobound({0, 0, 0}));
749-
// overriding trange of result block is not allowed ...
749+
// overriding trange of result block is not allowed ... (this is enforced
750+
// by a TA_ASSERT, so the throw only happens when assertions throw)
751+
#if TA_ASSERT_POLICY == TA_ASSERT_THROW
750752
BOOST_REQUIRE_THROW(
751753
a_block("a,b,c")
752754
.block({0, 0, 0}, {2, 2, 2})
753755
.set_trange_lobound({0, 0, 0}) = a_base1("a,b,c")
754756
.block({3, 3, 3}, {5, 5, 5})
755757
.set_trange_lobound({0, 0, 0}),
756758
Exception);
759+
#endif
757760
// ... unless makes it same as trange lobound of the underlying array
758761
BOOST_REQUIRE_NO_THROW(a_block("a,b,c")
759762
.block({0, 0, 0}, {2, 2, 2})

0 commit comments

Comments
 (0)