22 #include "gtest/gtest.h" 28 class FakePoseGraph :
public Trimmable {
30 ~FakePoseGraph()
override {}
32 int num_submaps(
int trajectory_id)
const override {
return 17; }
34 void MarkSubmapAsTrimmed(
const SubmapId& submap_id)
override {
44 TEST(PureLocalizationTrimmerTest, MarksSubmapsAsExpected) {
45 const int kTrajectoryId = 42;
46 PureLocalizationTrimmer trimmer(kTrajectoryId, 15);
47 FakePoseGraph fake_pose_graph;
48 trimmer.Trim(&fake_pose_graph);
50 const auto trimmed_submaps = fake_pose_graph.trimmed_submaps();
51 ASSERT_EQ(2, trimmed_submaps.size());
52 EXPECT_EQ((SubmapId{kTrajectoryId, 0}), trimmed_submaps[0]);
53 EXPECT_EQ((SubmapId{kTrajectoryId, 1}), trimmed_submaps[1]);
std::vector< SubmapId > trimmed_submaps_