mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Merge bitcoin/bitcoin#26229: test: Use proper Boost macros instead of assertions
5c9a27a46f
test: Use proper Boost macros instead of assertions (Hennadii Stepanov)
Pull request description:
On the master branch:
```
$ src/test/test_bitcoin -l test_suite -t banman_tests
Running 1 test case...
...
Test case banman_tests/file did not check any assertions
...
```
This PR suggests to use proper Boost [macros](https://www.boost.org/doc/libs/1_80_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref.html).
Top commit has no ACKs.
Tree-SHA512: e0c8e5e6371acd0e0a80070fffdf1445f264c62499f8d9811822994c89735a913c18c8ed730495578400abdd93d2d500345504f2a9246401d53fb2f9f71be8c5
This commit is contained in:
commit
132d98a0a6
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE(file)
|
|||
" { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"1.0.0.0/8\" }"
|
||||
"] }",
|
||||
};
|
||||
assert(WriteBinaryFile(banlist_path + ".json", entries_write));
|
||||
BOOST_REQUIRE(WriteBinaryFile(banlist_path + ".json", entries_write));
|
||||
{
|
||||
// The invalid entries will be dropped, but the valid one remains
|
||||
ASSERT_DEBUG_LOG("Dropping entry with unparseable address or subnet (aaaaaaaaa) from ban list");
|
||||
|
@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(file)
|
|||
BanMan banman{banlist_path, /*client_interface=*/nullptr, /*default_ban_time=*/0};
|
||||
banmap_t entries_read;
|
||||
banman.GetBanned(entries_read);
|
||||
assert(entries_read.size() == 1);
|
||||
BOOST_CHECK_EQUAL(entries_read.size(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue