Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#7661 from edrumwri/remove_value_or…
Browse files Browse the repository at this point in the history
…_hacks

Removes value_or(999) hacks previously necessary for OS X builds to succeed.
  • Loading branch information
sherm1 authored Dec 22, 2017
2 parents 084ff10 + 6ce6cd0 commit 2e7853b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions systems/analysis/test/simulator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,9 @@ GTEST_TEST(SimulatorTest, MultipleWitnessesIdentical) {
EXPECT_EQ(w1, w2);

// Verify that they are triggering.
// NOTE: value_or(999) necessary to work around Mac OS X bug where value()
// function is declared but not defined.
optional<double> iso_time = simulator->GetCurrentWitnessTimeIsolation();
EXPECT_TRUE(iso_time);
EXPECT_LT(std::abs(w1), iso_time.value_or(999));
EXPECT_LT(std::abs(w1), iso_time.value());

// Indicate that the method has been called.
published = true;
Expand Down
2 changes: 1 addition & 1 deletion systems/framework/test/diagram_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ TEST_F(DiagramContextTest, Accuracy) {
const double unity = 1.0;
context_->set_accuracy(unity);
std::unique_ptr<Context<double>> clone = context_->Clone();
EXPECT_EQ(clone->get_accuracy().value_or(999), unity);
EXPECT_EQ(clone->get_accuracy().value(), unity);
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion systems/framework/test/leaf_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ TEST_F(LeafContextTest, Accuracy) {
const double unity = 1.0;
context_.set_accuracy(unity);
std::unique_ptr<Context<double>> clone = context_.Clone();
EXPECT_EQ(clone->get_accuracy().value_or(999), unity);
EXPECT_EQ(clone->get_accuracy().value(), unity);
}

} // namespace systems
Expand Down

0 comments on commit 2e7853b

Please sign in to comment.