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();
}
#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>
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.
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.
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.
#include <boost/array.hpp>
#include <boost/make_shared.hpp>
-#include <boost/static_assert.hpp>
#include <mysqld_error.h>
#include <ctime>
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
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,
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.
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
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,
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.
#include <util/multi_threading_mgr.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <mysqld_error.h>
#include <iomanip>
// 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
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,
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <boost/pointer_cast.hpp>
-#include <boost/static_assert.hpp>
#include <stdint.h>
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.
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
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
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.
#include <util/multi_threading_mgr.h>
#include <boost/make_shared.hpp>
-#include <boost/static_assert.hpp>
#include <iomanip>
#include <limits>
: 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_));
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_));
#include <dhcpsrv/timer_mgr.h>
#include <util/multi_threading_mgr.h>
-#include <boost/static_assert.hpp>
-
#include <iomanip>
#include <limits>
#include <sstream>
/// @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");
#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>
<< "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));
#include <util/io/sockaddr_util.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <fcntl.h>
#include <stdint.h>
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 {
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;
#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.
// 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();
" 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();
#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>
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:
#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>
// 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;
}
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) {
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
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
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
// 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);
}
// 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);
}
// 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();
}
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
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
// 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);
}
// 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);
}
// 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();
}
#include <util/buffer.h>
#include <boost/array.hpp>
-#include <boost/static_assert.hpp>
#include <limits>
#include <cassert>
#include <vector>
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());
#include <hooks/pointer_converter.h>
#include <util/stopwatch.h>
-#include <boost/static_assert.hpp>
-
#include <algorithm>
#include <climits>
#include <functional>
#include <boost/make_shared.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/static_assert.hpp>
#include <boost/algorithm/string.hpp>
#include <log4cplus/configurator.h>
};
// ... 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) {
#include <string>
#include <gtest/gtest.h>
-#include <boost/static_assert.hpp>
#include <boost/lexical_cast.hpp>
#include <log/logger_level_impl.h>
// ... 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));
}