Add unit test with extra elements

This commit is contained in:
Michael Krämer
2017-02-06 18:57:17 +01:00
parent c23ed24aa0
commit 308a280cd7
3 changed files with 74 additions and 0 deletions

View File

@@ -691,5 +691,41 @@ TEST_F(OpenMeshReadWritePLY, WriteReadBinaryPLYWithCustomProps) {
//remove(outFilename);
}
/*
* Just load a ply with extra elements
*/
TEST_F(OpenMeshReadWritePLY, LoadSimplePLYWithExtraElements) {
mesh_.clear();
bool ok = OpenMesh::IO::read_mesh(mesh_, "cube-minimal-extra-elements.ply");
EXPECT_TRUE(ok) << "Unable to load cube-minimal-extra-elements.ply";
EXPECT_EQ(8u, mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
EXPECT_EQ(18u, mesh_.n_edges()) << "The number of loaded edges is not correct!";
EXPECT_EQ(12u, mesh_.n_faces()) << "The number of loaded faces is not correct!";
}
/*
* Just load a binary ply with extra elements
*/
TEST_F(OpenMeshReadWritePLY, LoadSimpleBinaryPLYWithExtraElements) {
mesh_.clear();
OpenMesh::IO::Options options = OpenMesh::IO::Options::Binary;
bool ok = OpenMesh::IO::read_mesh(mesh_, "cube-minimal-extra-elements-binary.ply", options);
EXPECT_TRUE(ok) << "Unable to load cube-minimal-extra-elements-binary.ply";
EXPECT_EQ(8u, mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
EXPECT_EQ(18u, mesh_.n_edges()) << "The number of loaded edges is not correct!";
EXPECT_EQ(12u, mesh_.n_faces()) << "The number of loaded faces is not correct!";
}
}