-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(kmod): unit test for AGNOCAST_PUBLISH_MSG_CMD #449
Conversation
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
Co-authored-by: atsushi yano <55824710+atsushi421@users.noreply.github.com>
そんなに厳密なしきい値ではないのと、テストのために内部実装をpublicにするのはあまり良くないので、このテストケースは無くても良いかもと思いました |
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
確かに。 |
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
Co-authored-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
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.
LGTM 👍
@Koichi98 |
Signed-off-by: koichiimai <kotty.0704@gmail.com>
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
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.
LGTM
Description
kmodにおけるpublish_msg()のunit testです。
以下の9つのテストがあります。
解放されるべきノードが正しく解放されているかと、subscriberのidをreturnするという処理は完全に分離できるためこれらを組み合わせてはテストしていません。
また、qos_depthはpublisher的にはMAX_QOS_DEPTHに縛られておらず10, 100, 1000といくらでも取り得て境界値が存在しないため、本テストではqos_depthは1の場合のみとしています。(0を明示的にユーザが指定しまった場合のエラーハンドリングはpublisher_addで弾くべきなので別PRで対応します。)
Related links
How was this PR tested?
bash scripts/e2e_test_1to1_with_ros2sub
(required)bash scripts/e2e_test_2to2
(required)Notes for reviewers
leak_warn_threshold周りのテストをするためにLEAK_WARN_THというマクロ定数を導入しましたが、実際のthresholdは
直接thresholdになるわけではないので少しややこしかったりします。いい案があればコメントお願いします。