Skip to content
Snippets Groups Projects
Commit 12dce75f authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

gtest solver manager more complete

parent 5c74a034
No related branches found
No related tags found
1 merge request!274Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
This commit is part of merge request !274. Comments created here will be created in the context of that merge request.
...@@ -465,12 +465,17 @@ TEST(SolverManager, AddUpdatedStateBlock) ...@@ -465,12 +465,17 @@ TEST(SolverManager, AddUpdatedStateBlock)
// Fix --> FLAG // Fix --> FLAG
sb_ptr->unfix(); 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) ASSERT_EQ(P->getStateBlockNotificationMapSize(),1); // No new notifications (fix and set state are flags in sb)
// == consume empties the notification map == // == consume empties the notification map ==
solver_manager_ptr->update(); // it calls P->consumeStateBlockNotificationMap(); solver_manager_ptr->update(); // it calls P->consumeStateBlockNotificationMap();
ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); 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 == // == When an REMOVE is notified: a REMOVE notification should be stored ==
...@@ -481,10 +486,9 @@ TEST(SolverManager, AddUpdatedStateBlock) ...@@ -481,10 +486,9 @@ TEST(SolverManager, AddUpdatedStateBlock)
ASSERT_TRUE(P->getStateBlockNotification(sb_ptr, notif)); ASSERT_TRUE(P->getStateBlockNotification(sb_ptr, notif));
ASSERT_EQ(notif, REMOVE); 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,ADD);
P->notifyStateBlock(sb_ptr,REMOVE); ASSERT_EQ(P->getStateBlockNotificationMapSize(),0);
ASSERT_TRUE(P->getStateBlockNotificationMapSize() == 0);
// == UPDATES should clear the list of notifications == // == UPDATES should clear the list of notifications ==
// add state_block // add state_block
...@@ -494,6 +498,11 @@ TEST(SolverManager, AddUpdatedStateBlock) ...@@ -494,6 +498,11 @@ TEST(SolverManager, AddUpdatedStateBlock)
solver_manager_ptr->update(); solver_manager_ptr->update();
ASSERT_EQ(P->getStateBlockNotificationMapSize(),0); // After solver_manager->update, notifications should be empty 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) TEST(SolverManager, AddFactor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment