diff --git a/include/arbitration_graphs/internal/arbitrator_impl.hpp b/include/arbitration_graphs/internal/arbitrator_impl.hpp index a3147359..deb73023 100644 --- a/include/arbitration_graphs/internal/arbitrator_impl.hpp +++ b/include/arbitration_graphs/internal/arbitrator_impl.hpp @@ -115,7 +115,7 @@ SubCommandT Arbitrator::g command = getAndVerifyCommand(bestOption, time); } catch (const std::exception& e) { VLOG(1) << bestOption->behavior_->name_ << " threw an exception during getAndVerifyCommand(): " << e.what(); - bestOption->verificationResult_.reset(); + bestOption->verificationResult_.cache(time, VerificationResultT{false}); bestOption->behavior_->loseControl(time); continue; } diff --git a/test/handle_exceptions.cpp b/test/handle_exceptions.cpp index 2462f838..10afa598 100644 --- a/test/handle_exceptions.cpp +++ b/test/handle_exceptions.cpp @@ -33,9 +33,10 @@ TEST_F(ExceptionHandlingTest, HandleException) { // Since the high priority behavior is broken, we should get the low priority behavior as fallback EXPECT_EQ("LowPriority", testPriorityArbitrator.getCommand(time)); - EXPECT_FALSE(testPriorityArbitrator.options().at(0)->verificationResult_.cached(time)); + ASSERT_TRUE(testPriorityArbitrator.options().at(0)->verificationResult_.cached(time)); ASSERT_TRUE(testPriorityArbitrator.options().at(1)->verificationResult_.cached(time)); + EXPECT_FALSE(testPriorityArbitrator.options().at(0)->verificationResult_.cached(time)->isOk()); EXPECT_TRUE(testPriorityArbitrator.options().at(1)->verificationResult_.cached(time)->isOk()); testPriorityArbitrator.loseControl(time);