Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not compile assert death tests in Release builds. #393

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rmw_fastrtps_shared_cpp/test/test_guid_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ static constexpr size_t byte_array_size =
eprosima::fastrtps::rtps::GuidPrefix_t::size +
eprosima::fastrtps::rtps::EntityId_t::size;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the extra lines intentional? Here and line 40?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's just my Python linting reflexes (2 lines in between functions). Rolled back in 31ee714.

TEST(GUIDUtilsTest, bad_arguments) {
#ifndef NDEBUG
eprosima::fastrtps::rtps::GUID_t guid;
uint8_t byte_array[byte_array_size] = {0};
uint8_t * null_byte_array = nullptr;
EXPECT_DEATH(copy_from_byte_array_to_fastrtps_guid(byte_array, nullptr), "");
EXPECT_DEATH(copy_from_byte_array_to_fastrtps_guid(null_byte_array, &guid), "");
EXPECT_DEATH(copy_from_fastrtps_guid_to_byte_array(guid, null_byte_array), "");
#endif
}


TEST(GUIDUtilsTest, byte_array_to_guid_and_back) {
uint8_t input_byte_array[byte_array_size] = {0};
input_byte_array[0] = 0xA5;
Expand Down
2 changes: 2 additions & 0 deletions rmw_fastrtps_shared_cpp/test/test_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ TEST(NamespaceTest, name_mangling) {
rmw_qos_profile_t qos_profile = rmw_qos_profile_unknown;
qos_profile.avoid_ros_namespace_conventions = false;

#ifndef NDEBUG
EXPECT_DEATH(_create_topic_name(nullptr, "", "", ""), "");

EXPECT_DEATH(_create_topic_name(&qos_profile, "", nullptr, ""), "");
#endif

EXPECT_STREQ(
"some_ros_prefix/test__suffix", _create_topic_name(
Expand Down