Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve test
Browse files Browse the repository at this point in the history
star-hengxing authored Jan 28, 2025
1 parent 90677a5 commit 74e1b2b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/o/octree/xmake.lua
Original file line number Diff line number Diff line change
@@ -20,5 +20,19 @@ package("octree")
end)

on_test(function (package)
assert(package:has_cxxincludes("octree.h", {configs = {languages = "c++20"}}))
assert(package:check_cxxsnippets({test = [[
using namespace OrthoTree;
void test() {
auto constexpr points = array{ Point3D{0,0,0}, Point3D{1,1,1}, Point3D{2,2,2} };
auto const octree = OctreePointC(points, 3 /*max depth*/);
auto const searchBox = BoundingBox3D{ {0.5, 0.5, 0.5}, {2.5, 2.5, 2.5} };
auto const pointIDs = octree.RangeSearch(searchBox); //: { 1, 2 }
auto neighborNo = 2;
auto pointIDsByKNN = octree.GetNearestNeighbors(Point3D{ 1.1, 1.1, 1.1 }
, neighborNo
); //: { 1, 2 }
}
]]}, {configs = {languages = "c++20"}, includes = "octree.h"}))
end)

0 comments on commit 74e1b2b

Please sign in to comment.