37 #include <gtest/gtest.h>
41 TEST(WorldDiff, TrackChanges)
56 world->addToObject(
"obj1", ball, Eigen::Isometry3d::Identity());
62 EXPECT_NE(diff1.
end(), it);
68 world->addToObject(
"obj2", box, Eigen::Isometry3d::Identity());
74 EXPECT_NE(diff1.
end(), it);
77 world->addToObject(
"obj2", cyl, Eigen::Isometry3d::Identity());
83 EXPECT_NE(diff1.
end(), it);
88 bool move_ok = world->moveShapeInObject(
"obj2", cyl, Eigen::Isometry3d(Eigen::Translation3d(0, 0, 1)));
95 EXPECT_NE(diff1.
end(), it);
101 EXPECT_NE(diff2.
end(), it);
113 world->addToObject(
"obj3", box, Eigen::Isometry3d::Identity());
118 world->addToObject(
"obj3", cyl, Eigen::Isometry3d::Identity());
120 world->addToObject(
"obj3", ball, Eigen::Isometry3d::Identity());
127 move_ok = world->moveShapeInObject(
"obj3", cyl, Eigen::Isometry3d(Eigen::Translation3d(0, 0, 2)));
135 world->removeObject(
"obj2");
141 EXPECT_NE(diff1.
end(), it);
144 EXPECT_NE(diff2.
end(), it);
147 world->removeShapeFromObject(
"obj3", cyl);
150 EXPECT_NE(diff1.
end(), it);
153 EXPECT_NE(diff2.
end(), it);
158 world->removeShapeFromObject(
"obj3", box);
161 EXPECT_NE(diff1.
end(), it);
164 EXPECT_NE(diff2.
end(), it);
169 move_ok = world->moveShapeInObject(
"obj3", ball, Eigen::Isometry3d(Eigen::Translation3d(0, 0, 3)));
173 EXPECT_NE(diff1.
end(), it);
176 EXPECT_NE(diff2.
end(), it);
181 world->removeShapeFromObject(
"obj3", ball);
184 EXPECT_NE(diff1.
end(), it);
187 EXPECT_NE(diff2.
end(), it);
204 world1->addToObject(
"objA1", ball, Eigen::Isometry3d::Identity());
206 world1->addToObject(
"objA2", ball, Eigen::Isometry3d::Identity());
208 world1->addToObject(
"objA3", ball, Eigen::Isometry3d::Identity());
210 world2->addToObject(
"objB1", box, Eigen::Isometry3d::Identity());
212 world2->addToObject(
"objB2", box, Eigen::Isometry3d::Identity());
214 world2->addToObject(
"objB3", box, Eigen::Isometry3d::Identity());
233 EXPECT_NE(diff1.
end(), it);
237 EXPECT_NE(diff1.
end(), it);
241 EXPECT_NE(diff1.
end(), it);
245 EXPECT_NE(diff1.
end(), it);
249 EXPECT_NE(diff1.
end(), it);
253 EXPECT_NE(diff1.
end(), it);
263 EXPECT_NE(diff1b.
end(), it);
267 EXPECT_NE(diff1b.
end(), it);
271 EXPECT_NE(diff1b.
end(), it);
275 EXPECT_NE(diff1b.
end(), it);
279 EXPECT_NE(diff1b.
end(), it);
283 EXPECT_NE(diff1b.
end(), it);
286 world1->addToObject(
"objC", box, Eigen::Isometry3d::Identity());
292 world2->addToObject(
"objC", box, Eigen::Isometry3d::Identity());
305 EXPECT_NE(diff2.
end(), it);
310 world1->addToObject(
"objD", box, Eigen::Isometry3d::Identity());
316 world2->addToObject(
"objE", box, Eigen::Isometry3d::Identity());
323 int main(
int argc,
char** argv)
325 testing::InitGoogleTest(&argc, argv);
326 return RUN_ALL_TESTS();