Skip to content

Commit

Permalink
softening tolerances on timing to pass on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
tfoote committed Dec 17, 2015
1 parent 70eb6be commit 4d332f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rclcpp/test/test_rate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
Tests that funcion_traits calculates arity of several functors.
*/
TEST(TestRate, rate_basics) {
auto period = std::chrono::milliseconds(10);
auto delta = std::chrono::milliseconds(1);
auto period = std::chrono::milliseconds(100);
auto delta = std::chrono::milliseconds(10);

auto start = std::chrono::system_clock::now();
rclcpp::rate::Rate r(period);
Expand All @@ -45,12 +45,12 @@ TEST(TestRate, rate_basics) {
r.sleep();
auto three = std::chrono::system_clock::now();
ASSERT_TRUE(period + 3 * delta < three - two);
ASSERT_TRUE(period + 5 * delta > three - two);
ASSERT_TRUE(period + 7 * delta > three - two);
}

TEST(TestRate, wallrate_basics) {
auto period = std::chrono::milliseconds(10);
auto delta = std::chrono::milliseconds(1);
auto period = std::chrono::milliseconds(100);
auto delta = std::chrono::milliseconds(10);

auto start = std::chrono::system_clock::now();
rclcpp::rate::WallRate r(period);
Expand All @@ -72,5 +72,5 @@ TEST(TestRate, wallrate_basics) {
r.sleep();
auto three = std::chrono::system_clock::now();
ASSERT_TRUE(period + 3 * delta < three - two);
ASSERT_TRUE(period + 5 * delta > three - two);
ASSERT_TRUE(period + 7 * delta > three - two);
}

0 comments on commit 4d332f9

Please sign in to comment.