-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests #30
base: master
Are you sure you want to change the base?
Add unit tests #30
Conversation
Merging is blocked until:
|
dcb2e77
to
86bfcb9
Compare
86bfcb9
to
55f86d5
Compare
I pushed few commits to fix some workflow changes, and to acquire a knowledge of how it works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take this few comments into account, and go through rest of the file in same spirit
EXPECT_EQ(end_points_expected, point_curve) << "Curve end points differ from expected"; | ||
} | ||
|
||
TEST_F(BezierTest, CurvePolylineTest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of just blindly checking point-for-point (which can change in smallest details from commit to commit), it would be better to check with some algorithmic knowledge.
Here is the example for this function:
- create 2 polylines with different parameters for flatness, and compare max deviation from default polyline (computed as root-mean-square-distance)
|
||
TEST_F(BezierTest, CurveEndPointsTest) | ||
{ | ||
std::pair<Point, Point> end_points_expected{getCurvePointsAsPointVector().at(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.at(0)
-> .front()
|
||
TEST_F(BezierTest, CurveValueAtTest) | ||
{ | ||
std::vector<double> t_vals{0., 0.25, 0.5, 0.75, 1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr std::array t_vals{0., 0.25, 0.5, 0.75, 1};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and for all other instances also
No description provided.