[kea-dev] Missing boost header file in 3.0.2
Francis Dupont
fdupont at isc.org
Wed Dec 31 22:52:45 UTC 2025
diff --git a/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc b/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc
index 2edabfe207..78c5a8c05b 100644
--- a/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc
+++ b/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc
@@ -59,8 +59,10 @@ DnsServer::DnsServer(const string& id, const set<string>& domains,
rekey_interval_(DEFAULT_REKEY_INTERVAL),
retry_interval_(DEFAULT_RETRY_INTERVAL), tkey_proto_(IOFetch::TCP),
fallback_(false), exchange_timeout_(DEFAULT_EXCHANGE_TIMEOUT), timer_() {
- BOOST_STATIC_ASSERT(DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME);
- BOOST_STATIC_ASSERT(DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL);
+ static_assert(DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME,
+ "DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME");
+ static_assert(DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL,
+ "DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL");
initStats();
}
diff --git a/src/hooks/dhcp/mysql/mysql_host_data_source.cc b/src/hooks/dhcp/mysql/mysql_host_data_source.cc
index ae0fa1db9a..6d5aca4fdf 100644
--- a/src/hooks/dhcp/mysql/mysql_host_data_source.cc
+++ b/src/hooks/dhcp/mysql/mysql_host_data_source.cc
@@ -31,7 +31,6 @@
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <boost/pointer_cast.hpp>
-#include <boost/static_assert.hpp>
#include <mysql.h>
#include <mysqld_error.h>
@@ -170,7 +169,7 @@ public:
columns_[DHCP4_BOOT_FILE_NAME_COL] = "dhcp4_boot_file_name";
columns_[AUTH_KEY_COL] = "auth_key";
- BOOST_STATIC_ASSERT(13 < HOST_COLUMNS);
+ static_assert(13 < HOST_COLUMNS, "13 < HOST_COLUMNS");
}
/// @brief Virtual destructor.
@@ -1761,7 +1760,7 @@ public:
columns_[5] = "excluded_prefix";
columns_[6] = "excluded_prefix_len";
- BOOST_STATIC_ASSERT(6 < RESRV_COLUMNS);
+ static_assert(6 < RESRV_COLUMNS, "6 < RESRV_COLUMNS");
}
/// @brief Create MYSQL_BIND objects for IPv6 Reservation.
@@ -1945,7 +1944,7 @@ public:
subnet_id_(SUBNET_ID_UNUSED),
host_id_(0), option_() {
- BOOST_STATIC_ASSERT(11 <= OPTION_COLUMNS);
+ static_assert(11 <= OPTION_COLUMNS, "11 <= OPTION_COLUMNS");
}
/// @brief Creates binding array to insert option data into database.
diff --git a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc
index e7d4d81725..7021efe728 100644
--- a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc
+++ b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc
@@ -22,7 +22,6 @@
#include <boost/array.hpp>
#include <boost/make_shared.hpp>
-#include <boost/static_assert.hpp>
#include <mysqld_error.h>
#include <ctime>
@@ -700,7 +699,7 @@ public:
columns_[RELAY_ID_COL] = "relay_id";
columns_[REMOTE_ID_COL] = "remote_id";
columns_[POOL_ID_COL] = "pool_id";
- BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS);
+ static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS");
}
/// @brief Create MYSQL_BIND objects for Lease4 Pointer
@@ -923,7 +922,7 @@ public:
setErrorIndicators(bind_, error_, LEASE_COLUMNS);
// .. and check that we have the numbers correct at compile time.
- BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS);
+ static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS");
} catch (const std::exception& ex) {
isc_throw(DbOperationError,
@@ -1066,7 +1065,7 @@ public:
setErrorIndicators(bind_, error_, LEASE_COLUMNS);
// .. and check that we have the numbers correct at compile time.
- BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS);
+ static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS");
// Add the data to the vector. Note the end element is one after the
// end of the array.
@@ -1292,7 +1291,7 @@ public:
columns_[STATE_COL] = "state";
columns_[USER_CONTEXT_COL] = "user_context";
columns_[POOL_ID_COL] = "pool_id";
- BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS);
+ static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS");
}
/// @brief Create MYSQL_BIND objects for Lease6 Pointer
@@ -1536,7 +1535,7 @@ public:
setErrorIndicators(bind_, error_, LEASE_COLUMNS);
// .. and check that we have the numbers correct at compile time.
- BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS);
+ static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS");
} catch (const std::exception& ex) {
isc_throw(DbOperationError,
@@ -1702,7 +1701,7 @@ public:
setErrorIndicators(bind_, error_, LEASE_COLUMNS);
// .. and check that we have the numbers correct at compile time.
- BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS);
+ static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS");
// Add the data to the vector. Note the end element is one after the
// end of the array.
diff --git a/src/hooks/dhcp/mysql/mysql_legal_log.cc b/src/hooks/dhcp/mysql/mysql_legal_log.cc
index 559e36a247..d7e4720127 100644
--- a/src/hooks/dhcp/mysql/mysql_legal_log.cc
+++ b/src/hooks/dhcp/mysql/mysql_legal_log.cc
@@ -15,7 +15,6 @@
#include <util/multi_threading_mgr.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <mysqld_error.h>
#include <iomanip>
@@ -62,7 +61,7 @@ public:
// Set the column names (for error messages)
columns_[0] = "address";
columns_[1] = "log";
- BOOST_STATIC_ASSERT(1 < LOG_COLUMNS);
+ static_assert(1 < LOG_COLUMNS, "1 < LOG_COLUMNS");
}
/// @brief Destructor
@@ -183,7 +182,7 @@ public:
setErrorIndicators(bind_, error_, LOG_COLUMNS);
// .. and check that we have the numbers correct at compile time.
- BOOST_STATIC_ASSERT(1 < LOG_COLUMNS);
+ static_assert(1 < LOG_COLUMNS, "1 < LOG_COLUMNS");
} catch (const std::exception& ex) {
isc_throw(DbOperationError,
diff --git a/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc b/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc
index 12fc2d05a6..22e3a4c22e 100644
--- a/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc
+++ b/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc
@@ -30,7 +30,6 @@
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <boost/pointer_cast.hpp>
-#include <boost/static_assert.hpp>
#include <stdint.h>
@@ -140,7 +139,7 @@ public:
columns_[DHCP4_BOOT_FILE_NAME_COL] = "dhcp4_boot_file_name";
columns_[AUTH_KEY_COL] = "auth_key";
- BOOST_STATIC_ASSERT(12 < HOST_COLUMNS);
+ static_assert(12 < HOST_COLUMNS, "12 < HOST_COLUMNS");
};
/// @brief Virtual destructor.
@@ -966,7 +965,7 @@ public:
columns_[excluded_prefix_index_] = "excluded_prefix";
columns_[excluded_prefix_len_index_] = "excluded_prefix_len";
- BOOST_STATIC_ASSERT(6 < RESERVATION_COLUMNS);
+ static_assert(6 < RESERVATION_COLUMNS, "6 < RESERVATION_COLUMNS");
}
/// @brief Reinitializes state information
@@ -1150,7 +1149,7 @@ public:
columns_[5] = "excluded_prefix";
columns_[6] = "excluded_prefix_len";
- BOOST_STATIC_ASSERT(7 < RESRV_COLUMNS);
+ static_assert(7 < RESRV_COLUMNS, "7 < RESRV_COLUMNS");
}
/// @brief Populate a bind array representing an IPv6 reservation
@@ -1268,7 +1267,7 @@ public:
columns_[DHCP_SUBNET_ID_COL] = "dhcp_subnet_id";
columns_[HOST_ID_COL] = "host_id";
- BOOST_STATIC_ASSERT(11 <= OPTION_COLUMNS);
+ static_assert(11 <= OPTION_COLUMNS, "11 <= OPTION_COLUMNS");
}
/// @brief Creates binding array to insert option data into database.
diff --git a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc
index 02c8e7aab2..887029e10a 100644
--- a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc
+++ b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc
@@ -21,7 +21,6 @@
#include <util/multi_threading_mgr.h>
#include <boost/make_shared.hpp>
-#include <boost/static_assert.hpp>
#include <iomanip>
#include <limits>
@@ -780,7 +779,7 @@ public:
: lease_(), addr4_(0), client_id_length_(0),
relay_id_length_(0), remote_id_length_(0) {
- BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS);
+ static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS");
memset(hwaddr_buffer_, 0, sizeof(hwaddr_buffer_));
memset(client_id_buffer_, 0, sizeof(client_id_buffer_));
@@ -1082,7 +1081,7 @@ public:
preferred_lifetime_str_(""), hwtype_(0), hwtype_str_(""),
hwaddr_source_(0), hwaddr_source_str_("") {
- BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS);
+ static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS");
memset(duid_buffer_, 0, sizeof(duid_buffer_));
diff --git a/src/hooks/dhcp/pgsql/pgsql_legal_log.cc b/src/hooks/dhcp/pgsql/pgsql_legal_log.cc
index 5b4aef5cdf..2599cff069 100644
--- a/src/hooks/dhcp/pgsql/pgsql_legal_log.cc
+++ b/src/hooks/dhcp/pgsql/pgsql_legal_log.cc
@@ -14,8 +14,6 @@
#include <dhcpsrv/timer_mgr.h>
#include <util/multi_threading_mgr.h>
-#include <boost/static_assert.hpp>
-
#include <iomanip>
#include <limits>
#include <sstream>
@@ -65,7 +63,7 @@ public:
/// @brief Constructor
PgSqlLegLExchange() : address_(""), log_("") {
- BOOST_STATIC_ASSERT(0 < LOG_COLUMNS);
+ static_assert(0 < LOG_COLUMNS, "0 < LOG_COLUMNS");
// Set the column names (for error messages)
columns_.push_back("log");
diff --git a/src/lib/asiodns/io_fetch.cc b/src/lib/asiodns/io_fetch.cc
index c140676f66..24b1761d7b 100644
--- a/src/lib/asiodns/io_fetch.cc
+++ b/src/lib/asiodns/io_fetch.cc
@@ -25,6 +25,7 @@
#include <boost/scoped_ptr.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <chrono>
#include <functional>
#include <unistd.h> // for some IPC/network system calls
#include <netinet/in.h>
@@ -67,7 +68,7 @@ struct IOFetchData : boost::noncopyable {
OutputBufferPtr msgbuf; // Wire buffer for question
OutputBufferPtr received; // Received data put here
IOFetch::Callback* callback; // Called on I/O Completion
- boost::asio::deadline_timer timer; // Timer to measure timeouts
+ boost::asio::system_timer timer; // Timer to measure timeouts
IOFetch::Protocol protocol; // Protocol being used
size_t cumulative; // Cumulative received amount
size_t expected; // Expected amount of data
@@ -227,7 +228,7 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
// If we timeout, we stop, which cancels outstanding I/O operations and
// shuts down everything.
if (data_->timeout != -1) {
- data_->timer.expires_from_now(boost::posix_time::milliseconds(
+ data_->timer.expires_after(std::chrono::milliseconds(
data_->timeout));
data_->timer.async_wait(std::bind(&IOFetch::stop, *this,
TIME_OUT));
diff --git a/src/lib/asiodns/io_fetch.h b/src/lib/asiodns/io_fetch.h
index e9c85b58c5..bd5fc1d9ad 100644
--- a/src/lib/asiodns/io_fetch.h
+++ b/src/lib/asiodns/io_fetch.h
@@ -16,7 +16,7 @@
#include <util/buffer.h>
#include <boost/asio/coroutine.hpp>
-#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/system_timer.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc
index 7b4cd0568e..045678f51b 100644
--- a/src/lib/asiodns/tests/io_fetch_unittest.cc
+++ b/src/lib/asiodns/tests/io_fetch_unittest.cc
@@ -23,6 +23,7 @@
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <algorithm>
+#include <chrono>
#include <cstdlib>
#include <functional>
#include <string>
@@ -66,7 +67,7 @@ public:
IOFetch tcp_fetch_; ///< For TCP query test
IOFetch::Protocol protocol_; ///< Protocol being tested
size_t cumulative_; ///< Cumulative data received by "server".
- deadline_timer timer_; ///< Timer to measure timeouts
+ system_timer timer_; ///< Timer to measure timeouts
// The next member is the buffer in which the "server" (implemented by the
// response handler methods in this class) receives the question sent by the
@@ -431,7 +432,7 @@ public:
// tcpSendData, which will then send the next chunk. We pass the
// socket over which data should be sent as an argument to that
// function.
- timer_.expires_from_now(boost::posix_time::milliseconds(SEND_INTERVAL));
+ timer_.expires_after(std::chrono::milliseconds(SEND_INTERVAL));
timer_.async_wait(std::bind(&IOFetchTest::tcpSendData, this,
socket));
}
diff --git a/src/lib/asiolink/interval_timer.cc b/src/lib/asiolink/interval_timer.cc
index fa0d9e1b67..4c5902b8d2 100644
--- a/src/lib/asiolink/interval_timer.cc
+++ b/src/lib/asiolink/interval_timer.cc
@@ -16,6 +16,7 @@
#include <exceptions/exceptions.h>
#include <atomic>
+#include <chrono>
#include <functional>
#include <mutex>
@@ -88,7 +89,7 @@ private:
IOServicePtr io_service_;
/// @brief The asio timer.
- boost::asio::deadline_timer timer_;
+ boost::asio::system_timer timer_;
/// @brief Controls how the timer behaves after expiration.
IntervalTimer::Mode mode_;
@@ -141,7 +142,7 @@ void
IntervalTimerImpl::update() {
try {
// Update expire time to (current time + interval_).
- timer_.expires_from_now(boost::posix_time::millisec(long(interval_)));
+ timer_.expires_after(std::chrono::milliseconds(interval_));
// Reset timer.
// Pass a function bound with a shared_ptr to this.
timer_.async_wait(std::bind(&IntervalTimerImpl::callback,
diff --git a/src/lib/asiolink/interval_timer.h b/src/lib/asiolink/interval_timer.h
index d340481e94..24f735deb8 100644
--- a/src/lib/asiolink/interval_timer.h
+++ b/src/lib/asiolink/interval_timer.h
@@ -11,7 +11,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif
-#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/system_timer.hpp>
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
@@ -27,9 +27,9 @@ namespace asiolink {
class IntervalTimerImpl;
/// \brief The \c IntervalTimer class is a wrapper for the ASIO
-/// \c boost::asio::deadline_timer class.
+/// \c boost::asio::system_timer class.
///
-/// This class is implemented to use \c boost::asio::deadline_timer as interval
+/// This class is implemented to use \c boost::asio::system_timer as interval
/// timer.
///
/// \c setup() sets a timer to expire on (now + interval), a call back
@@ -96,7 +96,7 @@ public:
/// This destructor never throws an exception.
///
/// On the destruction of this class the timer will be canceled
- /// inside \c boost::asio::deadline_timer.
+ /// inside \c boost::asio::system_timer.
~IntervalTimer();
//@}
diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc
index e912f0f398..bbc96b15cd 100644
--- a/src/lib/asiolink/io_address.cc
+++ b/src/lib/asiolink/io_address.cc
@@ -10,7 +10,6 @@
#include <asiolink/io_error.h>
#include <exceptions/exceptions.h>
-#include <boost/static_assert.hpp>
// moved to container_hash on recent boost versions (backward compatible)
#include <boost/functional/hash.hpp>
@@ -71,7 +70,8 @@ IOAddress::fromBytes(short family, const uint8_t* data) {
<< "are supported");
}
- BOOST_STATIC_ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+ static_assert(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN,
+ "INET6_ADDRSTRLEN >= INET_ADDRSTRLEN");
char addr_str[INET6_ADDRSTRLEN];
inet_ntop(family, data, addr_str, INET6_ADDRSTRLEN);
return IOAddress(string(addr_str));
diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc
index d49518c7fb..89dd65d6ff 100644
--- a/src/lib/dhcp/iface_mgr_linux.cc
+++ b/src/lib/dhcp/iface_mgr_linux.cc
@@ -32,7 +32,6 @@
#include <util/io/sockaddr_util.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <fcntl.h>
#include <stdint.h>
@@ -45,7 +44,7 @@ using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::util::io::internal;
-BOOST_STATIC_ASSERT(IFLA_MAX>=IFA_MAX);
+static_assert(IFLA_MAX>=IFA_MAX, "IFLA_MAX>=IFA_MAX");
namespace {
@@ -180,7 +179,8 @@ void Netlink::rtnl_send_request(int family, int type) {
struct sockaddr_nl nladdr;
// do a sanity check. Verify that Req structure is aligned properly
- BOOST_STATIC_ASSERT(sizeof(nlmsghdr) == offsetof(Req, generic));
+ static_assert(sizeof(nlmsghdr) == offsetof(Req, generic),
+ "sizeof(nlmsghdr) == offsetof(Req, generic)");
memset(&nladdr, 0, sizeof(nladdr));
nladdr.nl_family = AF_NETLINK;
diff --git a/src/lib/dhcp/protocol_util.cc b/src/lib/dhcp/protocol_util.cc
index da701045c8..f3bc355fa8 100644
--- a/src/lib/dhcp/protocol_util.cc
+++ b/src/lib/dhcp/protocol_util.cc
@@ -8,7 +8,6 @@
#include <asiolink/io_address.h>
#include <dhcp/dhcp6.h>
#include <dhcp/protocol_util.h>
-#include <boost/static_assert.hpp>
// in_systm.h is required on some some BSD systems
// complaining that n_time is undefined but used
// in ip.h.
@@ -41,7 +40,8 @@ decodeEthernetHeader(InputBuffer& buf, Pkt4Ptr& pkt) {
// The size of the single address is always lower then the size of
// the header that holds this address. Otherwise, it is a programming
// error that we want to detect in the compilation time.
- BOOST_STATIC_ASSERT(ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN);
+ static_assert(ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN,
+ "ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN");
// Remember initial position.
size_t start_pos = buf.getPosition();
@@ -76,7 +76,8 @@ decodeIpUdpHeader(InputBuffer& buf, Pkt4Ptr& pkt) {
" packet headers");
}
- BOOST_STATIC_ASSERT(IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN);
+ static_assert(IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN,
+ "IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN");
// Remember initial position of the read pointer.
size_t start_pos = buf.getPosition();
diff --git a/src/lib/dhcp/tests/pkt4_unittest.cc b/src/lib/dhcp/tests/pkt4_unittest.cc
index 72f0da76a7..49d1f11153 100644
--- a/src/lib/dhcp/tests/pkt4_unittest.cc
+++ b/src/lib/dhcp/tests/pkt4_unittest.cc
@@ -25,7 +25,6 @@
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <gtest/gtest.h>
#include <iostream>
@@ -87,9 +86,10 @@ const uint8_t dummyFile[] = "Lorem ipsum dolor sit amet, consectetur "
const uint8_t dummySname[] = "Lorem ipsum dolor sit amet, consectetur "
"adipiscing elit posuere.";
-BOOST_STATIC_ASSERT(sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1);
-BOOST_STATIC_ASSERT(sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1);
-
+static_assert(sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1,
+ "sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1");
+static_assert(sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1,
+ "sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1");
class Pkt4Test : public ::testing::Test {
public:
diff --git a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
index 231266c50b..ea1d4d36cb 100644
--- a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
+++ b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
@@ -13,7 +13,6 @@
#include <hooks/hooks_manager.h>
#include <stats/stats_mgr.h>
#include <gtest/gtest.h>
-#include <boost/static_assert.hpp>
#include <functional>
#include <iomanip>
#include <sstream>
@@ -701,7 +700,8 @@ public:
// Hence, it is convenient if the number of test leases is a
// multiple of 10.
const size_t reclamation_group_size = 10;
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM % reclamation_group_size == 0);
+ static_assert(TEST_LEASES_NUM % reclamation_group_size == 0,
+ "TEST_LEASES_NUM % reclamation_group_size == 0");
// Leases will be reclaimed in groups of 10.
for (unsigned int i = reclamation_group_size; i < TEST_LEASES_NUM;
@@ -770,7 +770,8 @@ public:
}
const size_t reclamation_group_size = 10;
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM % reclamation_group_size == 0);
+ static_assert(TEST_LEASES_NUM % reclamation_group_size == 0,
+ "TEST_LEASES_NUM % reclamation_group_size == 0");
// Leases will be reclaimed in groups of 10
for (unsigned int i = 10; i < TEST_LEASES_NUM; i += reclamation_group_size) {
@@ -1457,7 +1458,7 @@ ExpirationAllocEngine6Test::setLeaseType(const uint16_t lease_index,
void
ExpirationAllocEngine6Test::testReclaimExpiredLeasesStats() {
// This test requires that the number of leases is an even number.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0);
+ static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0");
for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) {
// Mark all leases as expired. The higher the index the less
@@ -1496,7 +1497,7 @@ ExpirationAllocEngine6Test::testReclaimExpiredLeasesStats() {
void
ExpirationAllocEngine6Test::testReclaimReusedLeases(const uint16_t msg_type,
const bool use_reclaimed) {
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM < 1000);
+ static_assert(TEST_LEASES_NUM < 1000, "TEST_LEASES_NUM < 1000");
for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) {
// Depending on the parameter, mark leases 'expired-reclaimed' or
@@ -1604,7 +1605,7 @@ ExpirationAllocEngine6Test::testReclaimDeclinedHook(bool skip) {
void
ExpirationAllocEngine6Test::testReclaimExpiredLeasesRegisteredStats() {
// This test requires that the number of leases is an even number.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0);
+ static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0");
for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) {
// Mark all leases as expired. The higher the index the less
@@ -1700,7 +1701,8 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesHooksWithSkip) {
// execution of the lease reclamation routine.
TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesTimeout) {
// This test needs at least 40 leases to make sense.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40);
+ static_assert(TEST_LEASES_NUM >= 40, "TEST_LEASES_NUM >= 40");
+
// Run with timeout of 1.2s.
testReclaimExpiredLeasesTimeout(1200);
}
@@ -1712,7 +1714,7 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesTimeout) {
// reclamation.
TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesShortTimeout) {
// We will most likely reclaim just one lease, so 5 is more than enough.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 5);
+ static_assert(TEST_LEASES_NUM >= 5, "TEST_LEASES_NUM >= 5");
// Reclaim leases with the 1ms timeout.
testReclaimExpiredLeasesTimeout(1);
}
@@ -1720,7 +1722,7 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesShortTimeout) {
// This test verifies that expired-reclaimed leases are removed from the
// lease database.
TEST_F(ExpirationAllocEngine6Test, deleteExpiredReclaimedLeases) {
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 10);
+ static_assert(TEST_LEASES_NUM >= 10, "TEST_LEASES_NUM >= 10");
testDeleteExpiredReclaimedLeases();
}
@@ -2178,7 +2180,7 @@ ExpirationAllocEngine4Test::testReclaimExpiredLeasesWithDDNSAndClientId() {
void
ExpirationAllocEngine4Test::testReclaimExpiredLeasesStats() {
// This test requires that the number of leases is an even number.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0);
+ static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0");
for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) {
// Mark all leases as expired. The higher the index the less
@@ -2217,7 +2219,7 @@ ExpirationAllocEngine4Test::testReclaimReusedLeases(const uint8_t msg_type,
const bool client_renews,
const bool use_reclaimed) {
// Let's restrict the number of leases.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM < 1000);
+ static_assert(TEST_LEASES_NUM < 1000, "TEST_LEASES_NUM < 1000");
for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) {
// Depending on the parameter, mark leases 'expired-reclaimed' or
@@ -2391,7 +2393,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesHooksWithSkip) {
// execution of the lease reclamation routine.
TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesTimeout) {
// This test needs at least 40 leases to make sense.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40);
+ static_assert(TEST_LEASES_NUM >= 40, "TEST_LEASES_NUM >= 40");
// Run with timeout of 1.2s.
testReclaimExpiredLeasesTimeout(1200);
}
@@ -2403,7 +2405,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesTimeout) {
// reclamation.
TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesShortTimeout) {
// We will most likely reclaim just one lease, so 5 is more than enough.
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 5);
+ static_assert(TEST_LEASES_NUM >= 5, "TEST_LEASES_NUM >= 5");
// Reclaim leases with the 1ms timeout.
testReclaimExpiredLeasesTimeout(1);
}
@@ -2411,7 +2413,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesShortTimeout) {
// This test verifies that expired-reclaimed leases are removed from the
// lease database.
TEST_F(ExpirationAllocEngine4Test, deleteExpiredReclaimedLeases) {
- BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 10);
+ static_assert(TEST_LEASES_NUM >= 10, "TEST_LEASES_NUM >= 10");
testDeleteExpiredReclaimedLeases();
}
diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc
index 4e1dfeaa8b..5c9cc3674f 100644
--- a/src/lib/dns/messagerenderer.cc
+++ b/src/lib/dns/messagerenderer.cc
@@ -15,7 +15,6 @@
#include <util/buffer.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <limits>
#include <cassert>
#include <vector>
diff --git a/src/lib/dns/rdataclass.cc b/src/lib/dns/rdataclass.cc
index 1bf515cb0d..79dc09466d 100644
--- a/src/lib/dns/rdataclass.cc
+++ b/src/lib/dns/rdataclass.cc
@@ -1398,8 +1398,9 @@ SOA::getSerial() const {
uint32_t
SOA::getMinimum() const {
// Make sure the buffer access is safe.
- BOOST_STATIC_ASSERT(sizeof(numdata_) ==
- sizeof(uint32_t) * 4 + sizeof(uint32_t));
+ static_assert(
+ sizeof(numdata_) == sizeof(uint32_t) * 4 + sizeof(uint32_t),
+ "sizeof(numdata_) == sizeof(uint32_t) * 4 + sizeof(uint32_t)");
InputBuffer b(&numdata_[sizeof(uint32_t) * 4], sizeof(uint32_t));
return (b.readUint32());
diff --git a/src/lib/hooks/callout_manager.cc b/src/lib/hooks/callout_manager.cc
index fbf4b90a19..7c30b08097 100644
--- a/src/lib/hooks/callout_manager.cc
+++ b/src/lib/hooks/callout_manager.cc
@@ -12,8 +12,6 @@
#include <hooks/pointer_converter.h>
#include <util/stopwatch.h>
-#include <boost/static_assert.hpp>
-
#include <algorithm>
#include <climits>
#include <functional>
diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc
index 1718f303c9..fe2c3afe56 100644
--- a/src/lib/log/logger_impl.cc
+++ b/src/lib/log/logger_impl.cc
@@ -17,7 +17,6 @@
#include <boost/make_shared.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/static_assert.hpp>
#include <boost/algorithm/string.hpp>
#include <log4cplus/configurator.h>
diff --git a/src/lib/log/logger_level_impl.cc b/src/lib/log/logger_level_impl.cc
index a4aba73a20..a6a4fdd40d 100644
--- a/src/lib/log/logger_level_impl.cc
+++ b/src/lib/log/logger_level_impl.cc
@@ -44,13 +44,20 @@ LoggerLevelImpl::convertFromBindLevel(const Level& level) {
};
// ... with compile-time checks to ensure that table indexes are correct.
- BOOST_STATIC_ASSERT(static_cast<int>(DEFAULT) == 0);
- BOOST_STATIC_ASSERT(static_cast<int>(DEBUG) == 1);
- BOOST_STATIC_ASSERT(static_cast<int>(INFO) == 2);
- BOOST_STATIC_ASSERT(static_cast<int>(WARN) == 3);
- BOOST_STATIC_ASSERT(static_cast<int>(ERROR) == 4);
- BOOST_STATIC_ASSERT(static_cast<int>(FATAL) == 5);
- BOOST_STATIC_ASSERT(static_cast<int>(NONE) == 6);
+ static_assert(static_cast<int>(DEFAULT) == 0,
+ "static_cast<int>(DEFAULT) == 0");
+ static_assert(static_cast<int>(DEBUG) == 1,
+ "static_cast<int>(DEBUG) == 1");
+ static_assert(static_cast<int>(INFO) == 2,
+ "static_cast<int>(INFO) == 2");
+ static_assert(static_cast<int>(WARN) == 3,
+ "static_cast<int>(WARN) == 3");
+ static_assert(static_cast<int>(ERROR) == 4,
+ "static_cast<int>(ERROR) == 4");
+ static_assert(static_cast<int>(FATAL) == 5,
+ "static_cast<int>(FATAL) == 5");
+ static_assert(static_cast<int>(NONE) == 6,
+ "static_cast<int>(NONE) == 6");
// Do the conversion
if (level.severity == DEBUG) {
diff --git a/src/lib/log/tests/logger_level_impl_unittest.cc b/src/lib/log/tests/logger_level_impl_unittest.cc
index c82be69b17..d9375ee09c 100644
--- a/src/lib/log/tests/logger_level_impl_unittest.cc
+++ b/src/lib/log/tests/logger_level_impl_unittest.cc
@@ -10,7 +10,6 @@
#include <string>
#include <gtest/gtest.h>
-#include <boost/static_assert.hpp>
#include <boost/lexical_cast.hpp>
#include <log/logger_level_impl.h>
@@ -109,7 +108,7 @@ TEST_F(LoggerLevelImplTest, ConversionToBind) {
// ... and some invalid valid values
test_convert_to("DEBUG-1", INFO, MIN_DEBUG_LEVEL,
(log4cplus::DEBUG_LOG_LEVEL + 1));
- BOOST_STATIC_ASSERT(MAX_DEBUG_LEVEL == 99);
+ static_assert(MAX_DEBUG_LEVEL == 99, "MAX_DEBUG_LEVEL == 99");
test_convert_to("DEBUG+100", DEFAULT, 0,
(log4cplus::DEBUG_LOG_LEVEL - MAX_DEBUG_LEVEL - 1));
}
More information about the kea-dev
mailing list