v0.1.0: 初始工程骨架 — 7模块 40头文件 32源文件 17文档 Apache-2.0
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "vde/core/convex_hull.h"
|
||||
|
||||
using namespace vde::core;
|
||||
|
||||
TEST(ConvexHullTest, ThreePoints_ReturnsTriangle) {
|
||||
std::vector<Point2D> pts = {{0,0}, {1,0}, {0,1}};
|
||||
auto hull = convex_hull_2d(pts);
|
||||
EXPECT_EQ(hull.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(ConvexHullTest, CollinearPoints_ReturnsEndpoints) {
|
||||
std::vector<Point2D> pts = {{0,0}, {1,1}, {2,2}, {3,3}};
|
||||
auto hull = convex_hull_2d(pts);
|
||||
EXPECT_GE(hull.size(), 2u);
|
||||
}
|
||||
|
||||
TEST(ConvexHullTest, Empty_ReturnsEmpty) {
|
||||
auto hull = convex_hull_2d({});
|
||||
EXPECT_TRUE(hull.empty());
|
||||
}
|
||||
Reference in New Issue
Block a user