-
Notifications
You must be signed in to change notification settings - Fork 41
Unit tests for Trajectory API #2
Unit tests for Trajectory API #2
Conversation
…rf/rmf_core into refactor_traffic_controller_add_tests
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.
Here's a preliminary review of what I've looked through so far. I'm only about halfway through test_trajectory.cpp
at the moment.
These tests are really fantastic and comprehensive, so thanks for putting all this time and thought into them. You'll find some specific remarks about specific lines below, but I'll also add one general remark:
I strong recommend making liberal use of the const
qualifier in your variable declarations. You should always default to declaring variables as const
unless you definitely need to modify their values later. That's not anything specific to writing unit tests, but more of a general C++ programming recommendation.
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.
Most of feedback is really minor, just small tweaks to improve the code quality.
Thanks again for writing all these tests!
will add const declarations, and follow the pointer conventions, in a final pass before merging. |
I have added many consts ( the best consts ). Sorry if I have missed out anything: i am assuming that as everything is marked as resolved, that I do not need to track them. If everything is ok, I would like to merge this as well as delete the |
Those are some very strong consts, some would even say the strongest. Great job with these tests; I'm happy to merge it now. |
Co-authored-by: Grey <grey@openrobotics.org>
This PR is to introduce unit tests for the Trajectory API in rmf_core. I have flagged possible failing tests using the keyword FLAG and commented them out.
Where possible I have tried to check move and copy constructors and their side effects. I may not have done them 100% correctly, would be good to double check how valid the tests are.
The tests are written BDD style: the logical meta-structure is as follows:
For each class, starting from the most atomic,
Test creation of the class,
Test the class functions