Added two unittests for loading
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@465 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
23
src/Unittests/TestFiles/pointCloudGoodEncoding.ply
Normal file
23
src/Unittests/TestFiles/pointCloudGoodEncoding.ply
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
ply
|
||||||
|
format ascii 1.0
|
||||||
|
element vertex 10
|
||||||
|
property float x
|
||||||
|
property float y
|
||||||
|
property float z
|
||||||
|
property float nx
|
||||||
|
property float ny
|
||||||
|
property float nz
|
||||||
|
property uchar diffuse_red
|
||||||
|
property uchar diffuse_green
|
||||||
|
property uchar diffuse_blue
|
||||||
|
end_header
|
||||||
|
-0.774382 0.446049 -2.05893 0.386853 -0.197849 0.900667 76 52 41
|
||||||
|
-0.762621 0.446872 -2.06314 0.0431574 -0.643148 0.764525 77 58 46
|
||||||
|
-0.769175 0.436518 -2.0635 0.257818 -0.156835 0.95338 121 97 88
|
||||||
|
-1.07959 0.381204 -1.95964 0.948941 -0.303889 0.0846349 126 117 97
|
||||||
|
-1.05841 0.398189 -1.98803 0.230719 0.341539 0.911109 103 90 86
|
||||||
|
-1.04905 0.388091 -1.97944 -0.0175732 -0.131422 0.991171 72 62 70
|
||||||
|
-0.784233 0.428294 -2.06324 -0.0394355 0.268678 0.962422 167 93 80
|
||||||
|
-0.773624 0.429338 -2.06101 0.373176 -0.105125 0.921785 172 135 126
|
||||||
|
-0.779554 0.433575 -2.06273 -0.0113203 -0.243327 0.969878 165 102 90
|
||||||
|
-0.764714 0.428742 -2.06643 0.31292 -0.294884 0.902843 139 119 109
|
||||||
@@ -51,17 +51,30 @@ TEST_F(OpenMeshLoader, LoadSimpleOFFFile) {
|
|||||||
* Just load a point file in ply format and count whether
|
* Just load a point file in ply format and count whether
|
||||||
* the right number of entities has been loaded.
|
* the right number of entities has been loaded.
|
||||||
*/
|
*/
|
||||||
TEST_F(OpenMeshLoader, LoadSimplePointPLYFileWithEncodingProblems) {
|
TEST_F(OpenMeshLoader, LoadSimplePointPLYFileWithBadEncoding) {
|
||||||
|
|
||||||
bool ok = OpenMesh::IO::read_mesh(mesh_, "pointCloudBadEncoding.ply");
|
bool ok = OpenMesh::IO::read_mesh(mesh_, "pointCloudBadEncoding.ply");
|
||||||
|
|
||||||
EXPECT_TRUE(ok);
|
EXPECT_TRUE(ok) << "Unable to load pointCloudBadEncoding.ply";
|
||||||
|
|
||||||
EXPECT_EQ(10, mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
|
EXPECT_EQ(10, mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
|
||||||
EXPECT_EQ(0, mesh_.n_edges()) << "The number of loaded edges is not correct!";
|
EXPECT_EQ(0, mesh_.n_edges()) << "The number of loaded edges is not correct!";
|
||||||
EXPECT_EQ(0, mesh_.n_faces()) << "The number of loaded faces is not correct!";
|
EXPECT_EQ(0, mesh_.n_faces()) << "The number of loaded faces is not correct!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Just load a point file in ply format and count whether
|
||||||
|
* the right number of entities has been loaded.
|
||||||
|
*/
|
||||||
|
TEST_F(OpenMeshLoader, LoadSimplePointPLYFileWithGoodEncoding) {
|
||||||
|
|
||||||
|
bool ok = OpenMesh::IO::read_mesh(mesh_, "pointCloudGoodEncoding.ply");
|
||||||
|
|
||||||
|
EXPECT_TRUE(ok) << "Unable to load pointCloudGoodEncoding.ply";
|
||||||
|
|
||||||
|
EXPECT_EQ(10, mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
|
||||||
|
EXPECT_EQ(0, mesh_.n_edges()) << "The number of loaded edges is not correct!";
|
||||||
|
EXPECT_EQ(0, mesh_.n_faces()) << "The number of loaded faces is not correct!";
|
||||||
|
}
|
||||||
|
|
||||||
#endif // INCLUDE GUARD
|
#endif // INCLUDE GUARD
|
||||||
|
|||||||
Reference in New Issue
Block a user