]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3991] fixed more warnings
authorRazvan Becheriu <razvan@isc.org>
Tue, 26 May 2026 08:38:13 +0000 (11:38 +0300)
committerFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 20:03:02 +0000 (22:03 +0200)
src/lib/asiolink/testutils/test_server_unix_socket.cc
src/lib/dhcp/tests/opaque_data_tuple_unittest.cc
src/lib/dhcp/tests/option_vendor_class_unittest.cc
src/lib/dns/rdata.cc
src/lib/dns/tests/rdata_unittest.cc
src/lib/log/tests/logger_manager_unittest.cc
src/lib/util/buffer.h
src/lib/util/tests/state_model_unittest.cc

index 7fb181a74150f13d958b798ec69bf0836c7098d9..60cdee8fc07cfdebb223f12bb47a32bfb5d8f2b3 100644 (file)
@@ -49,7 +49,7 @@ public:
                const std::string custom_response,
                SentResponseCallback sent_response_callback)
         : socket_(unix_socket), custom_response_(custom_response),
-          sent_response_callback_(sent_response_callback) {
+          raw_buf_(), sent_response_callback_(sent_response_callback) {
     }
 
     /// @brief Starts asynchronous read from the socket.
index 47c7e1503b812f625a1b5d99426642f10f23a9ae..e667d51812f631b19b209c5de1e58dbb9e7adafa 100644 (file)
@@ -22,6 +22,10 @@ using namespace isc::util;
 namespace {
 
 struct OpaqueDataTupleLenientParsing : ::testing::Test {
+
+    /// @brief Constructor.
+    OpaqueDataTupleLenientParsing() : previous_(true) { }
+
     void SetUp() override {
         // Retain the current setting for future restoration.
         previous_ = Option::lenient_parsing_;
index b867c0520d79572d6244272842107ae951f8691f..9aff556639e13128f8ad7cccef79459673d0fb4b 100644 (file)
@@ -19,6 +19,10 @@ using namespace isc::util;
 namespace {
 
 struct OptionVendorClassLenientParsing : ::testing::Test {
+
+    /// @brief Constructor.
+    OptionVendorClassLenientParsing() : previous_(true) { }
+
     void SetUp() override {
         // Retain the current setting for future restoration.
         previous_ = Option::lenient_parsing_;
index fec5d2d97e1e3728df296fa0b63b5aa25f0e16ed..40765a455155f6a78d9ea976af742a607262fe59 100644 (file)
@@ -333,7 +333,7 @@ Generic::toText() const {
     ostringstream oss;
 
     oss << "\\# " << impl_->data_.size() << " ";
-    oss.fill('0');
+    (void)oss.fill('0');
     oss << right << hex;
     for_each(impl_->data_.begin(), impl_->data_.end(), UnknownRdataDumper(oss));
 
index c43a0abdd77b97d7155bf543a5b934b082511c0d..c562fe9b7319edaacf65c50f838248683689759b 100644 (file)
@@ -256,7 +256,7 @@ Rdata_Unknown_Test::getLongestRdataTxt() {
     ostringstream oss;
 
     oss << "\\# " << MAX_RDLENGTH << " ";
-    oss.fill('0');
+    (void)oss.fill('0');
     oss << right << hex;
     for (unsigned i = 0; i < MAX_RDLENGTH; i++) {
         oss << setw(2) << (i & 0xff);
index 466c77db034f3d4241a594c6b4cffe474c5d9053..c6d499a094e2b9de598eb856e3f4b4ac70baa8dd 100644 (file)
@@ -354,7 +354,7 @@ public:
         const int rc = regcomp(&regex_, expr, flags);
         if (rc) {
             regfree(&regex_);
-            throw;
+            isc_throw(Exception, "Unable to create regex");
         }
     }
 
index c426a14495dc0291bda8244daef8c2954bc05006..e0c13b076945dcad0712c6d0a8e1bf164327d72f 100644 (file)
@@ -557,7 +557,7 @@ public:
     /// @param data A pointer to the data to be copied into the buffer.
     /// @param len The length of the data in bytes.
     void writeData(const void* data, size_t len) {
-        if (len == 0) {
+        if (len == 0 || data == 0) {
             return;
         }
 
index eaaba738f40c74382cf785f872bfe5dfd691686d..bfbb1dcd926a0a24c172171daee9124f2fb3ebc5 100644 (file)
@@ -242,7 +242,7 @@ public:
 
     /// @brief  Manually construct the event and state dictionaries.
     /// This allows testing without running startModel.
-    void initDictionaries() {
+    void initTestDictionaries() {
         ASSERT_NO_THROW(defineEvents());
         ASSERT_NO_THROW(verifyEvents());
         ASSERT_NO_THROW(defineStates());
@@ -509,7 +509,7 @@ TEST_F(StateModelTest, runBeforeStart) {
 /// a normal conclusion.
 TEST_F(StateModelTest, transitionWithEnd) {
     // Init dictionaries manually, normally done by startModel.
-    initDictionaries();
+    initTestDictionaries();
 
     // call transition to move from NEW_ST to DUMMY_ST with START_EVT
     EXPECT_NO_THROW(transition(DUMMY_ST, START_EVT));
@@ -534,7 +534,7 @@ TEST_F(StateModelTest, transitionWithEnd) {
 /// failed conclusion.
 TEST_F(StateModelTest, transitionWithAbort) {
     // Init dictionaries manually, normally done by startModel.
-    initDictionaries();
+    initTestDictionaries();
 
     // call transition to move from NEW_ST to DUMMY_ST with START_EVT
     EXPECT_NO_THROW(transition(DUMMY_ST, START_EVT));
@@ -559,7 +559,7 @@ TEST_F(StateModelTest, transitionWithAbort) {
 /// work properly.
 TEST_F(StateModelTest, doFlags) {
     // Init dictionaries manually, normally done by startModel.
-    initDictionaries();
+    initTestDictionaries();
 
     // Verify that "do" flags are false.
     EXPECT_FALSE(doOnEntry());
@@ -590,7 +590,7 @@ TEST_F(StateModelTest, doFlags) {
 /// the model is running but not after.
 TEST_F(StateModelTest, statusMethods) {
     // Init dictionaries manually, normally done by startModel.
-    initDictionaries();
+    initTestDictionaries();
 
     // After construction, state model is "new", all others should be false.
     EXPECT_TRUE(isModelNew());