Skip to content

Commit b4e6e24

Browse files
committed
WIP-MERGE: cleaning from merge diffcheck joint detector
1 parent 394a621 commit b4e6e24

File tree

5 files changed

+79
-12
lines changed

5 files changed

+79
-12
lines changed

CMakeLists.txt

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ target_include_directories(${APP_NAME_EXE}
115115
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
116116
)
117117

118-
#--------------------------------------------------------------------------
119-
# Tests
120-
#--------------------------------------------------------------------------
121-
122-
# include(CTest)
123-
# enable_testing()
124-
125-
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests/global_registrations)
126-
127118
#--------------------------------------------------------------------------
128119
# pybind11
129120
#--------------------------------------------------------------------------
@@ -167,4 +158,42 @@ if (BUILD_PYTHON_MODULE)
167158
)
168159
endforeach()
169160

170-
endif()
161+
endif()
162+
163+
#--------------------------------------------------------------------------
164+
# Tests
165+
#--------------------------------------------------------------------------
166+
167+
# include(CTest)
168+
# enable_testing()
169+
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest)
170+
# set(TESTS_OUT_DIR ${CMAKE_BINARY_DIR}/tests/)
171+
172+
173+
# # Unit testing ------------------------------------------------------------
174+
# set(UNIT_TESTS unit_tests)
175+
# add_executable(${UNIT_TESTS} tests/unit_tests/DFPointCloudTest.cc)
176+
# set_target_properties(${UNIT_TESTS} PROPERTIES
177+
# RUNTIME_OUTPUT_DIRECTORY ${TESTS_OUT_DIR}
178+
# )
179+
180+
# target_link_libraries(${UNIT_TESTS} gtest gtest_main)
181+
# target_link_libraries(${UNIT_TESTS} ${SHARED_LIB_NAME})
182+
183+
# add_test(NAME ${UNIT_TESTS} COMMAND ${UNIT_TESTS})
184+
185+
# Integration testing -----------------------------------------------------
186+
# Component testing -------------------------------------------------------
187+
# etc ---------------------------------------------------------------------
188+
189+
# # TODO: a better way to copy the dlls to the tests directory for the tests
190+
# # get all the files -dlls in the bin directory and copy them one by one to tests dir
191+
# file(GLOB files ${CMAKE_BINARY_DIR}/bin/Release/*.dll)
192+
# foreach(file ${files})
193+
# message(STATUS "Copying ${file} to ${TESTS_OUT_DIR}")
194+
# add_custom_command(TARGET ${UNIT_TESTS} POST_BUILD
195+
# COMMAND ${CMAKE_COMMAND} -E copy
196+
# ${file}
197+
# ${TESTS_OUT_DIR}/Release
198+
# )
199+
# endforeach()

deps/eigen

Submodule eigen updated from 27f8176 to 02bcf9b

tests/entry_test.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <gtest/gtest.h>
2+
3+
// Function to test
4+
int add(int a, int b) {
5+
return a + b;
6+
}
7+
8+
// Test case
9+
TEST(AddTest, HandlesPositiveInput) {
10+
EXPECT_EQ(6, add(2, 4));
11+
}
12+
13+
// Main function
14+
int main(int argc, char **argv) {
15+
::testing::InitGoogleTest(&argc, argv);
16+
return RUN_ALL_TESTS();
17+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <gtest/gtest.h>
2+
#include "diffCheck.hh"
3+
4+
5+
TEST(DFPointCloudTest, TestConstructor) {
6+
std::vector<Eigen::Vector3d> points = {Eigen::Vector3d(1, 2, 3)};
7+
std::vector<Eigen::Vector3d> colors = {Eigen::Vector3d(255, 255, 255)};
8+
std::vector<Eigen::Vector3d> normals = {Eigen::Vector3d(0, 0, 1)};
9+
10+
diffCheck::geometry::DFPointCloud dfPointCloud(points, colors, normals);
11+
12+
// Verify that the points, colors, and normals are set correctly
13+
EXPECT_EQ(dfPointCloud.Points[0], points[0]);
14+
EXPECT_EQ(dfPointCloud.Colors[0], colors[0]);
15+
EXPECT_EQ(dfPointCloud.Normals[0], normals[0]);
16+
}
17+
18+
int main(int argc, char **argv) {
19+
::testing::InitGoogleTest(&argc, argv);
20+
return RUN_ALL_TESTS();
21+
}

0 commit comments

Comments
 (0)