Add unit test with extra elements
This commit is contained in:
BIN
src/Unittests/TestFiles/cube-minimal-extra-elements-binary.ply
Normal file
BIN
src/Unittests/TestFiles/cube-minimal-extra-elements-binary.ply
Normal file
Binary file not shown.
38
src/Unittests/TestFiles/cube-minimal-extra-elements.ply
Normal file
38
src/Unittests/TestFiles/cube-minimal-extra-elements.ply
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
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
|
||||||
@@ -691,5 +691,41 @@ TEST_F(OpenMeshReadWritePLY, WriteReadBinaryPLYWithCustomProps) {
|
|||||||
|
|
||||||
//remove(outFilename);
|
//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!";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user