Skip to content

Commit

Permalink
LL to avoid 32bit math on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz committed Aug 29, 2018
1 parent 1264316 commit 6d646a5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions rcl/test/rcl/test_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ TEST_F(TestTimerFixture, test_canceled_timer) {

TEST_F(TestTimerFixture, test_rostime_time_until_next_call) {
rcl_ret_t ret;
const int64_t sec_5 = 5L * 1000L * 1000L * 1000L;
const int64_t sec_5 = 5LL * 1000LL * 1000LL * 1000LL;
int64_t time_until = 0;

rcl_clock_t clock;
Expand Down Expand Up @@ -289,7 +289,7 @@ TEST_F(TestTimerFixture, test_rostime_time_until_next_call) {

TEST_F(TestTimerFixture, test_system_time_to_ros_time) {
rcl_ret_t ret;
const int64_t sec_5 = 5L * 1000L * 1000L * 1000L;
const int64_t sec_5 = 5LL * 1000LL * 1000LL * 1000LL;

rcl_clock_t clock;
rcl_allocator_t allocator = rcl_get_default_allocator();
Expand Down Expand Up @@ -325,8 +325,8 @@ TEST_F(TestTimerFixture, test_system_time_to_ros_time) {

TEST_F(TestTimerFixture, test_ros_time_to_system_time) {
rcl_ret_t ret;
const int64_t sec_5 = 5L * 1000L * 1000L * 1000L;
const int64_t sec_1 = 1000L * 1000L * 1000L;
const int64_t sec_5 = 5LL * 1000LL * 1000LL * 1000LL;
const int64_t sec_1 = 1000LL * 1000LL * 1000LL;

rcl_clock_t clock;
rcl_allocator_t allocator = rcl_get_default_allocator();
Expand Down Expand Up @@ -366,10 +366,10 @@ TEST_F(TestTimerFixture, test_ros_time_to_system_time) {

TEST_F(TestTimerFixture, test_ros_time_backwards_jump) {
rcl_ret_t ret;
const int64_t sec_5 = 5L * 1000L * 1000L * 1000L;
const int64_t sec_3 = 3L * 1000L * 1000L * 1000L;
const int64_t sec_2 = 2L * 1000L * 1000L * 1000L;
const int64_t sec_1 = 1000L * 1000L * 1000L;
const int64_t sec_5 = 5LL * 1000LL * 1000LL * 1000LL;
const int64_t sec_3 = 3LL * 1000LL * 1000LL * 1000LL;
const int64_t sec_2 = 2LL * 1000LL * 1000LL * 1000LL;
const int64_t sec_1 = 1000LL * 1000LL * 1000LL;

rcl_clock_t clock;
rcl_allocator_t allocator = rcl_get_default_allocator();
Expand Down Expand Up @@ -408,8 +408,9 @@ TEST_F(TestTimerFixture, test_ros_time_backwards_jump) {
}

TEST_F(TestTimerFixture, test_ros_time_wakes_wait) {
const int64_t sec_5 = 5L * 1000L * 1000L * 1000L;
const int64_t sec_1 = 1000L * 1000L * 1000L;
const int64_t sec_5 = 5LL * 1000LL * 1000LL * 1000LL;
const int64_t sec_1 = 1000LL * 1000LL * 1000LL;
const int64_t sec_1_5 = 1500LL * 1000LL * 1000LL;

rcl_ret_t ret;
rcl_clock_t clock;
Expand Down Expand Up @@ -454,7 +455,7 @@ TEST_F(TestTimerFixture, test_ros_time_wakes_wait) {
});

// Timer not exceeded, should not wake
ASSERT_EQ(RCL_RET_OK, rcl_set_ros_time_override(&clock, sec_1 * 1.5)) <<
ASSERT_EQ(RCL_RET_OK, rcl_set_ros_time_override(&clock, sec_1_5)) <<
rcl_get_error_string_safe();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
EXPECT_FALSE(timer_was_ready);
Expand Down

0 comments on commit 6d646a5

Please sign in to comment.