Skip to content

Commit

Permalink
Remove unnecessary assert on pointer created with new (#555)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Brawner <brawner@gmail.com>
  • Loading branch information
brawner committed Nov 20, 2020
1 parent 8bdc15a commit 1458d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rosidl_generator_cpp/test/test_msg_initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ TEST(Test_msg_initialization, defaults_only_constructor) {
// it does no initialization.
TEST(Test_msg_initialization, skip_constructor) {
char * memory = new char[sizeof(rosidl_generator_cpp::msg::BoundedSequences)];
ASSERT_TRUE(nullptr != memory);

std::memset(memory, 0xfe, sizeof(rosidl_generator_cpp::msg::BoundedSequences));
rosidl_generator_cpp::msg::BoundedSequences * bounded =
new(memory) rosidl_generator_cpp::msg::BoundedSequences(
Expand Down

0 comments on commit 1458d50

Please sign in to comment.