test: Use proper Boost macros instead of assertions

This commit is contained in:
Hennadii Stepanov 2022-10-03 00:00:31 +01:00
parent 93001b16a4
commit 5c9a27a46f
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -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);
}
}
}