diff --git a/test/gtest_solver_manager.cpp b/test/gtest_solver_manager.cpp index f7b5e25c0b7af51653c434554523be78c1087330..de653851d9de3aa625421088b4fb076e9b586afb 100644 --- a/test/gtest_solver_manager.cpp +++ b/test/gtest_solver_manager.cpp @@ -465,12 +465,17 @@ TEST(SolverManager, AddUpdatedStateBlock) // Fix --> FLAG sb_ptr->unfix(); + // Check flag has been set true + ASSERT_TRUE(sb_ptr->fixUpdated()); ASSERT_EQ(P->getStateBlockNotificationMapSize(),1); // No new notifications (fix and set state are flags in sb) // == consume empties the notification map == solver_manager_ptr->update(); // it calls P->consumeStateBlockNotificationMap(); ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); + // Check flags have been reset + ASSERT_FALSE(sb_ptr->fixUpdated()); + ASSERT_FALSE(sb_ptr->stateUpdated()); // == When an REMOVE is notified: a REMOVE notification should be stored == @@ -481,10 +486,9 @@ TEST(SolverManager, AddUpdatedStateBlock) ASSERT_TRUE(P->getStateBlockNotification(sb_ptr, notif)); ASSERT_EQ(notif, REMOVE); - // == ADD + REMOVE: notification map should be empty == + // == REMOVE + ADD: notification map should be empty == P->notifyStateBlock(sb_ptr,ADD); - P->notifyStateBlock(sb_ptr,REMOVE); - ASSERT_TRUE(P->getStateBlockNotificationMapSize() == 0); + ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); // == UPDATES should clear the list of notifications == // add state_block @@ -494,6 +498,11 @@ TEST(SolverManager, AddUpdatedStateBlock) solver_manager_ptr->update(); ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); // After solver_manager->update, notifications should be empty + + // == ADD + REMOVE: notification map should be empty == + P->notifyStateBlock(sb_ptr,ADD); + P->notifyStateBlock(sb_ptr,REMOVE); + ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); } TEST(SolverManager, AddFactor)