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

adapted tests again

parent 3b2d8e1f
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.
...@@ -211,7 +211,7 @@ TEST_F(ProcessorTrackerFeatureDummyTest, processKnown) ...@@ -211,7 +211,7 @@ TEST_F(ProcessorTrackerFeatureDummyTest, processKnown)
ASSERT_TRUE(isFeatureLinked(feat, processor->getIncoming())); ASSERT_TRUE(isFeatureLinked(feat, processor->getIncoming()));
} }
TEST_F(ProcessorTrackerFeatureDummyTest, createFactor) TEST_F(ProcessorTrackerFeatureDummyTest, emplaceFactor)
{ {
FeatureBasePtr ftr(std::make_shared<FeatureBase>("DUMMY FEATURE", FeatureBasePtr ftr(std::make_shared<FeatureBase>("DUMMY FEATURE",
Eigen::Vector1s::Ones(), Eigen::Vector1s::Ones(),
......
...@@ -41,7 +41,7 @@ class ProcessorTrackerLandmarkDummyDummy : public ProcessorTrackerLandmarkDummy ...@@ -41,7 +41,7 @@ class ProcessorTrackerLandmarkDummyDummy : public ProcessorTrackerLandmarkDummy
LandmarkBasePtr callEmplaceLandmark(FeatureBasePtr _feature_ptr){ return this->emplaceLandmark(_feature_ptr); } LandmarkBasePtr callEmplaceLandmark(FeatureBasePtr _feature_ptr){ return this->emplaceLandmark(_feature_ptr); }
void callEmplaceNewLandmarks(){ this->emplaceNewLandmarks(); } void callEmplaceNewLandmarks(){ this->emplaceNewLandmarks(); }
FactorBasePtr callEmlaceFactor(FeatureBasePtr _feature_ptr, FactorBasePtr callEmplaceFactor(FeatureBasePtr _feature_ptr,
LandmarkBasePtr _landmark_ptr){ return this->emplaceFactor(_feature_ptr, LandmarkBasePtr _landmark_ptr){ return this->emplaceFactor(_feature_ptr,
_landmark_ptr); } _landmark_ptr); }
...@@ -139,7 +139,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, detectNewFeatures) ...@@ -139,7 +139,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, detectNewFeatures)
ASSERT_TRUE(isFeatureLinked(feat, last_cap)); ASSERT_TRUE(isFeatureLinked(feat, last_cap));
} }
TEST_F(ProcessorTrackerLandmarkDummyTest, createLandmark) TEST_F(ProcessorTrackerLandmarkDummyTest, emplaceLandmark)
{ {
// Put a capture on last_ptr_ // Put a capture on last_ptr_
CaptureBasePtr last_cap = std::make_shared<CaptureVoid>(0, sensor); CaptureBasePtr last_cap = std::make_shared<CaptureVoid>(0, sensor);
...@@ -159,7 +159,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, createLandmark) ...@@ -159,7 +159,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, createLandmark)
ASSERT_EQ(problem->getMap()->getLandmarkList().size(),n_feat); // emplaced 10 landmarks ASSERT_EQ(problem->getMap()->getLandmarkList().size(),n_feat); // emplaced 10 landmarks
} }
TEST_F(ProcessorTrackerLandmarkDummyTest, createNewLandmarks) TEST_F(ProcessorTrackerLandmarkDummyTest, emplaceNewLandmarks)
{ {
// Put a capture on last_ptr_ // Put a capture on last_ptr_
CaptureBasePtr last_cap = std::make_shared<CaptureVoid>(0, sensor); CaptureBasePtr last_cap = std::make_shared<CaptureVoid>(0, sensor);
...@@ -255,7 +255,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, processKnown) ...@@ -255,7 +255,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, processKnown)
ASSERT_EQ(processor->getMatchesLandmarkFromIncoming().size(), 9); // 1 of each 10 landmarks is not found ASSERT_EQ(processor->getMatchesLandmarkFromIncoming().size(), 9); // 1 of each 10 landmarks is not found
} }
TEST_F(ProcessorTrackerLandmarkDummyTest, createFactor) TEST_F(ProcessorTrackerLandmarkDummyTest, emplaceFactor)
{ {
FeatureBasePtr ftr(std::make_shared<FeatureBase>("DUMMY FEATURE", FeatureBasePtr ftr(std::make_shared<FeatureBase>("DUMMY FEATURE",
Eigen::Vector1s::Ones(), Eigen::Vector1s::Ones(),
...@@ -264,8 +264,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, createFactor) ...@@ -264,8 +264,7 @@ TEST_F(ProcessorTrackerLandmarkDummyTest, createFactor)
std::make_shared<StateBlock>(1), std::make_shared<StateBlock>(1),
std::make_shared<StateBlock>(1))); std::make_shared<StateBlock>(1)));
FactorBasePtr fac = processor->callEmlaceFactor(ftr, lmk); FactorBasePtr fac = processor->callEmplaceFactor(ftr, lmk);
fac->link(ftr);
ASSERT_EQ(fac->getFeature(),ftr); ASSERT_EQ(fac->getFeature(),ftr);
ASSERT_EQ(fac->getFrameOther(),nullptr); ASSERT_EQ(fac->getFrameOther(),nullptr);
ASSERT_EQ(fac->getCaptureOther(),nullptr); ASSERT_EQ(fac->getCaptureOther(),nullptr);
......
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