Skip to content

Commit

Permalink
free memory after tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz authored and mikaelarguedas committed Jun 5, 2018
1 parent e90edde commit 18a6ef7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rcl/test/rcl/test_arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ TEST_F(CLASSNAME(TestArgumentsFixture, RMW_IMPLEMENTATION), test_param_argument_

int parameter_filecount = rcl_arguments_get_param_files_count(&parsed_args);
EXPECT_EQ(0, parameter_filecount);
EXPECT_EQ(RCL_RET_OK, rcl_arguments_fini(&parsed_args));
}

TEST_F(CLASSNAME(TestArgumentsFixture, RMW_IMPLEMENTATION), test_param_argument_single) {
Expand All @@ -336,6 +337,12 @@ TEST_F(CLASSNAME(TestArgumentsFixture, RMW_IMPLEMENTATION), test_param_argument_
ret = rcl_arguments_get_param_files(&parsed_args, alloc, &parameter_files);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_STREQ("parameter_filepath", parameter_files[0]);

for (int i = 0; i < parameter_filecount; ++i) {
alloc.deallocate(parameter_files[i], alloc.state);
}
alloc.deallocate(parameter_files, alloc.state);
EXPECT_EQ(RCL_RET_OK, rcl_arguments_fini(&parsed_args));
}

TEST_F(CLASSNAME(TestArgumentsFixture, RMW_IMPLEMENTATION), test_param_argument_multiple) {
Expand All @@ -359,4 +366,9 @@ TEST_F(CLASSNAME(TestArgumentsFixture, RMW_IMPLEMENTATION), test_param_argument_
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_STREQ("parameter_filepath1", parameter_files[0]);
EXPECT_STREQ("parameter_filepath2", parameter_files[1]);
for (int i = 0; i < parameter_filecount; ++i) {
alloc.deallocate(parameter_files[i], alloc.state);
}
alloc.deallocate(parameter_files, alloc.state);
EXPECT_EQ(RCL_RET_OK, rcl_arguments_fini(&parsed_args));
}

0 comments on commit 18a6ef7

Please sign in to comment.