Skip to content
Merged
Changes from all commits
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
9 changes: 7 additions & 2 deletions test_rmw_implementation/test/test_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <gtest/gtest.h>

#include <chrono>

#include "osrf_testing_tools_cpp/scope_exit.hpp"

#include "rcutils/allocator.h"
Expand Down Expand Up @@ -326,8 +328,11 @@ TEST_F(CLASSNAME(TestService, RMW_IMPLEMENTATION), send_reponse_with_bad_argumen
srv_array.service_count = 1u;
srv_array.services = array;
rmw_time_t timeout;
timeout.sec = 0;
timeout.nsec = rmw_intraprocess_discovery_delay.count() * 1000;
auto rmw_intraprocess_discovery_delay_in_nanoseconds =
std::chrono::duration_cast<std::chrono::nanoseconds>(
rmw_intraprocess_discovery_delay * 10).count();
timeout.sec = rmw_intraprocess_discovery_delay_in_nanoseconds / 1000000000;
timeout.nsec = rmw_intraprocess_discovery_delay_in_nanoseconds % 1000000000;
ret = rmw_wait(nullptr, nullptr, &srv_array, nullptr, nullptr, wait_set, &timeout);
ASSERT_EQ(RMW_RET_OK, ret) << rmw_get_error_string().str;
ASSERT_NE(nullptr, srv_array.services[0]);
Expand Down