From: Andrei Pavel Date: Thu, 23 Nov 2023 13:37:54 +0000 (+0200) Subject: [#3166] fix compilation error in unit tests X-Git-Tag: Kea-2.4.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb574c9a7dee6242b17f109c40b60cc1a8857f1;p=thirdparty%2Fkea.git [#3166] fix compilation error in unit tests --- diff --git a/src/lib/asiolink/tests/tls_unittest.cc b/src/lib/asiolink/tests/tls_unittest.cc index 59a3b3c8e8..35fc8c4898 100644 --- a/src/lib/asiolink/tests/tls_unittest.cc +++ b/src/lib/asiolink/tests/tls_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2021-2023 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -633,6 +633,8 @@ TEST(TLSTest, loadCertKeyFile) { exps.addThrow("no start line (PEM routines, CRYPTO_internal)"); exps.addThrow("PEM lib"); exps.addThrow("PEM lib (SSL routines)"); + exps.addThrow("unsupported"); + exps.addThrow("unsupported (DECODER routines)"); // Another possible error. exps.addThrow("No such file or directory"); exps.runCanThrow([] { diff --git a/src/lib/cc/tests/stamped_value_unittest.cc b/src/lib/cc/tests/stamped_value_unittest.cc index 367382524c..d305a34520 100644 --- a/src/lib/cc/tests/stamped_value_unittest.cc +++ b/src/lib/cc/tests/stamped_value_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -63,7 +63,7 @@ TEST(StampedValueTest, createFromInteger) { EXPECT_EQ(Element::integer, value->getType()); EXPECT_EQ("bar", value->getName()); EXPECT_EQ("5", value->getValue()); - int64_t signed_integer; + int64_t signed_integer = 0; ASSERT_NO_THROW(signed_integer = value->getIntegerValue()); EXPECT_EQ(5, signed_integer); diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index effdc3791f..b070ec8033 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@ -1027,7 +1027,7 @@ private: option = def->optionFactory(universe_, code_, buf.begin(), value_null_ == MLM_FALSE ? buf.end() : buf.begin()); - } else { + } else { // Spit the value specified in comma separated values // format. std::vector split_vec; @@ -1789,9 +1789,6 @@ private: /// @brief Binary address data. std::vector addr6_; - /// @brief Binary address buffer. - uint8_t addr6_buffer_[isc::asiolink::V6ADDRESS_LEN]; - /// @brief Binary address length. unsigned long addr6_length_; }; diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index 97a93a035a..384369c1e4 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc @@ -1093,7 +1093,7 @@ PdPoolParser::PdPoolParser() { } void -PdPoolParser::parse(PoolStoragePtr pools, ConstElementPtr pd_pool_, +PdPoolParser::parse(PoolStoragePtr pools, ConstElementPtr pd_pool_, bool encapsulate_options) { checkKeywords(SimpleParser6::PD_POOL6_PARAMETERS, pd_pool_); diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc index 0db51bf63e..ad2f23f370 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc @@ -1615,10 +1615,10 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() { // Verify getting a collection of leases by type, DUID, and IAID. // Iterate over the lease types, asking for leases based on // lease type, DUID, and IAID. - for (int i = 0; i < 3; ++i) { + for (size_t i = 0; i < 3; ++i) { Lease6Collection returned = lmptr_->getLeases6(leasetype6_[i], *duid, 142); - auto compare = [](Lease6Ptr& left, Lease6Ptr& right) { + auto compare = [](const Lease6Ptr& left, const Lease6Ptr& right) { return (left->addr_ < right->addr_); }; std::sort(returned.begin(), returned.end(), compare); diff --git a/src/lib/dns/tests/rdata_unittest.cc b/src/lib/dns/tests/rdata_unittest.cc index e189d0f717..afc16a1986 100644 --- a/src/lib/dns/tests/rdata_unittest.cc +++ b/src/lib/dns/tests/rdata_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2020 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2023 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -7,6 +7,7 @@ #include #include +#include #include #include #include