From 8aec136bce16076a62f01cbdfc6056e02b325afe Mon Sep 17 00:00:00 2001 From: jcasals <jcasals@iri.upc.edu> Date: Thu, 11 Jun 2020 11:35:03 +0200 Subject: [PATCH] Fix gtests --- test/gtest_feature_imu.cpp | 4 ++-- test/gtest_imu.cpp | 2 +- test/gtest_processor_imu.cpp | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/gtest_feature_imu.cpp b/test/gtest_feature_imu.cpp index a1e4a6efb..bc87d0be0 100644 --- a/test/gtest_feature_imu.cpp +++ b/test/gtest_feature_imu.cpp @@ -64,7 +64,7 @@ class FeatureImu_test : public testing::Test data_, Eigen::Matrix6d::Identity()*0.01, Eigen::Vector6d::Zero())->process(); - origin_frame = problem->getTrajectory()->getFrameList().front(); + origin_frame = problem->getTrajectory()->getFirstFrame(); // Emplace one capture to store the Imu data arriving from (sensor / callback / file / etc.) // give the capture a big covariance, otherwise it will be so small that it won't pass following assertions @@ -90,7 +90,7 @@ class FeatureImu_test : public testing::Test //emplace Frame ts = problem->getTimeStamp(); state_vec = problem->getState().vector(problem->getFrameStructure()); - last_frame = problem->emplaceFrame(KEY, ts, state_vec); + last_frame = problem->emplaceKeyFrame(ts, state_vec); //emplace a feature delta_preint = processor_motion_ptr_->getMotion().delta_integr_; diff --git a/test/gtest_imu.cpp b/test/gtest_imu.cpp index 7fcf66fc8..98695a245 100644 --- a/test/gtest_imu.cpp +++ b/test/gtest_imu.cpp @@ -503,7 +503,7 @@ class Process_Factor_Imu : public testing::Test virtual void buildProblem() { // ===================================== SET KF in Wolf tree - FrameBasePtr KF = problem->emplaceFrame(KEY, t, x1_exact); + FrameBasePtr KF = problem->emplaceKeyFrame(t, x1_exact); // ===================================== Imu CALLBACK problem->keyFrameCallback(KF, nullptr, dt/2); diff --git a/test/gtest_processor_imu.cpp b/test/gtest_processor_imu.cpp index ce1ea5060..d04e18cbc 100644 --- a/test/gtest_processor_imu.cpp +++ b/test/gtest_processor_imu.cpp @@ -176,9 +176,8 @@ TEST(ProcessorImu, voteForKeyFrame) /*There should be 3 frames : - 1 KeyFrame at origin - 1 keyframe created by process() in voteForKeyFrame() since conditions to create a keyframe are met - - 1 frame that would be used by future data */ - ASSERT_EQ(problem->getTrajectory()->getFrameList().size(),(unsigned int) 3); + ASSERT_EQ(problem->getTrajectory()->getFrameList().size(),(unsigned int) 2); /* if max_time_span == 2, Wolf tree should be -- GitLab