Skip to content
Snippets Groups Projects
Commit 3d5e2504 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Update gtest_has_state_blocks.cpp

parent a78e02c5
No related branches found
No related tags found
1 merge request!341Resolve "HasStateBlocks::addStateBlock() needs to register SB's"
Pipeline #4963 passed
This commit is part of merge request !341. Comments created here will be created in the context of that merge request.
...@@ -67,6 +67,9 @@ TEST_F(HasStateBlocksTest, Notifications_setKey) ...@@ -67,6 +67,9 @@ TEST_F(HasStateBlocksTest, Notifications_setKey)
TEST_F(HasStateBlocksTest, Notifications_addStateBlock) TEST_F(HasStateBlocksTest, Notifications_addStateBlock)
{ {
Notification n; Notification n;
// First add SB, than make KF
ASSERT_FALSE(problem->getStateBlockNotification(sbp0, n)); ASSERT_FALSE(problem->getStateBlockNotification(sbp0, n));
F0->link(problem->getTrajectory()); F0->link(problem->getTrajectory());
...@@ -86,6 +89,23 @@ TEST_F(HasStateBlocksTest, Notifications_addStateBlock) ...@@ -86,6 +89,23 @@ TEST_F(HasStateBlocksTest, Notifications_addStateBlock)
ASSERT_TRUE(problem->getStateBlockNotification(sbv0, n)); ASSERT_TRUE(problem->getStateBlockNotification(sbv0, n));
ASSERT_EQ(n, ADD); ASSERT_EQ(n, ADD);
// first make KF, then add SB
F1->link(problem->getTrajectory());
F1->addStateBlock("P", sbp1);
F1->setKey();
ASSERT_TRUE(problem->getStateBlockNotification(sbp1, n));
ASSERT_FALSE(problem->getStateBlockNotification(sbv1, n));
F1->addStateBlock("V", sbv1);
ASSERT_TRUE(problem->getStateBlockNotification(sbv1, n));
ASSERT_EQ(n, ADD);
} }
int main(int argc, char **argv) int main(int argc, char **argv)
......
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