Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ BGL_TESTS =\
test/cuckoocache_tests.cpp \
test/dbwrapper_tests.cpp \
test/denialofservice_tests.cpp \
test/deploymentinfo_tests.cpp \
test/descriptor_tests.cpp \
test/disconnected_transactions.cpp \
test/flatfile_tests.cpp \
Expand Down
28 changes: 28 additions & 0 deletions src/test/deploymentinfo_tests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) 2026 The Bitgesell developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <deploymentinfo.h>

#include <consensus/params.h>

#include <boost/test/unit_test.hpp>

#include <string>

BOOST_AUTO_TEST_SUITE(deploymentinfo_tests)

BOOST_AUTO_TEST_CASE(versionbits_deployment_names_are_complete)
{
for (int i = 0; i < static_cast<int>(Consensus::MAX_VERSION_BITS_DEPLOYMENTS); ++i) {
const auto deployment = static_cast<Consensus::DeploymentPos>(i);
BOOST_REQUIRE(Consensus::ValidDeployment(deployment));

const char* const name = VersionBitsDeploymentInfo[deployment].name;
BOOST_REQUIRE_MESSAGE(name != nullptr, "missing deployment name at index " << i);
BOOST_CHECK_MESSAGE(!std::string{name}.empty(), "empty deployment name at index " << i);
BOOST_CHECK_EQUAL(DeploymentName(deployment), std::string{name});
}
}

BOOST_AUTO_TEST_SUITE_END()