Cleanup: use stubs for eigen gtest
[blender-staging.git] / tests / gtests / blenlib / BLI_math_geom_test.cc
1 /* Apache License, Version 2.0 */
2
3 #include "testing/testing.h"
4
5 #include "BLI_math.h"
6
7 #include "stubs/bf_intern_eigen_stubs.h"
8
9 TEST(math_geom, DistToLine2DSimple)
10 {
11         float p[2] = {5.0f, 1.0f},
12               a[2] = {0.0f, 0.0f},
13               b[2] = {2.0f, 0.0f};
14         float distance = dist_to_line_v2(p, a, b);
15         EXPECT_NEAR(1.0f, distance, 1e-6);
16 }
17
18 TEST(math_geom, DistToLineSegment2DSimple)
19 {
20         float p[2] = {3.0f, 1.0f},
21               a[2] = {0.0f, 0.0f},
22               b[2] = {2.0f, 0.0f};
23         float distance = dist_to_line_segment_v2(p, a, b);
24         EXPECT_NEAR(sqrtf(2.0f), distance, 1e-6);
25 }