Commit 308a280c by Michael Krämer

Add unit test with extra elements

1 parent c23ed24a
Pipeline #4252 for 308a280c failed in 75 minutes 52 seconds
ply
format ascii 1.0
element vertex 8
property float32 x
property float32 y
property float32 z
element edge 12
property int32 vertex1
property int32 vertex2
element face 6
property list uint8 int32 vertex_indices
end_header
-1 -1 -1
1 -1 -1
1 1 -1
-1 1 -1
-1 -1 1
1 -1 1
1 1 1
-1 1 1
0 1
1 2
2 3
3 0
4 5
5 6
6 7
7 4
6 2
1 5
3 7
4 0
4 0 1 2 3
4 5 4 7 6
4 6 2 1 5
4 3 7 4 0
4 7 3 2 6
4 5 1 0 4
......@@ -692,4 +692,40 @@ 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!";
}
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!