Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/tests/BLI_math_base_test.cc
| Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | TEST(math_base, ClampInt) | ||||
| EXPECT_EQ(math::clamp(111, -50, 101), 101); | EXPECT_EQ(math::clamp(111, -50, 101), 101); | ||||
| } | } | ||||
| TEST(math_base, Midpoint) | TEST(math_base, Midpoint) | ||||
| { | { | ||||
| EXPECT_NEAR(math::midpoint(100.0f, 200.0f), 150.0f, 1e-4f); | EXPECT_NEAR(math::midpoint(100.0f, 200.0f), 150.0f, 1e-4f); | ||||
| } | } | ||||
| TEST(math_base, InterpolateInt) | |||||
| { | |||||
| EXPECT_EQ(math::interpolate(100, 200, 0.4f), 140); | |||||
| } | |||||
| } // namespace blender::tests | } // namespace blender::tests | ||||