From bbb3a55ee729dd0b14477da9b3b7d5b89297a72b Mon Sep 17 00:00:00 2001 From: Hans-Christian Ebke Date: Fri, 20 Sep 2013 14:21:08 +0000 Subject: [PATCH] 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 --- src/Unittests/CMakeLists.txt | 3 +- src/Unittests/unittests.cc | 40 ------------------- ...ests_add_face.hh => unittests_add_face.cc} | 8 ++-- ...ests_boundary.hh => unittests_boundary.cc} | 8 ++-- ...ts_decimater.hh => unittests_decimater.cc} | 7 ++-- ...elete_face.hh => unittests_delete_face.cc} | 7 ++-- ...ess_mesh.hh => unittests_faceless_mesh.cc} | 7 ++-- ...decimater.hh => unittests_mc_decimater.cc} | 7 ++-- src/Unittests/unittests_mesh_cast.cc | 33 +++++++++++++++ ...ts_mesh_dual.hh => unittests_mesh_dual.cc} | 7 ++-- ...imater.hh => unittests_mixed_decimater.cc} | 7 ++-- ...ests_property.hh => unittests_property.cc} | 7 ++-- ....hh => unittests_randomNumberGenerator.cc} | 7 ++-- ...ite_OBJ.hh => unittests_read_write_OBJ.cc} | 7 ++-- ...ite_OFF.hh => unittests_read_write_OFF.cc} | 8 ++-- ...write_OM.hh => unittests_read_write_OM.cc} | 8 ++-- ...ite_PLY.hh => unittests_read_write_PLY.cc} | 8 ++-- ...ite_STL.hh => unittests_read_write_STL.cc} | 7 ++-- ..._split_copy.hh => unittests_split_copy.cc} | 7 ++-- ..._stripifier.hh => unittests_stripifier.cc} | 7 ++-- ...ve.hh => unittests_subdivider_adaptive.cc} | 7 ++-- ...orm.hh => unittests_subdivider_uniform.cc} | 7 ++-- ...or_current_halfedge_handle_replacement.cc} | 7 ++-- ...unittests_trimesh_circulator_face_edge.cc} | 7 ++-- ...unittests_trimesh_circulator_face_face.cc} | 7 ++-- ...tests_trimesh_circulator_face_halfedge.cc} | 6 +-- ...ittests_trimesh_circulator_face_vertex.cc} | 4 +- ...ittests_trimesh_circulator_vertex_edge.cc} | 7 ++-- ...ittests_trimesh_circulator_vertex_face.cc} | 5 ++- ...ts_trimesh_circulator_vertex_ihalfedge.cc} | 6 +-- ...ts_trimesh_circulator_vertex_ohalfedge.cc} | 7 ++-- ...tests_trimesh_circulator_vertex_vertex.cc} | 6 +-- ...lapse.hh => unittests_trimesh_collapse.cc} | 8 ++-- ...> unittests_trimesh_garbage_collection.cc} | 8 ++-- ...tors.hh => unittests_trimesh_iterators.cc} | 8 ++-- ... unittests_trimesh_normal_calculations.cc} | 8 ++-- ..._others.hh => unittests_trimesh_others.cc} | 8 ++-- ...ector_type.hh => unittests_vector_type.cc} | 8 ++-- 38 files changed, 140 insertions(+), 184 deletions(-) rename src/Unittests/{unittests_add_face.hh => unittests_add_face.cc} (98%) rename src/Unittests/{unittests_boundary.hh => unittests_boundary.cc} (98%) rename src/Unittests/{unittests_decimater.hh => unittests_decimater.cc} (97%) rename src/Unittests/{unittests_delete_face.hh => unittests_delete_face.cc} (99%) rename src/Unittests/{unittests_faceless_mesh.hh => unittests_faceless_mesh.cc} (93%) rename src/Unittests/{unittests_mc_decimater.hh => unittests_mc_decimater.cc} (97%) create mode 100644 src/Unittests/unittests_mesh_cast.cc rename src/Unittests/{unittests_mesh_dual.hh => unittests_mesh_dual.cc} (92%) rename src/Unittests/{unittests_mixed_decimater.hh => unittests_mixed_decimater.cc} (97%) rename src/Unittests/{unittests_property.hh => unittests_property.cc} (99%) rename src/Unittests/{unittests_randomNumberGenerator.hh => unittests_randomNumberGenerator.cc} (94%) rename src/Unittests/{unittests_read_write_OBJ.hh => unittests_read_write_OBJ.cc} (99%) rename src/Unittests/{unittests_read_write_OFF.hh => unittests_read_write_OFF.cc} (98%) rename src/Unittests/{unittests_read_write_OM.hh => unittests_read_write_OM.cc} (99%) rename src/Unittests/{unittests_read_write_PLY.hh => unittests_read_write_PLY.cc} (99%) rename src/Unittests/{unittests_read_write_STL.hh => unittests_read_write_STL.cc} (94%) rename src/Unittests/{unittests_split_copy.hh => unittests_split_copy.cc} (97%) rename src/Unittests/{unittests_stripifier.hh => unittests_stripifier.cc} (91%) rename src/Unittests/{unittests_subdivider_adaptive.hh => unittests_subdivider_adaptive.cc} (98%) rename src/Unittests/{unittests_subdivider_uniform.hh => unittests_subdivider_uniform.cc} (98%) rename src/Unittests/{unittests_trimesh_circulator_current_halfedge_handle_replacement.hh => unittests_trimesh_circulator_current_halfedge_handle_replacement.cc} (97%) rename src/Unittests/{unittests_trimesh_circulator_face_edge.hh => unittests_trimesh_circulator_face_edge.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_face_face.hh => unittests_trimesh_circulator_face_face.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_face_halfedge.hh => unittests_trimesh_circulator_face_halfedge.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_face_vertex.hh => unittests_trimesh_circulator_face_vertex.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_vertex_edge.hh => unittests_trimesh_circulator_vertex_edge.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_vertex_face.hh => unittests_trimesh_circulator_vertex_face.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_vertex_ihalfedge.hh => unittests_trimesh_circulator_vertex_ihalfedge.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_vertex_ohalfedge.hh => unittests_trimesh_circulator_vertex_ohalfedge.cc} (99%) rename src/Unittests/{unittests_trimesh_circulator_vertex_vertex.hh => unittests_trimesh_circulator_vertex_vertex.cc} (99%) rename src/Unittests/{unittests_trimesh_collapse.hh => unittests_trimesh_collapse.cc} (99%) rename src/Unittests/{unittests_trimesh_garbage_collection.hh => unittests_trimesh_garbage_collection.cc} (99%) rename src/Unittests/{unittests_trimesh_iterators.hh => unittests_trimesh_iterators.cc} (99%) rename src/Unittests/{unittests_trimesh_normal_calculations.hh => unittests_trimesh_normal_calculations.cc} (95%) rename src/Unittests/{unittests_trimesh_others.hh => unittests_trimesh_others.cc} (97%) rename src/Unittests/{unittests_vector_type.hh => unittests_vector_type.cc} (91%) diff --git a/src/Unittests/CMakeLists.txt b/src/Unittests/CMakeLists.txt index 03140eb2..1622b72a 100644 --- a/src/Unittests/CMakeLists.txt +++ b/src/Unittests/CMakeLists.txt @@ -27,7 +27,8 @@ if ( OPENMESH_BUILD_UNIT_TESTS ) endif() # Create new target named unittests_hexmeshing - add_executable(unittests unittests.cc) + FILE(GLOB UNITTEST_SRC *.cc) + add_executable(unittests ${UNITTEST_SRC}) if ( NOT WIN32) # Link against all necessary libraries diff --git a/src/Unittests/unittests.cc b/src/Unittests/unittests.cc index dd1042d0..2965ecb1 100644 --- a/src/Unittests/unittests.cc +++ b/src/Unittests/unittests.cc @@ -1,45 +1,5 @@ #include -#include "unittests_common.hh" -#include "unittests_property.hh" -#include "unittests_read_write_OBJ.hh" -#include "unittests_read_write_OFF.hh" -#include "unittests_read_write_OM.hh" -#include "unittests_read_write_PLY.hh" -#include "unittests_read_write_STL.hh" -#include "unittests_trimesh_iterators.hh" -#include "unittests_trimesh_collapse.hh" -#include "unittests_decimater.hh" -#include "unittests_mc_decimater.hh" -#include "unittests_mesh_dual.hh" -#include "unittests_mixed_decimater.hh" -#include "unittests_stripifier.hh" -#include "unittests_subdivider_uniform.hh" -#include "unittests_subdivider_adaptive.hh" -#include "unittests_trimesh_normal_calculations.hh" -#include "unittests_trimesh_others.hh" -#include "unittests_add_face.hh" -#include "unittests_delete_face.hh" -#include "unittests_faceless_mesh.hh" -#include "unittests_trimesh_garbage_collection.hh" -#include "unittests_randomNumberGenerator.hh" -#include "unittests_split_copy.hh" -#include "unittests_vector_type.hh" -#include "unittests_boundary.hh" - -// Circulators on triangular meshes -#include "unittests_trimesh_circulator_face_edge.hh" -#include "unittests_trimesh_circulator_face_face.hh" -#include "unittests_trimesh_circulator_face_halfedge.hh" -#include "unittests_trimesh_circulator_face_vertex.hh" -#include "unittests_trimesh_circulator_vertex_edge.hh" -#include "unittests_trimesh_circulator_vertex_face.hh" -#include "unittests_trimesh_circulator_vertex_ihalfedge.hh" -#include "unittests_trimesh_circulator_vertex_ihalfedge.hh" -#include "unittests_trimesh_circulator_vertex_ohalfedge.hh" -#include "unittests_trimesh_circulator_vertex_vertex.hh" -#include "unittests_trimesh_circulator_current_halfedge_handle_replacement.hh" - int main(int _argc, char** _argv) { testing::InitGoogleTest(&_argc, _argv); diff --git a/src/Unittests/unittests_add_face.hh b/src/Unittests/unittests_add_face.cc similarity index 98% rename from src/Unittests/unittests_add_face.hh rename to src/Unittests/unittests_add_face.cc index e7ed0bb0..8f53c82c 100644 --- a/src/Unittests/unittests_add_face.hh +++ b/src/Unittests/unittests_add_face.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_OpenMeshAddFaceTriangleMesh_HH -#define INCLUDE_UNITTESTS_OpenMeshAddFaceTriangleMesh_HH - #include #include #include +namespace { + class OpenMeshAddFaceTriangleMesh : public OpenMeshBase { protected: @@ -429,5 +428,4 @@ TEST_F(OpenMeshAddFacePolyMesh, CreatePolyMeshCube) { } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_boundary.hh b/src/Unittests/unittests_boundary.cc similarity index 98% rename from src/Unittests/unittests_boundary.hh rename to src/Unittests/unittests_boundary.cc index 1781da75..ca93d881 100644 --- a/src/Unittests/unittests_boundary.hh +++ b/src/Unittests/unittests_boundary.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_BOUNDARY_HH -#define INCLUDE_UNITTESTS_BOUNDARY_HH - #include #include #include +namespace { + class OpenMeshBoundaryTriangleMesh : public OpenMeshBase { protected: @@ -189,5 +188,4 @@ TEST_F(OpenMeshBoundaryTriangleMesh, TestBoundaryFace) { EXPECT_TRUE ( mesh_.is_boundary( face_handles[4] ) ) << "Face 4 is not boundary!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_decimater.hh b/src/Unittests/unittests_decimater.cc similarity index 97% rename from src/Unittests/unittests_decimater.hh rename to src/Unittests/unittests_decimater.cc index 3b690586..13295f9e 100644 --- a/src/Unittests/unittests_decimater.hh +++ b/src/Unittests/unittests_decimater.cc @@ -1,5 +1,3 @@ -#ifndef INCLUDE_UNITTESTS_DECIMATER_HH -#define INCLUDE_UNITTESTS_DECIMATER_HH #include #include @@ -7,6 +5,8 @@ #include #include +namespace { + class OpenMeshDecimater : public OpenMeshBase { protected: @@ -106,5 +106,4 @@ TEST_F(OpenMeshDecimater, DecimateMeshToFaceFaceLimit) { EXPECT_EQ(14994u, mesh_.n_edges()) << "The number of edges after decimation is not correct!"; EXPECT_EQ(9996u, mesh_.n_faces()) << "The number of faces after decimation is not correct!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_delete_face.hh b/src/Unittests/unittests_delete_face.cc similarity index 99% rename from src/Unittests/unittests_delete_face.hh rename to src/Unittests/unittests_delete_face.cc index 4bd92d9a..7b663a51 100644 --- a/src/Unittests/unittests_delete_face.hh +++ b/src/Unittests/unittests_delete_face.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_OpenMeshDeleteFaceTriangleMesh_HH -#define INCLUDE_UNITTESTS_OpenMeshDeleteFaceTriangleMesh_HH #include #include #include +namespace { + class OpenMeshDeleteFaceTriangleMesh : public OpenMeshBase { protected: @@ -613,5 +613,4 @@ TEST_F(OpenMeshDeleteFacePolyMesh, DeleteteHalfPolyMeshCubeWithEdgeStatus) { } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_faceless_mesh.hh b/src/Unittests/unittests_faceless_mesh.cc similarity index 93% rename from src/Unittests/unittests_faceless_mesh.hh rename to src/Unittests/unittests_faceless_mesh.cc index 95c6a7ca..cb49b5f9 100644 --- a/src/Unittests/unittests_faceless_mesh.hh +++ b/src/Unittests/unittests_faceless_mesh.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_OpenMeshFacelessTriangleMesh_HH -#define INCLUDE_UNITTESTS_OpenMeshFacelessTriangleMesh_HH #include #include #include +namespace { + class OpenMeshFacelessMesh : public OpenMeshBase { protected: @@ -65,5 +65,4 @@ class OpenMeshFacelessMesh : public OpenMeshBase { // //} - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_mc_decimater.hh b/src/Unittests/unittests_mc_decimater.cc similarity index 97% rename from src/Unittests/unittests_mc_decimater.hh rename to src/Unittests/unittests_mc_decimater.cc index ed6f2c7a..70273360 100644 --- a/src/Unittests/unittests_mc_decimater.hh +++ b/src/Unittests/unittests_mc_decimater.cc @@ -1,5 +1,3 @@ -#ifndef INCLUDE_UNITTESTS_MC_DECIMATER_HH -#define INCLUDE_UNITTESTS_MC_DECIMATER_HH #include #include @@ -7,6 +5,8 @@ #include #include +namespace { + class OpenMeshMultipleChoiceDecimater : public OpenMeshBase { protected: @@ -106,5 +106,4 @@ TEST_F(OpenMeshMultipleChoiceDecimater, DecimateMeshToFaceFaceLimit) { EXPECT_EQ(14994u, mesh_.n_edges()) << "The number of edges after decimation is not correct!"; EXPECT_EQ(9996u, mesh_.n_faces()) << "The number of faces after decimation is not correct!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_mesh_cast.cc b/src/Unittests/unittests_mesh_cast.cc new file mode 100644 index 00000000..0dabce74 --- /dev/null +++ b/src/Unittests/unittests_mesh_cast.cc @@ -0,0 +1,33 @@ +#include + +#include + +#include + + +namespace { + +class OpenMeshMeshCastTest: public testing::Test { +}; + +struct TriTraits1: public OpenMesh::DefaultTraits { + typedef OpenMesh::Vec3d Point; +}; +struct TriTraits2: public OpenMesh::DefaultTraits { + typedef OpenMesh::Vec3d Point; +}; + +TEST_F(OpenMeshMeshCastTest, PerformCast) { + OpenMesh::TriMesh_ArrayKernelT a; + OpenMesh::TriMesh_ArrayKernelT &b = + OpenMesh::mesh_cast&>(a); + /* + OpenMesh::TriMesh_ArrayKernelT < TriTraits2 > &b = + OpenMesh::MeshCast< + TriMesh_ArrayKernelT&, + OpenMesh::TriMesh_ArrayKernelT& + >::cast(a); + */ +} + +} diff --git a/src/Unittests/unittests_mesh_dual.hh b/src/Unittests/unittests_mesh_dual.cc similarity index 92% rename from src/Unittests/unittests_mesh_dual.hh rename to src/Unittests/unittests_mesh_dual.cc index 604609c4..c09ab4bf 100644 --- a/src/Unittests/unittests_mesh_dual.hh +++ b/src/Unittests/unittests_mesh_dual.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_MESHDUAL_HH -#define INCLUDE_UNITTESTS_MESHDUAL_HH #include #include #include +namespace { + class OpenMeshMeshDual : public OpenMeshBasePoly { protected: @@ -49,5 +49,4 @@ TEST_F(OpenMeshMeshDual, Dualize) { delete(dualMesh); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_mixed_decimater.hh b/src/Unittests/unittests_mixed_decimater.cc similarity index 97% rename from src/Unittests/unittests_mixed_decimater.hh rename to src/Unittests/unittests_mixed_decimater.cc index 3b139519..76f9200e 100644 --- a/src/Unittests/unittests_mixed_decimater.hh +++ b/src/Unittests/unittests_mixed_decimater.cc @@ -1,5 +1,3 @@ -#ifndef INCLUDE_UNITTESTS_MIXED_DECIMATER_HH -#define INCLUDE_UNITTESTS_MIXED_DECIMATER_HH #include #include @@ -7,6 +5,8 @@ #include #include +namespace { + class OpenMeshMixedDecimater : public OpenMeshBase { protected: @@ -106,5 +106,4 @@ TEST_F(OpenMeshMixedDecimater, DecimateMeshToFaceFaceLimit) { EXPECT_EQ(14994u, mesh_.n_edges()) << "The number of edges after decimation is not correct!"; EXPECT_EQ(9996u, mesh_.n_faces()) << "The number of faces after decimation is not correct!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_property.hh b/src/Unittests/unittests_property.cc similarity index 99% rename from src/Unittests/unittests_property.hh rename to src/Unittests/unittests_property.cc index f6f5704d..f6f78036 100644 --- a/src/Unittests/unittests_property.hh +++ b/src/Unittests/unittests_property.cc @@ -1,9 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_PROPERTY_HH -#define INCLUDE_UNITTESTS_PROPERTY_HH #include #include +namespace { + class OpenMeshProperties : public OpenMeshBase { protected: @@ -596,5 +596,4 @@ TEST_F(OpenMeshProperties, CopyAllPropertiesVertexAfterRemoveOfProperty) { - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_randomNumberGenerator.hh b/src/Unittests/unittests_randomNumberGenerator.cc similarity index 94% rename from src/Unittests/unittests_randomNumberGenerator.hh rename to src/Unittests/unittests_randomNumberGenerator.cc index 31171541..aa232afa 100644 --- a/src/Unittests/unittests_randomNumberGenerator.hh +++ b/src/Unittests/unittests_randomNumberGenerator.cc @@ -1,9 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_RANDOMNUMBER_HH -#define INCLUDE_UNITTESTS_RANDOMNUMBER_HH #include #include +namespace { + class RandomNumberGenerator : public testing::Test { protected: @@ -89,5 +89,4 @@ TEST_F(RandomNumberGenerator, RandomNumberGeneratorMaxTestLowres) { EXPECT_TRUE( (average - 0.5) < 0.01 ) << "Expected value not 0.5"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_read_write_OBJ.hh b/src/Unittests/unittests_read_write_OBJ.cc similarity index 99% rename from src/Unittests/unittests_read_write_OBJ.hh rename to src/Unittests/unittests_read_write_OBJ.cc index 6c4dc762..647c2619 100644 --- a/src/Unittests/unittests_read_write_OBJ.hh +++ b/src/Unittests/unittests_read_write_OBJ.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_READ_WRITE_OBJ_HH -#define INCLUDE_UNITTESTS_READ_WRITE_OBJ_HH #include #include +namespace { + class OpenMeshReadWriteOBJ : public OpenMeshBase { protected: @@ -292,5 +292,4 @@ TEST_F(OpenMeshReadWriteOBJ, LoadSimpleOBJWithVertexColorsAsVCLines) { mesh_.release_vertex_colors(); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_read_write_OFF.hh b/src/Unittests/unittests_read_write_OFF.cc similarity index 98% rename from src/Unittests/unittests_read_write_OFF.hh rename to src/Unittests/unittests_read_write_OFF.cc index d2ebe4f0..69ecfced 100644 --- a/src/Unittests/unittests_read_write_OFF.hh +++ b/src/Unittests/unittests_read_write_OFF.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_READ_WRITE_OFF_HH -#define INCLUDE_UNITTESTS_READ_WRITE_OFF_HH - #include #include +namespace { + class OpenMeshReadWriteOFF : public OpenMeshBase { protected: @@ -203,5 +202,4 @@ TEST_F(OpenMeshReadWriteOFF, WriteAndReadBinaryFloatVertexColorsToAndFromOFFFile mesh_.release_vertex_colors(); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_read_write_OM.hh b/src/Unittests/unittests_read_write_OM.cc similarity index 99% rename from src/Unittests/unittests_read_write_OM.hh rename to src/Unittests/unittests_read_write_OM.cc index eb8bbd3d..3be03780 100644 --- a/src/Unittests/unittests_read_write_OM.hh +++ b/src/Unittests/unittests_read_write_OM.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_READ_WRITE_OM_HH -#define INCLUDE_UNITTESTS_READ_WRITE_OM_HH - #include #include +namespace { + class OpenMeshReadWriteOM : public OpenMeshBase { protected: @@ -671,5 +670,4 @@ TEST_F(OpenMeshReadWriteOM, ReadBigMeshWithCustomProperty) { EXPECT_FALSE(wrong) << "min one vertex has worng vertex property"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_read_write_PLY.hh b/src/Unittests/unittests_read_write_PLY.cc similarity index 99% rename from src/Unittests/unittests_read_write_PLY.hh rename to src/Unittests/unittests_read_write_PLY.cc index 5a2335a5..73bbeff9 100644 --- a/src/Unittests/unittests_read_write_PLY.hh +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_READ_WRITE_PLY_HH -#define INCLUDE_UNITTESTS_READ_WRITE_PLY_HH - #include #include +namespace { + class OpenMeshReadWritePLY : public OpenMeshBase { protected: @@ -440,5 +439,4 @@ TEST_F(OpenMeshReadWritePLY, LoadSimplePLYWithNormals) { mesh_.release_vertex_normals(); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_read_write_STL.hh b/src/Unittests/unittests_read_write_STL.cc similarity index 94% rename from src/Unittests/unittests_read_write_STL.hh rename to src/Unittests/unittests_read_write_STL.cc index 4a44177f..c1e5b493 100644 --- a/src/Unittests/unittests_read_write_STL.hh +++ b/src/Unittests/unittests_read_write_STL.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_READ_WRITE_STL_HH -#define INCLUDE_UNITTESTS_READ_WRITE_STL_HH #include #include +namespace { + class OpenMeshReadWriteSTL : public OpenMeshBase { protected: @@ -67,5 +67,4 @@ TEST_F(OpenMeshReadWriteSTL, LoadSimpleSTLBinaryFile) { EXPECT_EQ(15048u , mesh_.n_faces()) << "The number of loaded faces is not correct!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_split_copy.hh b/src/Unittests/unittests_split_copy.cc similarity index 97% rename from src/Unittests/unittests_split_copy.hh rename to src/Unittests/unittests_split_copy.cc index 48e0d437..2422a977 100644 --- a/src/Unittests/unittests_split_copy.hh +++ b/src/Unittests/unittests_split_copy.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_OpenMeshSplitCopy_HH -#define INCLUDE_UNITTESTS_OpenMeshSplitCopy_HH #include #include #include +namespace { + class OpenMeshSplitCopyTriangleMesh : public OpenMeshBase { protected: @@ -145,5 +145,4 @@ TEST_F(OpenMeshSplitCopyPolyMesh, SplitCopyPolymesh) { EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) << "Different Property value"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_stripifier.hh b/src/Unittests/unittests_stripifier.cc similarity index 91% rename from src/Unittests/unittests_stripifier.hh rename to src/Unittests/unittests_stripifier.cc index 8c1e6ecc..ef403364 100644 --- a/src/Unittests/unittests_stripifier.hh +++ b/src/Unittests/unittests_stripifier.cc @@ -1,10 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_STRIPIFIER_HH -#define INCLUDE_UNITTESTS_STRIPIFIER_HH #include #include #include +namespace { + class OpenMeshStripify : public OpenMeshBase { protected: @@ -47,5 +47,4 @@ TEST_F(OpenMeshStripify, Stripify) { EXPECT_TRUE(stripifier.is_valid()) << "Strips not computed!"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_subdivider_adaptive.hh b/src/Unittests/unittests_subdivider_adaptive.cc similarity index 98% rename from src/Unittests/unittests_subdivider_adaptive.hh rename to src/Unittests/unittests_subdivider_adaptive.cc index bfbafbef..83d98528 100644 --- a/src/Unittests/unittests_subdivider_adaptive.hh +++ b/src/Unittests/unittests_subdivider_adaptive.cc @@ -1,11 +1,11 @@ -#ifndef INCLUDE_UNITTESTS_SUBIVIDER_ADAPTIVE_HH -#define INCLUDE_UNITTESTS_SUBIVIDER_ADAPTIVE_HH #include #include #include #include +namespace { + class OpenMeshSubdividerAdaptive_Poly : public OpenMeshBasePoly { protected: @@ -299,5 +299,4 @@ TEST_F(OpenMeshSubdividerAdaptive_Triangle, AdaptiveCompositeRefineFace) { EXPECT_EQ(458u, mesh.n_faces() ) << "Wrong number of faces after subdivision with sqrt3"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_subdivider_uniform.hh b/src/Unittests/unittests_subdivider_uniform.cc similarity index 98% rename from src/Unittests/unittests_subdivider_uniform.hh rename to src/Unittests/unittests_subdivider_uniform.cc index 2c571797..d75f0304 100644 --- a/src/Unittests/unittests_subdivider_uniform.hh +++ b/src/Unittests/unittests_subdivider_uniform.cc @@ -1,11 +1,11 @@ -#ifndef INCLUDE_UNITTESTS_SUBIVIDER_UNIFORM_HH -#define INCLUDE_UNITTESTS_SUBIVIDER_UNIFORM_HH #include #include #include #include +namespace { + class OpenMeshSubdividerUniform_Poly : public OpenMeshBasePoly { protected: @@ -244,5 +244,4 @@ TEST_F(OpenMeshSubdividerUniform_Poly, Subdivider_CatmullClark) { EXPECT_EQ(256u, mesh_.n_faces() ) << "Wrong number of faces after subdivision with catmull clark"; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.hh b/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc similarity index 97% rename from src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.hh rename to src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc index 3d181ee0..84a172bb 100644 --- a/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.hh +++ b/src/Unittests/unittests_trimesh_circulator_current_halfedge_handle_replacement.cc @@ -1,11 +1,11 @@ -#ifndef UNITTESTS_TRIMESH_CIRCULATOR_CURRENT_HANDLE_REPLACEMENT_HH -#define UNITTESTS_TRIMESH_CIRCULATOR_CURRENT_HANDLE_REPLACEMENT_HH #include #include #include +namespace { + class OpenMeshTrimeshCirculatorCurrentHalfedgeHandleReplacement : public OpenMeshBase { protected: @@ -275,5 +275,4 @@ TEST_F(OpenMeshTrimeshCirculatorCurrentHalfedgeHandleReplacement, fe_iter) { EXPECT_EQ(heh0[i], heh1[i]) << "halfedge handles do not match"; } - -#endif // UNITTESTS_TRIMESH_CIRCULATOR_CURRENT_HANDLE_REPLACEMENT_HH +} diff --git a/src/Unittests/unittests_trimesh_circulator_face_edge.hh b/src/Unittests/unittests_trimesh_circulator_face_edge.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_face_edge.hh rename to src/Unittests/unittests_trimesh_circulator_face_edge.cc index 87e453e8..c95460e8 100644 --- a/src/Unittests/unittests_trimesh_circulator_face_edge.hh +++ b/src/Unittests/unittests_trimesh_circulator_face_edge.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorFaceEdge : public OpenMeshBase { protected: @@ -127,7 +127,7 @@ TEST_F(OpenMeshTrimeshCirculatorFaceEdge, FaceEdgeIterWithoutHolesIncrement) { EXPECT_TRUE( cfe_it == cfe_end ) << "End iterator for ConstFaceEdgeIter not matching"; } - +} /* * Small FaceEdgeIterator Test @@ -224,5 +224,4 @@ TEST_F(OpenMeshTrimeshCirculatorFaceEdge, FaceEdgeIterWithoutHolesDecrement) { EXPECT_TRUE( cfe_it == cfe_end ) << "End iterator for ConstFaceEdgeIter not matching"; } - */ diff --git a/src/Unittests/unittests_trimesh_circulator_face_face.hh b/src/Unittests/unittests_trimesh_circulator_face_face.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_face_face.hh rename to src/Unittests/unittests_trimesh_circulator_face_face.cc index b7bc5419..b8fc1b5c 100644 --- a/src/Unittests/unittests_trimesh_circulator_face_face.hh +++ b/src/Unittests/unittests_trimesh_circulator_face_face.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorFaceFace : public OpenMeshBase { protected: @@ -262,5 +262,4 @@ TEST_F(OpenMeshTrimeshCirculatorFaceFace, FaceFaceIteratorHandleConversion) { EXPECT_EQ(1, faceHandle1.idx() ) << "Wrong face handle index when getting from iterator via handle"; } - - +} diff --git a/src/Unittests/unittests_trimesh_circulator_face_halfedge.hh b/src/Unittests/unittests_trimesh_circulator_face_halfedge.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_face_halfedge.hh rename to src/Unittests/unittests_trimesh_circulator_face_halfedge.cc index 401eecf6..b577a0cc 100644 --- a/src/Unittests/unittests_trimesh_circulator_face_halfedge.hh +++ b/src/Unittests/unittests_trimesh_circulator_face_halfedge.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorFaceHalfEdge : public OpenMeshBase { protected: @@ -126,4 +126,4 @@ TEST_F(OpenMeshTrimeshCirculatorFaceHalfEdge, FaceHalfedgeIterWithoutHolesIncrem EXPECT_TRUE( cfh_it == cfh_end ) << "End iterator for ConstFaceHalfedgeIter not matching"; } - +} diff --git a/src/Unittests/unittests_trimesh_circulator_face_vertex.hh b/src/Unittests/unittests_trimesh_circulator_face_vertex.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_face_vertex.hh rename to src/Unittests/unittests_trimesh_circulator_face_vertex.cc index ede8016e..e34cab77 100644 --- a/src/Unittests/unittests_trimesh_circulator_face_vertex.hh +++ b/src/Unittests/unittests_trimesh_circulator_face_vertex.cc @@ -1,9 +1,10 @@ -#pragma once #include #include #include +namespace { + class OpenMeshTrimeshCirculatorFaceVertex : public OpenMeshBase { protected: @@ -120,5 +121,6 @@ TEST_F(OpenMeshTrimeshCirculatorFaceVertex, FaceVertexIterWithoutIncrement) { EXPECT_EQ(0, cfv_it->idx() ) << "Index wrong in ConstFaceVertexIter at step 3"; EXPECT_FALSE(cfv_it.is_valid()) << "Iterator invalid in ConstFaceVertexIter at step 3"; EXPECT_TRUE( cfv_it == cfv_end ) << "End iterator for ConstFaceVertexIter not matching"; +} } diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_edge.hh b/src/Unittests/unittests_trimesh_circulator_vertex_edge.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_vertex_edge.hh rename to src/Unittests/unittests_trimesh_circulator_vertex_edge.cc index ce59f6ff..98898b7d 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_edge.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_edge.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorVertexEdge : public OpenMeshBase { protected: @@ -199,5 +199,4 @@ TEST_F(OpenMeshTrimeshCirculatorVertexEdge, VertexEdgeIterBoundaryIncrement) { - - +} diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_face.hh b/src/Unittests/unittests_trimesh_circulator_vertex_face.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_vertex_face.hh rename to src/Unittests/unittests_trimesh_circulator_vertex_face.cc index 488ae66b..4e617072 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_face.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_face.cc @@ -1,9 +1,10 @@ -#pragma once #include #include #include +namespace { + class OpenMeshTrimeshCirculatorVertexFace : public OpenMeshBase { protected: @@ -266,4 +267,4 @@ TEST_F(OpenMeshTrimeshCirculatorVertexFace, VertexFaceIterBoundaryIncrement) { EXPECT_FALSE(vf_it.is_valid()) << "Iterator invalid in VertexFaceIter at step 2"; EXPECT_TRUE( vf_it == vf_end ) << "End iterator for VertexFaceIter not matching"; } - +} diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh b/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh rename to src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.cc index 9c5e9516..34e696d7 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorVertexIHalfEdge : public OpenMeshBase { protected: @@ -310,5 +310,5 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexIncomingHalfedgeDereferen EXPECT_EQ(eh.idx() , 5 ) << "Wrong edge handle after dereferencing"; EXPECT_EQ(heh.idx() , 10 ) << "Wrong half edge handle after dereferencing"; EXPECT_EQ(vh2.idx() , 1 ) << "Wrong vertex handle after dereferencing"; - +} } diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.hh b/src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.hh rename to src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.cc index 12f34a6e..5454a608 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_ohalfedge.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorVertexOHalfEdge : public OpenMeshBase { protected: @@ -312,5 +312,4 @@ TEST_F(OpenMeshTrimeshCirculatorVertexOHalfEdge, VertexOutgoingHalfedgeDereferen EXPECT_EQ(vh2.idx() , 4 ) << "Wrong vertex handle after dereferencing"; } - - +} diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_vertex.hh b/src/Unittests/unittests_trimesh_circulator_vertex_vertex.cc similarity index 99% rename from src/Unittests/unittests_trimesh_circulator_vertex_vertex.hh rename to src/Unittests/unittests_trimesh_circulator_vertex_vertex.cc index 92c0d851..02f51025 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_vertex.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_vertex.cc @@ -1,10 +1,10 @@ -#pragma once - #include #include #include +namespace { + class OpenMeshTrimeshCirculatorVertexVertex : public OpenMeshBase { protected: @@ -198,5 +198,5 @@ TEST_F(OpenMeshTrimeshCirculatorVertexVertex, VertexVertexBoundaryIncrement) { EXPECT_EQ(4, vv_it->idx() ) << "Index wrong in VertexVertexIter step 3"; EXPECT_FALSE(vv_it.is_valid()) << "Iterator invalid in VertexVertexIter at step 3"; EXPECT_TRUE( vv_it == vv_end ) << "Miss matched end iterator"; - +} } diff --git a/src/Unittests/unittests_trimesh_collapse.hh b/src/Unittests/unittests_trimesh_collapse.cc similarity index 99% rename from src/Unittests/unittests_trimesh_collapse.hh rename to src/Unittests/unittests_trimesh_collapse.cc index 32f19b23..d2b0d99b 100644 --- a/src/Unittests/unittests_trimesh_collapse.hh +++ b/src/Unittests/unittests_trimesh_collapse.cc @@ -1,11 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_TRIMESH_COLLAPSE_HH -#define INCLUDE_UNITTESTS_TRIMESH_COLLAPSE_HH - #include #include #include +namespace { + class OpenMeshCollapse : public OpenMeshBase { protected: @@ -608,5 +607,4 @@ TEST_F(OpenMeshCollapse, LargeCollapseHalfEdge) { } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_trimesh_garbage_collection.hh b/src/Unittests/unittests_trimesh_garbage_collection.cc similarity index 99% rename from src/Unittests/unittests_trimesh_garbage_collection.hh rename to src/Unittests/unittests_trimesh_garbage_collection.cc index 18602409..5713bf21 100644 --- a/src/Unittests/unittests_trimesh_garbage_collection.hh +++ b/src/Unittests/unittests_trimesh_garbage_collection.cc @@ -1,11 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_TRIMESH_GARBAGE_COLLECTION_HH -#define INCLUDE_UNITTESTS_TRIMESH_GARBAGE_COLLECTION_HH - #include #include #include +namespace { + class OpenMeshTriMeshGarbageCollection : public OpenMeshBase { protected: @@ -486,5 +485,4 @@ TEST_F(OpenMeshTriMeshGarbageCollection, TrackedGarbageCollection) { } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_trimesh_iterators.hh b/src/Unittests/unittests_trimesh_iterators.cc similarity index 99% rename from src/Unittests/unittests_trimesh_iterators.hh rename to src/Unittests/unittests_trimesh_iterators.cc index 9eb35c28..66846645 100644 --- a/src/Unittests/unittests_trimesh_iterators.hh +++ b/src/Unittests/unittests_trimesh_iterators.cc @@ -1,11 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_TRIMESH_ITERATORS_HH -#define INCLUDE_UNITTESTS_TRIMESH_ITERATORS_HH - #include #include #include +namespace { + class OpenMeshIterators : public OpenMeshBase { protected: @@ -775,5 +774,4 @@ TEST_F(OpenMeshIterators, FaceIterEmptyMeshOneDeletedFace) { mesh_.release_face_status(); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_trimesh_normal_calculations.hh b/src/Unittests/unittests_trimesh_normal_calculations.cc similarity index 95% rename from src/Unittests/unittests_trimesh_normal_calculations.hh rename to src/Unittests/unittests_trimesh_normal_calculations.cc index 12dedd11..e53cb891 100644 --- a/src/Unittests/unittests_trimesh_normal_calculations.hh +++ b/src/Unittests/unittests_trimesh_normal_calculations.cc @@ -1,11 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_NORMAL_CALCULATIONS_HH -#define INCLUDE_UNITTESTS_NORMAL_CALCULATIONS_HH - #include #include #include +namespace { + class OpenMeshNormals : public OpenMeshBase { protected: @@ -106,5 +105,4 @@ TEST_F(OpenMeshNormals, NormalCalculations) { mesh_.update_halfedge_normals(); } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_trimesh_others.hh b/src/Unittests/unittests_trimesh_others.cc similarity index 97% rename from src/Unittests/unittests_trimesh_others.hh rename to src/Unittests/unittests_trimesh_others.cc index c781283f..03b056e7 100644 --- a/src/Unittests/unittests_trimesh_others.hh +++ b/src/Unittests/unittests_trimesh_others.cc @@ -1,11 +1,10 @@ -#ifndef INCLUDE_UNITTESTS_TRIMESH_OTHERS_HH -#define INCLUDE_UNITTESTS_TRIMESH_OTHERS_HH - #include #include #include +namespace { + class OpenMeshOthers : public OpenMeshBase { protected: @@ -173,5 +172,4 @@ TEST_F(OpenMeshOthers, CalcDihedralAngre ) { EXPECT_TRUE( (difference < 0.00001 ) ) << "Wrong Dihedral angle, Difference is to big!" << std::endl; } - -#endif // INCLUDE GUARD +} diff --git a/src/Unittests/unittests_vector_type.hh b/src/Unittests/unittests_vector_type.cc similarity index 91% rename from src/Unittests/unittests_vector_type.hh rename to src/Unittests/unittests_vector_type.cc index d7d184f2..afb7b29e 100644 --- a/src/Unittests/unittests_vector_type.hh +++ b/src/Unittests/unittests_vector_type.cc @@ -1,10 +1,9 @@ -#ifndef INCLUDE_UNITTESTS_OpenMeshVectorTest_HH -#define INCLUDE_UNITTESTS_OpenMeshVectorTest_HH - #include #include #include +namespace { + class OpenMeshVectorTest : public testing::Test { protected: @@ -68,5 +67,4 @@ TEST_F(OpenMeshVectorTest, AbsTest) { - -#endif // INCLUDE GUARD +}