Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a1631e6

Browse files
authoredNov 23, 2022
Assertions should not have side effects (#886)
1 parent 47d8aef commit a1631e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎coreneuron/io/core2nrn_data_return.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ void core2nrn_tqueue(NrnThread& nt) {
546546
}
547547
// TQitems from binq_
548548
for (q = tqe->binq_->first(); q; q = tqe->binq_->next(q)) {
549-
assert(core2nrn_tqueue_item(q, sewm, nt) == false);
549+
bool const result = core2nrn_tqueue_item(q, sewm, nt);
550+
assert(result == false);
550551
}
551552

552553
// For self events with weight, find the NetCon index and send that

‎coreneuron/io/phase2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ void Phase2::read_file(FileHandler& F, const NrnThread& nt) {
246246
preSynConditionEventFlags.push_back(F.read_int());
247247
}
248248

249-
assert(F.read_int() == -1);
249+
nrn_assert(F.read_int() == -1);
250250
restore_events(F);
251251

252-
assert(F.read_int() == -1);
252+
nrn_assert(F.read_int() == -1);
253253
restore_events(F);
254254
}
255255

0 commit comments

Comments
 (0)
This repository has been archived.