Skip to content

Commit

Permalink
call rcl_clock_fini at the end of each test
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Jul 24, 2018
1 parent e8f2e34 commit 0c97207
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rcl/test/rcl/test_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ TEST_F(TestTimerFixture, test_two_timers) {
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_FALSE(is_ready);
ASSERT_EQ(1, nonnull_timers);

ret = rcl_clock_fini(&clock);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
}

TEST_F(TestTimerFixture, test_two_timers_ready_before_timeout) {
Expand Down Expand Up @@ -148,6 +151,9 @@ TEST_F(TestTimerFixture, test_two_timers_ready_before_timeout) {
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_FALSE(is_ready);
ASSERT_EQ(1, nonnull_timers);

ret = rcl_clock_fini(&clock);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
}

TEST_F(TestTimerFixture, test_timer_not_ready) {
Expand Down Expand Up @@ -189,6 +195,9 @@ TEST_F(TestTimerFixture, test_timer_not_ready) {
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_FALSE(is_ready);
ASSERT_EQ(0, nonnull_timers);

ret = rcl_clock_fini(&clock);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
}

TEST_F(TestTimerFixture, test_canceled_timer) {
Expand Down Expand Up @@ -233,4 +242,7 @@ TEST_F(TestTimerFixture, test_canceled_timer) {
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
EXPECT_FALSE(is_ready);
ASSERT_EQ(0, nonnull_timers);

ret = rcl_clock_fini(&clock);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string_safe();
}

0 comments on commit 0c97207

Please sign in to comment.