/** * \brief The random generated maps used in the tests are sound. */ TEST_F(CMap2Test, random_map_generators) { add_faces(NB_MAX); EXPECT_TRUE(cmap_.check_map_integrity()); add_closed_surfaces(); EXPECT_TRUE(cmap_.check_map_integrity()); }
/** * \brief Adding faces preserves the cell indexation */ TEST_F(CMap1Test, add_face) { uint32 count_vertices = add_faces(NB_MAX); EXPECT_EQ(cmap_.nb_cells<Vertex::ORBIT>(), count_vertices); EXPECT_EQ(cmap_.nb_cells<Face::ORBIT>(), NB_MAX); EXPECT_TRUE(cmap_.check_map_integrity()); }
/** * \brief Splitting vertices preserves the cell indexation */ TEST_F(CMap1Test, split_vertex) { uint32 count_vertices = add_faces(NB_MAX); for (Dart d : darts_) { cmap_.split_vertex(Vertex(d)); ++count_vertices; } EXPECT_EQ(cmap_.nb_cells<Vertex::ORBIT>(), count_vertices); EXPECT_EQ(cmap_.nb_cells<Face::ORBIT>(), NB_MAX); EXPECT_TRUE(cmap_.check_map_integrity()); }
/** * \brief Removing vertices preserves the cell indexation */ TEST_F(CMap1Test, remove_vertex) { uint32 count_vertices = add_faces(NB_MAX); uint32 count_faces = NB_MAX; for (Dart d: darts_) { uint32 k = cmap_.codegree(Face(d)); cmap_.remove_vertex(Vertex(d)); --count_vertices; if (k == 1u) --count_faces; } EXPECT_EQ(cmap_.nb_cells<Vertex::ORBIT>(), count_vertices); EXPECT_EQ(cmap_.nb_cells<Face::ORBIT>(), count_faces); EXPECT_TRUE(cmap_.check_map_integrity()); }
/** * \brief Removing faces preserves the cell indexation */ TEST_F(CMap1Test, remove_face) { uint32 count_vertices = add_faces(NB_MAX); uint32 count_faces = NB_MAX; for (Dart d : darts_) { if (std::rand() % 3 == 1) { Face f(d); uint32 k = cmap_.codegree(f); cmap_.remove_face(f); count_vertices -= k; --count_faces; } } EXPECT_EQ(cmap_.nb_cells<Vertex::ORBIT>(), count_vertices); EXPECT_EQ(cmap_.nb_cells<Face::ORBIT>(), count_faces); EXPECT_TRUE(cmap_.check_map_integrity()); }