HomePhabricator

Don't assert(...) with side effects

Description

Don't assert(...) with side effects

Summary:
This diffs fixes the assertions introduced in D3232 and adds a linter to
avoid reproducing the issue.

The fix is a backport of core PR14088
https://github.com/bitcoin/bitcoin/pull/14088/files
The linter is based on the second commit, but integrated into arcanist.

Test Plan:

./src/test/test_bitcoin -t scheduler_tests

Revert the changes in scheduler_tests and run:

arc lint -- src/test/scheduler_tests.cpp

The linter should catch the errors

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3277

Details

Committed
FabienJun 10 2019, 21:19
Pushed
nakihitoJun 10 2019, 22:49
Reviewer
Restricted Project
Differential Revision
D3277: Don't assert(...) with side effects
Parents
rSTAGING3a9a129d78b5: [LINTER] Add a spell checker to arcanist
Branches
Unknown
Tags
Unknown

Event Timeline

Fabien committed rSTAGING3a0a0966a1d1: Don't assert(...) with side effects (authored by practicalswift <practicalswift@users.noreply.github.com>).Jun 10 2019, 21:19