Skip to content

Commit 6131956

Browse files
Razvan Becheriufxdupont
authored andcommitted
[#3991] fixed more warnings
1 parent 0375e2d commit 6131956

8 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/lib/asiolink/testutils/test_server_unix_socket.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Connection : public boost::enable_shared_from_this<Connection> {
4949
const std::string custom_response,
5050
SentResponseCallback sent_response_callback)
5151
: socket_(unix_socket), custom_response_(custom_response),
52-
sent_response_callback_(sent_response_callback) {
52+
raw_buf_(), sent_response_callback_(sent_response_callback) {
5353
}
5454

5555
/// @brief Starts asynchronous read from the socket.

src/lib/dhcp/tests/opaque_data_tuple_unittest.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ using namespace isc::util;
2222
namespace {
2323

2424
struct OpaqueDataTupleLenientParsing : ::testing::Test {
25+
26+
/// @brief Constructor.
27+
OpaqueDataTupleLenientParsing() : previous_(true) { }
28+
2529
void SetUp() override {
2630
// Retain the current setting for future restoration.
2731
previous_ = Option::lenient_parsing_;

src/lib/dhcp/tests/option_vendor_class_unittest.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ using namespace isc::util;
1919
namespace {
2020

2121
struct OptionVendorClassLenientParsing : ::testing::Test {
22+
23+
/// @brief Constructor.
24+
OptionVendorClassLenientParsing() : previous_(true) { }
25+
2226
void SetUp() override {
2327
// Retain the current setting for future restoration.
2428
previous_ = Option::lenient_parsing_;

src/lib/dns/rdata.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Generic::toText() const {
333333
ostringstream oss;
334334

335335
oss << "\\# " << impl_->data_.size() << " ";
336-
oss.fill('0');
336+
(void)oss.fill('0');
337337
oss << right << hex;
338338
for_each(impl_->data_.begin(), impl_->data_.end(), UnknownRdataDumper(oss));
339339

src/lib/dns/tests/rdata_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Rdata_Unknown_Test::getLongestRdataTxt() {
256256
ostringstream oss;
257257

258258
oss << "\\# " << MAX_RDLENGTH << " ";
259-
oss.fill('0');
259+
(void)oss.fill('0');
260260
oss << right << hex;
261261
for (unsigned i = 0; i < MAX_RDLENGTH; i++) {
262262
oss << setw(2) << (i & 0xff);

src/lib/log/tests/logger_manager_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ class RegexHolder {
354354
const int rc = regcomp(&regex_, expr, flags);
355355
if (rc) {
356356
regfree(&regex_);
357-
throw;
357+
isc_throw(Exception, "Unable to create regex");
358358
}
359359
}
360360

src/lib/util/buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class OutputBuffer {
557557
/// @param data A pointer to the data to be copied into the buffer.
558558
/// @param len The length of the data in bytes.
559559
void writeData(const void* data, size_t len) {
560-
if (len == 0) {
560+
if (len == 0 || data == 0) {
561561
return;
562562
}
563563

src/lib/util/tests/state_model_unittest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class StateModelTest : public StateModel, public testing::Test {
242242

243243
/// @brief Manually construct the event and state dictionaries.
244244
/// This allows testing without running startModel.
245-
void initDictionaries() {
245+
void initTestDictionaries() {
246246
ASSERT_NO_THROW(defineEvents());
247247
ASSERT_NO_THROW(verifyEvents());
248248
ASSERT_NO_THROW(defineStates());
@@ -509,7 +509,7 @@ TEST_F(StateModelTest, runBeforeStart) {
509509
/// a normal conclusion.
510510
TEST_F(StateModelTest, transitionWithEnd) {
511511
// Init dictionaries manually, normally done by startModel.
512-
initDictionaries();
512+
initTestDictionaries();
513513

514514
// call transition to move from NEW_ST to DUMMY_ST with START_EVT
515515
EXPECT_NO_THROW(transition(DUMMY_ST, START_EVT));
@@ -534,7 +534,7 @@ TEST_F(StateModelTest, transitionWithEnd) {
534534
/// failed conclusion.
535535
TEST_F(StateModelTest, transitionWithAbort) {
536536
// Init dictionaries manually, normally done by startModel.
537-
initDictionaries();
537+
initTestDictionaries();
538538

539539
// call transition to move from NEW_ST to DUMMY_ST with START_EVT
540540
EXPECT_NO_THROW(transition(DUMMY_ST, START_EVT));
@@ -559,7 +559,7 @@ TEST_F(StateModelTest, transitionWithAbort) {
559559
/// work properly.
560560
TEST_F(StateModelTest, doFlags) {
561561
// Init dictionaries manually, normally done by startModel.
562-
initDictionaries();
562+
initTestDictionaries();
563563

564564
// Verify that "do" flags are false.
565565
EXPECT_FALSE(doOnEntry());
@@ -590,7 +590,7 @@ TEST_F(StateModelTest, doFlags) {
590590
/// the model is running but not after.
591591
TEST_F(StateModelTest, statusMethods) {
592592
// Init dictionaries manually, normally done by startModel.
593-
initDictionaries();
593+
initTestDictionaries();
594594

595595
// After construction, state model is "new", all others should be false.
596596
EXPECT_TRUE(isModelNew());

0 commit comments

Comments
 (0)