Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Kill BOOST_ASSERT and update the linter #27889

Merged
merged 2 commits into from Jun 22, 2023

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jun 14, 2023

One of the goals of #27783 was to get rid of the BOOST_ASSERT macros instead of including the boost/assert.hpp headers. See #27783 (comment).

It turns out that a couple of those macros sneaked into the codebase in #27790.

This PR makes the linter guard against new instances of the BOOST_ASSERT macros and replaces the current ones.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 14, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK kevkevinpal, stickies-v, TheCharlatan

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Jun 14, 2023
test/lint/lint-includes.py Outdated Show resolved Hide resolved
@hebasto
Copy link
Member Author

hebasto commented Jun 14, 2023

Updated 82f694a -> de5e464 (pr27889.01 -> pr27889.02, diff):

The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`.
@hebasto
Copy link
Member Author

hebasto commented Jun 14, 2023

Updated de5e464 -> 28fff06 (pr27889.02 -> pr27889.03, diff):

@kevkevinpal
Copy link
Contributor

ACK 28fff06

did on a grep on 427853a
grep -nri "BOOST_ASSERT" ./src and grep -nri "BOOST_ASSERT" ./test
found the two instances of BOOST_ASSERT you removed

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 28fff06

No need for BOOST_ASSERT. Verified that the test works:

./test/lint/all-lint.py
BOOST_ASSERT must be replaced with Assert, BOOST_REQUIRE, or BOOST_CHECK.
src/wallet/test/db_tests.cpp:                BOOST_ASSERT(status == DatabaseCursor::Status::MORE);

^---- failure generated from lint-assertions.py

Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 28fff06

@fanquake fanquake merged commit 2880bb5 into bitcoin:master Jun 22, 2023
15 checks passed
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 22, 2023
28fff06 test: Make linter to look for `BOOST_ASSERT` macros (Hennadii Stepanov)
47fe551 test: Kill `BOOST_ASSERT` (Hennadii Stepanov)

Pull request description:

  One of the goals of bitcoin#27783 was to get rid of the `BOOST_ASSERT` macros instead of including the `boost/assert.hpp` headers. See bitcoin#27783 (comment).

  It turns out that a couple of those macros sneaked into the codebase in bitcoin#27790.

  This PR makes the linter guard against new instances of the `BOOST_ASSERT` macros and replaces the current ones.

ACKs for top commit:
  kevkevinpal:
    ACK [28fff06](bitcoin@28fff06)
  stickies-v:
    ACK 28fff06
  TheCharlatan:
    ACK 28fff06

Tree-SHA512: 371f613592cf677afe0196d18c83943c6c8f1e998f57b4ff3ee58bfeff8636e4dac1357840d8611b4f7b197def94df10fe1a8ca3282b00b7b4eff4624552dda8
@hebasto hebasto deleted the 230614-assert branch June 23, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants