Skip to content
Snippets Groups Projects
Commit aaf3e245 authored by Mederic Fourmy's avatar Mederic Fourmy
Browse files

change fixture name

parent 7e673b4d
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ WOLF_REGISTER_PROCESSOR(ProcessorTrackerLandmarkObject_Wrapper); ...@@ -66,7 +66,7 @@ WOLF_REGISTER_PROCESSOR(ProcessorTrackerLandmarkObject_Wrapper);
* The class ProcessorTrackerLandmarkObject is sometimes tested via the wrapper ProcessorTrackerLandmarkObject_Wrapper * The class ProcessorTrackerLandmarkObject is sometimes tested via the wrapper ProcessorTrackerLandmarkObject_Wrapper
*/ */
// Use the following in case you want to initialize tests with predefined variables or methods. // Use the following in case you want to initialize tests with predefined variables or methods.
class ProcessorTrackerLandmarkObject_class : public testing::Test{ class ProcessorTrackerLandmarkObject_fixture : public testing::Test{
public: public:
void SetUp() override void SetUp() override
{ {
...@@ -124,7 +124,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor) ...@@ -124,7 +124,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor)
// // TODO: GTEST IMPLEMENTATION IS WRONG // // TODO: GTEST IMPLEMENTATION IS WRONG
// ////////////////////////////////////// // //////////////////////////////////////
// ////////////////////////////////////// // //////////////////////////////////////
// TEST_F(ProcessorTrackerLandmarkObject_class, voteForKeyFrame) // TEST_F(ProcessorTrackerLandmarkObject_fixture, voteForKeyFrame)
// { // {
// double min_time_vote = prc_obj->getMinTimeVote(); // double min_time_vote = prc_obj->getMinTimeVote();
...@@ -174,7 +174,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor) ...@@ -174,7 +174,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor)
// !!!!!!!!!!!!!!!!!!!!!!! // !!!!!!!!!!!!!!!!!!!!!!!
// not usefull principle? // not usefull principle?
// !!!!!!!!!!!!!!!!!!!!!!! // !!!!!!!!!!!!!!!!!!!!!!!
// TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeaturesDuplicated) // TEST_F(ProcessorTrackerLandmarkObject_fixture, detectNewFeaturesDuplicated)
// { // {
// // No detected features // // No detected features
// FeatureBasePtrList features_out; // FeatureBasePtrList features_out;
...@@ -216,7 +216,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor) ...@@ -216,7 +216,7 @@ TEST(ProcessorTrackerLandmarkObject, Constructor)
// ASSERT_EQ(features_out.size(), 1); // detectNewFeatures should keep only one in the final list of new detected features // ASSERT_EQ(features_out.size(), 1); // detectNewFeatures should keep only one in the final list of new detected features
// } // }
TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures) TEST_F(ProcessorTrackerLandmarkObject_fixture, detectNewFeatures)
{ {
// No detected features // No detected features
FeatureBasePtrList features_out; FeatureBasePtrList features_out;
...@@ -230,8 +230,6 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures) ...@@ -230,8 +230,6 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures)
Eigen::Quaterniond quat; Eigen::Quaterniond quat;
Eigen::Vector7d pose; Eigen::Vector7d pose;
Eigen::Matrix6d meas_cov = Matrix6d::Identity(); Eigen::Matrix6d meas_cov = Matrix6d::Identity();
// Eigen::Matrix3d intrinsic = Matrix3d::Identity();
// TimeStamp t;
std::string object_type; std::string object_type;
// feature 0 // feature 0
...@@ -258,14 +256,14 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures) ...@@ -258,14 +256,14 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures)
object_type = "type2"; object_type = "type2";
FeatureBasePtr f2 = std::make_shared<FeatureObject>(pose, meas_cov, object_type); FeatureBasePtr f2 = std::make_shared<FeatureObject>(pose, meas_cov, object_type);
//we add different features in the list // we add 2 features in the detection list
features_in.push_back(f0); features_in.push_back(f0);
features_in.push_back(f1); features_in.push_back(f1);
//these features are set as the predetected features in last to processing an image // these features are set as the predetected features in last to processing an image
prc_obj->setLastDetections(features_in); prc_obj->setLastDetections(features_in);
// at this point we have 0 detections in last, 2 detections in predetected features with different ids, thus we should have 2 new detected features (if max_features set to >= 2) // at this point we have 0 detections in last, 2 detections in predetected features with different ids, thus we should have 2 new detected features (if max_features set to >= 2)
prc_obj->detectNewFeatures(2, C1, features_out); prc_obj->detectNewFeatures(2, C1, features_out);
// ASSERT_EQ(features_out.size(), 2); // TOFIX!! ASSERT_EQ(features_out.size(), 2); // TOFIX!!
// Put some of the features in the graph with emplaceLandmark() and detect some of them as well as others with detectNewFeatures() running again. // Put some of the features in the graph with emplaceLandmark() and detect some of them as well as others with detectNewFeatures() running again.
WOLF_WARN("call to function emplaceLandmark() in unit test for detectNewFeatures().") WOLF_WARN("call to function emplaceLandmark() in unit test for detectNewFeatures().")
...@@ -286,7 +284,7 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures) ...@@ -286,7 +284,7 @@ TEST_F(ProcessorTrackerLandmarkObject_class, detectNewFeatures)
// ASSERT_EQ(std::static_pointer_cast<FeatureObject>(features_out.front())->getObjectType(), "type2"); // TOFIX -> SegFault // ASSERT_EQ(std::static_pointer_cast<FeatureObject>(features_out.front())->getObjectType(), "type2"); // TOFIX -> SegFault
} }
TEST_F(ProcessorTrackerLandmarkObject_class, emplaceLandmark) TEST_F(ProcessorTrackerLandmarkObject_fixture, emplaceLandmark)
{ {
Vector7d pose_landmark((Vector7d()<<0,0,0,0,0,0,1).finished()); Vector7d pose_landmark((Vector7d()<<0,0,0,0,0,0,1).finished());
FeatureBasePtr f1 = FeatureBase::emplace<FeatureObject>(C1, pose_landmark, Matrix6d::Identity(), "thetype"); FeatureBasePtr f1 = FeatureBase::emplace<FeatureObject>(C1, pose_landmark, Matrix6d::Identity(), "thetype");
...@@ -298,7 +296,7 @@ TEST_F(ProcessorTrackerLandmarkObject_class, emplaceLandmark) ...@@ -298,7 +296,7 @@ TEST_F(ProcessorTrackerLandmarkObject_class, emplaceLandmark)
ASSERT_MATRIX_APPROX(lmk_object->getState().vector("PO"), pose_landmark, 1e-6); ASSERT_MATRIX_APPROX(lmk_object->getState().vector("PO"), pose_landmark, 1e-6);
} }
TEST_F(ProcessorTrackerLandmarkObject_class, emplaceFactor) TEST_F(ProcessorTrackerLandmarkObject_fixture, emplaceFactor)
{ {
FeatureBasePtr f1 = FeatureBase::emplace<FeatureObject>(C1, (Vector7d()<<0,0,0,0,0,0,1).finished(), Matrix6d::Identity(), "thetype"); FeatureBasePtr f1 = FeatureBase::emplace<FeatureObject>(C1, (Vector7d()<<0,0,0,0,0,0,1).finished(), Matrix6d::Identity(), "thetype");
......
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