]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4266] Replaced BOOST_STATIC_ASSERT
authorFrancis Dupont <fdupont@isc.org>
Mon, 15 Dec 2025 21:06:20 +0000 (22:06 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 5 Jan 2026 18:36:43 +0000 (19:36 +0100)
18 files changed:
src/hooks/d2/gss_tsig/gss_tsig_cfg.cc
src/hooks/dhcp/mysql/mysql_host_data_source.cc
src/hooks/dhcp/mysql/mysql_lease_mgr.cc
src/hooks/dhcp/mysql/mysql_legal_log.cc
src/hooks/dhcp/pgsql/pgsql_host_data_source.cc
src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc
src/hooks/dhcp/pgsql/pgsql_legal_log.cc
src/lib/asiolink/io_address.cc
src/lib/dhcp/iface_mgr_linux.cc
src/lib/dhcp/protocol_util.cc
src/lib/dhcp/tests/pkt4_unittest.cc
src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
src/lib/dns/messagerenderer.cc
src/lib/dns/rdataclass.cc
src/lib/hooks/callout_manager.cc
src/lib/log/logger_impl.cc
src/lib/log/logger_level_impl.cc
src/lib/log/tests/logger_level_impl_unittest.cc

index 2edabfe207ed52ed4b1b4088ae918c526bda64af..78c5a8c05b9e3c09db3bb20a397c1c705f187753 100644 (file)
@@ -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();
 }
 
index ae0fa1db9ac6e64f95861a25f48490bd0320b9e9..6d5aca4fdf66479dee6a8752298dc21c054255ee 100644 (file)
@@ -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.
index e7d4d817251a784eeb0f9400034d4e9776b8e73e..7021efe7287efb8ffc609577ca88a9e45f599068 100644 (file)
@@ -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.
index 559e36a247ad9aeb76bdd917346ba1c1eac61a82..d7e4720127b28678ea9272d8c66813ad3c9ff715 100644 (file)
@@ -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,
index 12fc2d05a6e002054cd19542e189b17f8baca7c3..22e3a4c22e1ca57656ef2efa42ab2186c1d7c438 100644 (file)
@@ -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.
index 02c8e7aab2af1d0d606985b78950f4c3004ff138..887029e10ae91c59c37e1a3a49a3284932a6a673 100644 (file)
@@ -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_));
 
index 5b4aef5cdf5ff9a6443f22424f0a6de554091144..2599cff069db3b02a7556abf7d550d84df9bcd91 100644 (file)
@@ -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");
index e912f0f398503e10bff5b4bd4c9468a7f1860da3..bbc96b15cd234c47d802c75a4e47569eb8ade68c 100644 (file)
@@ -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));
index d49518c7fb51a59c17cb5030dcf64d3027a992a3..89dd65d6ffad0ccaf9930876730796a91bb57e76 100644 (file)
@@ -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;
index da701045c8fc8f6413dc3a01c82970cf04c5b9cb..f3bc355fa8d05722bf0963fdba8cf0449c48c138 100644 (file)
@@ -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();
index 72f0da76a7ae75bb80cd611f34e0bad158f56b6f..49d1f11153a35d6b5ac2105cc4cb4e7652e3694f 100644 (file)
@@ -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:
index 231266c50b4be6aa35c1e818db3f6247a73bca6a..ea1d4d36cbfaecd870d1be9f9b3ef991ea2b84db 100644 (file)
@@ -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();
 }
 
index 4e1dfeaa8b0a2117acf898b618e692983883d932..5c9cc3674f87e058c269ef1cd9d801433b2f74c2 100644 (file)
@@ -15,7 +15,6 @@
 #include <util/buffer.h>
 
 #include <boost/array.hpp>
-#include <boost/static_assert.hpp>
 #include <limits>
 #include <cassert>
 #include <vector>
index 1bf515cb0da166345a028689f29cfa4f05a46b94..79dc09466dca75d9adf86b099d0ab89fc60a67a9 100644 (file)
@@ -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());
index fbf4b90a19d2dcbbbcdb05e544ca5bce10c00e6d..7c30b0809715c9bd468cee7e85a5b412fe130f88 100644 (file)
@@ -12,8 +12,6 @@
 #include <hooks/pointer_converter.h>
 #include <util/stopwatch.h>
 
-#include <boost/static_assert.hpp>
-
 #include <algorithm>
 #include <climits>
 #include <functional>
index 1718f303c972c5002fb570752c45811219caabf7..fe2c3afe564469f951b22a4f5810c8f725ea925b 100644 (file)
@@ -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>
index a4aba73a20bed765bbec5cab1678f97bfe60eb35..a6a4fdd40d72cf33bd1d808b12f5c3779cb3f485 100644 (file)
@@ -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) {
index c82be69b17f9db251058847322931aaa8ad003d2..d9375ee09cc3d4bfb7e081fedcad1d589408514a 100644 (file)
@@ -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));
 }