From 65dd63a73370121da94c39628edb5aeba7450f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Fri, 30 Oct 2020 11:06:21 +0100 Subject: [PATCH] Rename test_MeshDataBase to MeshDataBaseForTests for clarity It looked like `test_MeshDataBase` were tests for a `MeshDataBase` class which does not exists --- tests/CMakeLists.txt | 2 +- ...hDataBase.cpp => MeshDataBaseForTests.cpp} | 16 ++++++------- tests/MeshDataBaseForTests.hpp | 23 +++++++++++++++++++ tests/mpi_test_main.cpp | 6 ++--- tests/test_MeshDataBase.hpp | 23 ------------------- tests/test_main.cpp | 6 ++--- 6 files changed, 38 insertions(+), 38 deletions(-) rename tests/{test_MeshDataBase.cpp => MeshDataBaseForTests.cpp} (56%) create mode 100644 tests/MeshDataBaseForTests.hpp delete mode 100644 tests/test_MeshDataBase.hpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b42964267..11680e00f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -90,7 +90,7 @@ add_executable (mpi_unit_tests ) add_library(test_Pugs_MeshDataBase - test_MeshDataBase.cpp) + MeshDataBaseForTests.cpp) target_link_libraries (unit_tests test_Pugs_MeshDataBase diff --git a/tests/test_MeshDataBase.cpp b/tests/MeshDataBaseForTests.cpp similarity index 56% rename from tests/test_MeshDataBase.cpp rename to tests/MeshDataBaseForTests.cpp index 971f5cd5b..8a873625a 100644 --- a/tests/test_MeshDataBase.cpp +++ b/tests/MeshDataBaseForTests.cpp @@ -1,31 +1,31 @@ -#include <test_MeshDataBase.hpp> +#include <MeshDataBaseForTests.hpp> #include <utils/PugsAssert.hpp> #include <mesh/CartesianMeshBuilder.hpp> -const test_MeshDataBase* test_MeshDataBase::m_instance = nullptr; +const MeshDataBaseForTests* MeshDataBaseForTests::m_instance = nullptr; -test_MeshDataBase::test_MeshDataBase() +MeshDataBaseForTests::MeshDataBaseForTests() { std::make_shared<CartesianMeshBuilder>(TinyVector<3>{0, 1, 0}, TinyVector<3>{2, -1, 3}, TinyVector<3, size_t>{6, 7, 3}); } -const test_MeshDataBase& -test_MeshDataBase::get() +const MeshDataBaseForTests& +MeshDataBaseForTests::get() { return *m_instance; } void -test_MeshDataBase::create() +MeshDataBaseForTests::create() { Assert(m_instance == nullptr); - m_instance = new test_MeshDataBase(); + m_instance = new MeshDataBaseForTests(); } void -test_MeshDataBase::destroy() +MeshDataBaseForTests::destroy() { Assert(m_instance != nullptr); delete m_instance; diff --git a/tests/MeshDataBaseForTests.hpp b/tests/MeshDataBaseForTests.hpp new file mode 100644 index 000000000..31dad8f38 --- /dev/null +++ b/tests/MeshDataBaseForTests.hpp @@ -0,0 +1,23 @@ +#ifndef MESH_DATA_BASE_FOR_TESTS_HPP +#define MESH_DATA_BASE_FOR_TESTS_HPP + +#include <mesh/IMesh.hpp> + +#include <memory> + +class MeshDataBaseForTests +{ + private: + explicit MeshDataBaseForTests(); + + static const MeshDataBaseForTests* m_instance; + + public: + static const MeshDataBaseForTests& get(); + static void create(); + static void destroy(); + + ~MeshDataBaseForTests() = default; +}; + +#endif // MESH_DATA_BASE_FOR_TESTS_HPP diff --git a/tests/mpi_test_main.cpp b/tests/mpi_test_main.cpp index 33ab8ed16..45b733f94 100644 --- a/tests/mpi_test_main.cpp +++ b/tests/mpi_test_main.cpp @@ -10,7 +10,7 @@ #include <utils/Messenger.hpp> #include <utils/pugs_config.hpp> -#include <test_MeshDataBase.hpp> +#include <MeshDataBaseForTests.hpp> #include <cstdlib> #include <filesystem> @@ -58,7 +58,7 @@ main(int argc, char* argv[]) DiamondDualConnectivityManager::create(); DiamondDualMeshManager::create(); - test_MeshDataBase::create(); + MeshDataBaseForTests::create(); if (parallel::rank() == 0) { if (parallel::size() > 1) { @@ -77,7 +77,7 @@ main(int argc, char* argv[]) result = session.run(); - test_MeshDataBase::destroy(); + MeshDataBaseForTests::destroy(); DiamondDualMeshManager::destroy(); DiamondDualConnectivityManager::destroy(); diff --git a/tests/test_MeshDataBase.hpp b/tests/test_MeshDataBase.hpp deleted file mode 100644 index d5e84c8e7..000000000 --- a/tests/test_MeshDataBase.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_MESH_DATA_BASE_HPP -#define TEST_MESH_DATA_BASE_HPP - -#include <mesh/IMesh.hpp> - -#include <memory> - -class test_MeshDataBase -{ - private: - explicit test_MeshDataBase(); - - static const test_MeshDataBase* m_instance; - - public: - static const test_MeshDataBase& get(); - static void create(); - static void destroy(); - - ~test_MeshDataBase() = default; -}; - -#endif // TEST_MESH_DATA_BASE_HPP diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 1f7a5aafe..7ab5a66fb 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -9,7 +9,7 @@ #include <mesh/SynchronizerManager.hpp> #include <utils/Messenger.hpp> -#include <test_MeshDataBase.hpp> +#include <MeshDataBaseForTests.hpp> int main(int argc, char* argv[]) @@ -33,11 +33,11 @@ main(int argc, char* argv[]) DiamondDualConnectivityManager::create(); DiamondDualMeshManager::create(); - test_MeshDataBase::create(); + MeshDataBaseForTests::create(); result = session.run(); - test_MeshDataBase::destroy(); + MeshDataBaseForTests::destroy(); DiamondDualMeshManager::destroy(); DiamondDualConnectivityManager::destroy(); -- GitLab