Skip to content

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
@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

@sedited sedited 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
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
@bitcoin bitcoin locked and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants