Split up unit tests into multiple compile units.
Added mesh_cast unit test. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@958 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
52
src/Unittests/unittests_mesh_dual.cc
Normal file
52
src/Unittests/unittests_mesh_dual.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <Unittests/unittests_common.hh>
|
||||
#include <OpenMesh/Tools/Dualizer/meshDualT.hh>
|
||||
|
||||
namespace {
|
||||
|
||||
class OpenMeshMeshDual : public OpenMeshBasePoly {
|
||||
|
||||
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
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
TEST_F(OpenMeshMeshDual, Dualize) {
|
||||
|
||||
bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off");
|
||||
|
||||
ASSERT_TRUE(ok);
|
||||
|
||||
PolyMesh* dualMesh;
|
||||
|
||||
dualMesh = OpenMesh::Util::MeshDual(mesh_);
|
||||
|
||||
EXPECT_EQ(15048u, dualMesh->n_vertices()) << "The number of vertices after dual computation is not correct!";
|
||||
EXPECT_EQ(22572u, dualMesh->n_edges()) << "The number of edges after dual computation is not correct!";
|
||||
EXPECT_EQ(7526u, dualMesh->n_faces()) << "The number of faces after dual computation is not correct!";
|
||||
|
||||
delete(dualMesh);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user