Permalink
Browse files

Added unit tests.

  • Loading branch information...
stephanemagnenat committed Sep 22, 2010
1 parent 4e9b422 commit 8ff9b4e82f21aba70bd23ba901bb42e7e2805895
View
@@ -20,6 +20,6 @@ add_library(nabo
install(TARGETS nabo ARCHIVE DESTINATION lib)
install(FILES nabo/nabo.h DESTINATION include/nabo)
-add_subdirectory(benchmarks)
+enable_testing()
add_subdirectory(tests)
No changes.
View
@@ -203,7 +203,7 @@ namespace Nabo
{
// enqueue offside ?
if (offset2 < bestDist && nodes[childLeft(n)].dim != -2)
- queue.push(SearchElement(childLeft(n), dist));
+ queue.push(SearchElement(childLeft(n), offset2));
// continue onside
if (nodes[childRight(n)].dim != -2)
n = childRight(n);
@@ -214,7 +214,7 @@ namespace Nabo
{
// enqueue offside ?
if (offset2 < bestDist && nodes[childRight(n)].dim != -2)
- queue.push(SearchElement(childRight(n), dist));
+ queue.push(SearchElement(childRight(n), offset2));
// continue onside
if (nodes[childLeft(n)].dim != -2)
n = childLeft(n);
View
@@ -1,3 +1,38 @@
include_directories(..)
-add_executable(knn knn.cpp)
-target_link_libraries(knn nabo)
+
+add_executable(knnvalidate knnvalidate.cpp)
+target_link_libraries(knnvalidate nabo)
+
+add_test(validation-2D ${EXECUTABLE_OUTPUT_PATH}/knnvalidate ${CMAKE_CURRENT_SOURCE_DIR}/data/scan.2d.txt 10 1000)
+add_test(validation-3D ${EXECUTABLE_OUTPUT_PATH}/knnvalidate ${CMAKE_CURRENT_SOURCE_DIR}/data/scan.3d.txt 10 1000)
+
+# find_package(Boost)
+# if (Boost_FOUND)
+# find_path(ANN_INCLUDE_DIR ANN.h
+# /usr/local/include/ANN
+# /usr/include/ANN
+# )
+#
+# include_directories(.. ${Boost_INCLUDE_DIRS} ${ANN_INCLUDE_DIR})
+#
+# add_executable(knnbench knnbench.cpp
+# # hiiiikkk^2 this is even uglier, let's talk about this irl ok?
+# ~/test/ann_1.1.2/src/ANN.cpp
+# ~/test/ann_1.1.2/src/bd_fix_rad_search.cpp
+# ~/test/ann_1.1.2/src/bd_pr_search.cpp
+# ~/test/ann_1.1.2/src/bd_search.cpp
+# ~/test/ann_1.1.2/src/bd_tree.cpp
+# ~/test/ann_1.1.2/src/brute.cpp
+# ~/test/ann_1.1.2/src/kd_dump.cpp
+# ~/test/ann_1.1.2/src/kd_fix_rad_search.cpp
+# ~/test/ann_1.1.2/src/kd_pr_search.cpp
+# ~/test/ann_1.1.2/src/kd_search.cpp
+# ~/test/ann_1.1.2/src/kd_split.cpp
+# ~/test/ann_1.1.2/src/kd_tree.cpp
+# ~/test/ann_1.1.2/src/kd_util.cpp
+# ~/test/ann_1.1.2/src/perf.cpp)
+#
+# target_link_libraries(knnbench nabo)
+# else (Boost_FOUND)
+# message("Disabling benchmark because boost has not been found")
+# endif (Boost_FOUND)
Oops, something went wrong.

0 comments on commit 8ff9b4e

Please sign in to comment.