diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 1b7c14d361..4f7f268a2d 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -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 \ diff --git a/src/test/deploymentinfo_tests.cpp b/src/test/deploymentinfo_tests.cpp new file mode 100644 index 0000000000..f51898e2f5 --- /dev/null +++ b/src/test/deploymentinfo_tests.cpp @@ -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 + +#include + +#include + +#include + +BOOST_AUTO_TEST_SUITE(deploymentinfo_tests) + +BOOST_AUTO_TEST_CASE(versionbits_deployment_names_are_complete) +{ + for (int i = 0; i < static_cast(Consensus::MAX_VERSION_BITS_DEPLOYMENTS); ++i) { + const auto deployment = static_cast(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()