diff --git a/cgogn/core/basic/cell.h b/cgogn/core/basic/cell.h index 9e597a39..46a9c17a 100644 --- a/cgogn/core/basic/cell.h +++ b/cgogn/core/basic/cell.h @@ -25,6 +25,8 @@ #define CORE_BASIC_CELL_H_ #include + +#include #include /** @@ -60,7 +62,7 @@ inline std::string orbit_name(Orbit orbit) case Orbit::PHI2_PHI3: return "Orbit::PHI2_PHI3"; break; case Orbit::PHI21: return "Orbit::PHI21"; break; case Orbit::PHI21_PHI31: return "Orbit::PHI21_PHI31"; break; - default: cgogn_assert_not_reached("orbit of this name do not exist"); break; + default: cgogn_assert_not_reached("This orbit does not exist"); break; } return "UNKNOWN"; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a9728a90..b04b66c4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(cgogn_test - LANGUAGES CXX) + LANGUAGES CXX +) set(CGOGN_TEST_PREFIX "test_") diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 337443ee..15ce7ffe 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -1,7 +1,7 @@ -if (CGOGN_PROVIDE_EIGEN) +if(CGOGN_PROVIDE_EIGEN) add_subdirectory(eigen-3.2.7) endif(CGOGN_PROVIDE_EIGEN) if(CGOGN_BUILD_TESTS) add_subdirectory(gtest) -endif(CGOGN_BUILD_TESTS) \ No newline at end of file +endif(CGOGN_BUILD_TESTS) diff --git a/utest/cgogn/core/CMakeLists.txt b/utest/cgogn/core/CMakeLists.txt index ec3c1735..44a933a8 100644 --- a/utest/cgogn/core/CMakeLists.txt +++ b/utest/cgogn/core/CMakeLists.txt @@ -9,6 +9,7 @@ set(SOURCE_FILES # basic/cell_marker_test.cpp container/chunk_array_container_test.cpp + main.cpp ) @@ -18,10 +19,6 @@ add_executable(${PROJECT_NAME} ${SOURCE_FILES}) target_link_libraries(cgogn_core_test gtest cgogn_core) target_include_directories(cgogn_core_test PRIVATE ${CMAKE_SOURCE_DIR}/thirdparty/gtest/include) -target_include_directories(cgogn_core_test PRIVATE ${CMAKE_SOURCE_DIR}/cgogn) - - link_directories(${CMAKE_SOURCE_DIR}/thirdparty/gtest/lib) - add_test(NAME "${PROJECT_NAME}" WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" COMMAND ${PROJECT_NAME}) diff --git a/utest/cgogn/core/basic/cell_test.cpp b/utest/cgogn/core/basic/cell_test.cpp index 4f5e2fba..9b237155 100644 --- a/utest/cgogn/core/basic/cell_test.cpp +++ b/utest/cgogn/core/basic/cell_test.cpp @@ -21,46 +21,46 @@ const Dart dmax(std::numeric_limits::max()); TEST(CellTest, DefaultConstructor) { - Cell c; + Cell c; Dart d = c; EXPECT_EQ(std::numeric_limits::max(), d.index); } TEST(CellTest, Constructor) { - Cell c(dglobal); + Cell c(dglobal); Dart d = c; EXPECT_EQ(10u, d.index); } TEST(CellTest, OutOfLimitConstructor) { - Cell c1 = dmax; + Cell c1 = dmax; Dart d1 = c1; - Cell c2; + Cell c2; Dart d2 = c2; EXPECT_EQ(d1.index, d2.index); } TEST(CellTest, CopyConstructor) { - Cell c = dglobal; + Cell c = dglobal; Dart d = c; - Cell ccopy(c); + Cell ccopy(c); Dart dcopy = ccopy; EXPECT_EQ(d.index, dcopy.index); } TEST(CellTest, IsValid) { - Cell c = dglobal; + Cell c = dglobal; EXPECT_TRUE(c.is_valid()); } TEST(CellTest, Assignation) { - Cell c1 = dglobal; - Cell c2; + Cell c1 = dglobal; + Cell c2; c2 = c1; Dart d2 = c2; @@ -70,7 +70,7 @@ TEST(CellTest, Assignation) TEST(CellTest, PrintingOut) { - Cell c = dglobal; + Cell c = dglobal; std::ostringstream s; s << "c=" << c; EXPECT_EQ(0, strcmp(s.str().c_str(), "c=10")); @@ -78,7 +78,7 @@ TEST(CellTest, PrintingOut) TEST(CellTest, ReadingIn) { - Cell c; + Cell c; std::istringstream s("10"); s >> c; @@ -87,4 +87,4 @@ TEST(CellTest, ReadingIn) EXPECT_EQ(10u, d.index); } -} //namespace cgogn +} // namespace cgogn diff --git a/utest/cgogn/core/basic/dart_test.cpp b/utest/cgogn/core/basic/dart_test.cpp index 7f1cffd8..c24d0be0 100644 --- a/utest/cgogn/core/basic/dart_test.cpp +++ b/utest/cgogn/core/basic/dart_test.cpp @@ -77,4 +77,4 @@ TEST(DartTest, ReadingIn) EXPECT_EQ(10u, d.index); } -} //namespace cgogn +} // namespace cgogn diff --git a/utest/cgogn/core/container/chunk_array_container_test.cpp b/utest/cgogn/core/container/chunk_array_container_test.cpp index 7d3197f7..dd3be697 100644 --- a/utest/cgogn/core/container/chunk_array_container_test.cpp +++ b/utest/cgogn/core/container/chunk_array_container_test.cpp @@ -7,8 +7,8 @@ namespace cgogn class ChunkArrayContainerTest : public ::testing::Test { - protected: + ChunkArrayContainerTest() {} @@ -21,10 +21,8 @@ class ChunkArrayContainerTest : public ::testing::Test void testAddAttribute() { std::cout << "test" << std::endl; - //avec un grand nombre de type - // + // avec un grand nombre de type } - }; // Test @@ -33,4 +31,4 @@ TEST_F(ChunkArrayContainerTest, testAddAttribute) this->testAddAttribute(); } -} //end namespace cgogn \ No newline at end of file +} // namespace cgogn diff --git a/utest/cgogn/core/main.cpp b/utest/cgogn/core/main.cpp index ae0b40b3..07981a20 100644 --- a/utest/cgogn/core/main.cpp +++ b/utest/cgogn/core/main.cpp @@ -1,11 +1,13 @@ #include + #include "gtest/gtest.h" -int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); - // Set LC_CTYPE according to the environnement variable. - setlocale(LC_CTYPE, ""); + // Set LC_CTYPE according to the environnement variable. + setlocale(LC_CTYPE, ""); - return RUN_ALL_TESTS(); + return RUN_ALL_TESTS(); }