From 6b9f6533c2a4d8419a3800f750f54a6d80997852 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 5 Nov 2019 18:40:30 +0100 Subject: [PATCH] reduce the number of vertices in property manager tests if you are not interested in timings --- src/Unittests/unittests_propertymanager.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Unittests/unittests_propertymanager.cc b/src/Unittests/unittests_propertymanager.cc index 5ae91071..5f0a1a1f 100644 --- a/src/Unittests/unittests_propertymanager.cc +++ b/src/Unittests/unittests_propertymanager.cc @@ -6,8 +6,10 @@ //#define ENABLE_PROPERTY_TIMING_OUTPUT #ifdef ENABLE_PROPERTY_TIMING_OUTPUT +#define N_VERTICES_TIMING 1000000 #define TIMING_OUTPUT(X) X #else +#define N_VERTICES_TIMING 10 #define TIMING_OUTPUT(X) #endif @@ -190,7 +192,7 @@ TEST_F(OpenMeshPropertyManager, cpp11_persistent_and_non_owning_properties) { TEST_F(OpenMeshPropertyManager, property_copy_construction) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); // unnamed @@ -223,7 +225,7 @@ TEST_F(OpenMeshPropertyManager, property_copy_construction) { } TEST_F(OpenMeshPropertyManager, property_move_construction) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); // unnamed @@ -268,7 +270,7 @@ TEST_F(OpenMeshPropertyManager, property_move_construction) { TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); // unnamed to unnamed @@ -407,7 +409,7 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) { TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); // unnamed to unnamed @@ -538,7 +540,7 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) { TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); auto copy = mesh_; @@ -673,7 +675,7 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) { TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); auto copy = mesh_; @@ -852,7 +854,7 @@ OpenMesh::VProp get_id_prop(const OpenMesh::PolyConnectivity& mesh) TEST_F(OpenMeshPropertyManager, return_property_from_function) { - for (int i = 0; i < 1000000; ++i) + for (int i = 0; i < N_VERTICES_TIMING; ++i) mesh_.add_vertex(Mesh::Point()); auto t_start = std::chrono::high_resolution_clock::now();