Skip to content

Commit 132d98a

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#26229: test: Use proper Boost macros instead of assertions
5c9a27a 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
2 parents 6c5ef5d + 5c9a27a commit 132d98a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/banman_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ BOOST_AUTO_TEST_CASE(file)
2727
" { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"1.0.0.0/8\" }"
2828
"] }",
2929
};
30-
assert(WriteBinaryFile(banlist_path + ".json", entries_write));
30+
BOOST_REQUIRE(WriteBinaryFile(banlist_path + ".json", entries_write));
3131
{
3232
// The invalid entries will be dropped, but the valid one remains
3333
ASSERT_DEBUG_LOG("Dropping entry with unparseable address or subnet (aaaaaaaaa) from ban list");
3434
ASSERT_DEBUG_LOG("Dropping entry with unknown version (2) from ban list");
3535
BanMan banman{banlist_path, /*client_interface=*/nullptr, /*default_ban_time=*/0};
3636
banmap_t entries_read;
3737
banman.GetBanned(entries_read);
38-
assert(entries_read.size() == 1);
38+
BOOST_CHECK_EQUAL(entries_read.size(), 1);
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)