Skip to content

Commit 4c3c9c3

Browse files
Don't assert(...) with side effects
1 parent 0df9b0a commit 4c3c9c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/scheduler_tests.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@ BOOST_AUTO_TEST_CASE(singlethreadedscheduler_ordered)
138138
// the callbacks should run in exactly the order in which they were enqueued
139139
for (int i = 0; i < 100; ++i) {
140140
queue1.AddToProcessQueue([i, &counter1]() {
141-
assert(i == counter1++);
141+
bool expectation = i == counter1++;
142+
assert(expectation);
142143
});
143144

144145
queue2.AddToProcessQueue([i, &counter2]() {
145-
assert(i == counter2++);
146+
bool expectation = i == counter2++;
147+
assert(expectation);
146148
});
147149
}
148150

0 commit comments

Comments
 (0)