Skip to content

Commit 225547e

Browse files
committed
Fix test
1 parent 7317c9b commit 225547e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/RecordComponent.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ namespace internal
5151
Attributable a;
5252
a.setData(std::shared_ptr<AttributableData>{this, [](auto const &) {}});
5353
// this check can be too costly in some setups
54-
#if 1
55-
if ((*a.containingIteration().first.value())
56-
.asInternalCopyOf<Iteration>()
57-
.closed())
54+
#if openPMD_USE_INVASIVE_TESTS
55+
56+
auto &iterationData = *a.containingIteration().first.value();
57+
auto iteration = iterationData.asInternalCopyOf<Iteration>();
58+
if (iteration.closed() && !iterationData.allow_reopening_implicitly)
5859
{
5960
throw error::WrongAPIUsage(
6061
"Cannot write/read chunks to/from closed Iterations.");

0 commit comments

Comments
 (0)