Commit e222791c authored by Max Lyon's avatar Max Lyon
Browse files

add test that does some comparisons between smart handles and handles

parent bd337063
......@@ -476,4 +476,30 @@ TEST_F(OpenMeshSmartHandles, MixOldAndNew)
}
/* comparability
*/
TEST_F(OpenMeshSmartHandles, ComparisionBetweenSmartHandleAndNormalHandles)
{
OpenMesh::VertexHandle vh(0);
OpenMesh::SmartVertexHandle svh(0, &mesh_);
EXPECT_EQ(vh, svh) << "Vertex handle and smart vertex handle are different";
std::vector<OpenMesh::VertexHandle> vertices = mesh_.vertices().to_vector([](OpenMesh::SmartVertexHandle _svh) { return OpenMesh::VertexHandle(_svh); });
std::replace(vertices.begin(), vertices.end(), OpenMesh::VertexHandle(0), OpenMesh::VertexHandle(1));
EXPECT_EQ(vertices[0], OpenMesh::VertexHandle(1));
std::vector<OpenMesh::SmartVertexHandle> smart_vertices = mesh_.vertices().to_vector();
std::replace(smart_vertices.begin(), smart_vertices.end(), OpenMesh::SmartVertexHandle(0, &mesh_), OpenMesh::SmartVertexHandle(1, &mesh_));
EXPECT_EQ(smart_vertices[0], OpenMesh::VertexHandle(1));
EXPECT_EQ(smart_vertices[0], OpenMesh::SmartVertexHandle(1, &mesh_));
std::replace(vertices.begin(), vertices.end(), OpenMesh::SmartVertexHandle(1, &mesh_), OpenMesh::SmartVertexHandle(2, &mesh_));
EXPECT_EQ(vertices[0], OpenMesh::VertexHandle(2));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment