split unittests_loading into seperate files for different file types
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@813 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
71
src/Unittests/unittests_read_write_STL.hh
Normal file
71
src/Unittests/unittests_read_write_STL.hh
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef INCLUDE_UNITTESTS_READ_WRITE_STL_HH
|
||||
#define INCLUDE_UNITTESTS_READ_WRITE_STL_HH
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <Unittests/unittests_common.hh>
|
||||
|
||||
|
||||
class OpenMeshReadWriteSTL : public OpenMeshBase {
|
||||
|
||||
protected:
|
||||
|
||||
// This function is called before each test is run
|
||||
virtual void SetUp() {
|
||||
|
||||
// Do some initial stuff with the member data here...
|
||||
}
|
||||
|
||||
// This function is called after all tests are through
|
||||
virtual void TearDown() {
|
||||
|
||||
// Do some final stuff with the member data here...
|
||||
}
|
||||
|
||||
// Member already defined in OpenMeshBase
|
||||
//Mesh mesh_;
|
||||
};
|
||||
|
||||
/*
|
||||
* ====================================================================
|
||||
* Define tests below
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* Just load a simple mesh file in stla format and count whether
|
||||
* the right number of entities has been loaded.
|
||||
*/
|
||||
TEST_F(OpenMeshReadWriteSTL, LoadSimpleSTLFile) {
|
||||
|
||||
mesh_.clear();
|
||||
|
||||
bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.stl");
|
||||
|
||||
EXPECT_TRUE(ok);
|
||||
|
||||
EXPECT_EQ(7526u , mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
|
||||
EXPECT_EQ(22572u , mesh_.n_edges()) << "The number of loaded edges is not correct!";
|
||||
EXPECT_EQ(15048u , mesh_.n_faces()) << "The number of loaded faces is not correct!";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Just load a simple mesh file in stlb format and count whether
|
||||
* the right number of entities has been loaded.
|
||||
*/
|
||||
TEST_F(OpenMeshReadWriteSTL, LoadSimpleSTLBinaryFile) {
|
||||
|
||||
mesh_.clear();
|
||||
|
||||
bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1Binary.stl");
|
||||
|
||||
EXPECT_TRUE(ok);
|
||||
|
||||
EXPECT_EQ(7526u , mesh_.n_vertices()) << "The number of loaded vertices is not correct!";
|
||||
EXPECT_EQ(22572u , mesh_.n_edges()) << "The number of loaded edges is not correct!";
|
||||
EXPECT_EQ(15048u , mesh_.n_faces()) << "The number of loaded faces is not correct!";
|
||||
}
|
||||
|
||||
|
||||
#endif // INCLUDE GUARD
|
||||
Reference in New Issue
Block a user