Skip to content

Commit

Permalink
Fixing valgrind errors on security unit tests (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany authored Jan 29, 2020
1 parent 11810da commit bffdf42
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unittest/rtps/security/SecurityHandshakeProcessTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ TEST_F(SecurityTest, discovered_participant_begin_handshake_request_fail_and_the

ASSERT_TRUE(manager_.discovered_participant(participant_data));

manager_.destroy();

delete change;
}

Expand Down Expand Up @@ -483,6 +485,8 @@ TEST_F(SecurityTest, discovered_participant_process_message_add_change_fail)

stateless_reader_->listener_->onNewCacheChangeAdded(stateless_reader_, change);

manager_.destroy();

delete change2;
}

Expand Down Expand Up @@ -516,6 +520,8 @@ TEST_F(SecurityTest, discovered_participant_process_message_pending_handshake_re
WillOnce(Return(true));
stateless_writer_->history_->wait_for_more_samples_than(1);

manager_.destroy();

delete reply_message_change;
}

Expand Down Expand Up @@ -606,6 +612,8 @@ TEST_F(SecurityTest, discovered_participant_process_message_pending_handshake_re

stateless_reader_->listener_->onNewCacheChangeAdded(stateless_reader_, change);

manager_.destroy();

delete change2;
}

Expand Down Expand Up @@ -858,6 +866,8 @@ TEST_F(SecurityTest, discovered_participant_process_message_process_handshake_re

stateless_reader_->listener_->onNewCacheChangeAdded(stateless_reader_, change);

manager_.destroy();

delete change2;
}

Expand Down Expand Up @@ -927,6 +937,8 @@ TEST_F(SecurityTest, discovered_participant_process_message_process_handshake_re

stateless_reader_->listener_->onNewCacheChangeAdded(stateless_reader_, change);

manager_.destroy();

delete final_message_change;
}

Expand Down
10 changes: 10 additions & 0 deletions test/unittest/rtps/security/SecurityValidationRemoteTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ TEST_F(SecurityTest, discovered_participant_validation_remote_identity_add_chang
fill_participant_key(participant_data.m_guid);
ASSERT_FALSE(manager_.discovered_participant(participant_data));

manager_.destroy();

delete change;
}

Expand Down Expand Up @@ -246,6 +248,8 @@ TEST_F(SecurityTest, discovered_participant_validation_remote_identity_pending_h
WillOnce(Return(true));
stateless_writer_->history_->wait_for_more_samples_than(1);

manager_.destroy();

delete request_message_change;
}

Expand Down Expand Up @@ -301,6 +305,8 @@ TEST_F(SecurityTest, discovered_participant_validation_remote_identity_pending_h

ASSERT_TRUE(manager_.discovered_participant(participant_data));

manager_.destroy();

delete change;
}

Expand Down Expand Up @@ -336,6 +342,8 @@ TEST_F(SecurityTest, discovered_participant_ok)
fill_participant_key(participant_data.m_guid);
ASSERT_TRUE(manager_.discovered_participant(participant_data));

manager_.destroy();

delete change;
}

Expand Down Expand Up @@ -381,5 +389,7 @@ TEST_F(SecurityTest, discovered_participant_validate_remote_fail_and_then_ok)

ASSERT_TRUE(manager_.discovered_participant(participant_data));

manager_.destroy();

delete change;
}

0 comments on commit bffdf42

Please sign in to comment.