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:
Jan Möbius
2011-11-28 08:59:11 +00:00
parent 1d195a9049
commit ee710c8083
3 changed files with 61 additions and 25 deletions

View File

@@ -51,17 +51,30 @@ TEST_F(OpenMeshLoader, LoadSimpleOFFFile) {
* Just load a point file in ply format and count whether
* 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");
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(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!";
}
/*
* 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