MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / TEST

Function TEST

tests/cpp/utils/spline_test.cpp:10–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "fields2cover/utils/spline.h"
9
10TEST(fields2cover_utils_spline, init) {
11 std::vector<double> x {1, 2, 4, 5};
12 std::vector<double> y1 {1, 2, 4, 5};
13 std::vector<double> y2 {-10, -20, -40, -50};
14 std::vector<double> y3 {0, 1, 1, 0};
15
16 f2c::CubicSpline cs1(x, y1);
17 EXPECT_NEAR(cs1(3), 3.0, 1e-3);
18
19 f2c::CubicSpline cs2(x, y2);
20 EXPECT_NEAR(cs2(3), -30.0, 1e-3);
21
22 f2c::CubicSpline cs3(x, y3);
23 EXPECT_GT(cs3(3), 1.0);
24 EXPECT_LT(cs3(3), 2.0);
25 EXPECT_NEAR(cs3(1.5), cs3(1.5), 1e-3);
26}
27
28

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected