-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test(kmod): add kunit test for receive_msg #498
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Koichi98 <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>
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>
…to feat/kunit_receive_msg
KUNIT_EXPECT_EQ(test, ioctl_receive_msg_ret.ret_pub_shm_info.publisher_num, 0); | ||
} | ||
|
||
void test_case_receive_msg_sub_qos_depth_smaller_than_publish_num_smaller_than_pub_qos_depth( |
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.
実装を見てパッとわかりにくい(何番目の引数が qos かわからん)ので、
subscriber_add
の書き方を真似るのは微妙ですか?個人的にはわかりやすいと思っており
// publisher_qos_depth > entries_num > subscriber_qos_depth |
// publisher_qos_depth > entries_num > subscriber_qos_depth
void test_case_subscriber_add_normal_with_many_entries_and_transient_local_1(struct kunit * test) {
...
const uint32_t publisher_qos_depth = 7;
const uint32_t subscriber_qos_depth = 3;
const uint32_t entries_num = 5;
...
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.
関数が見た目的にでかくなることを避けたのですがさすがに提案してもらった方法の方がわかりやすそうですね。
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.
修正します!
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.
修正しました!
Description
Added receive_msg kunit tests:
test_case_no_topic_when_receive
check error handling when topic_wrapper is not found.
test_case_no_subscriber_when_receive
check error handling when sub_info is not found.
test_case_no_publish_no_receive
check that receive_msg will return without any error and without getting any message
test_case_receive_one
simple test for receiving one message
test_case_receive_msg_sub_qos_depth_smaller_than_publish_num_smaller_than_pub_qos_depth
check for correct behavior when sub_qos_depth < publish_num < pub_qos_depth
test_case_receive_msg_publish_num_smaller_than_sub_qos_depth_smaller_than_pub_qos_depth
check for correct behavior when publish_num < sub_qos_depth < pub_qos_depth
test_case_receive_msg_sub_qos_depth_smaller_than_pub_qos_depth_smaller_than_publish_num
check for correct behavior when sub_qos_depth < pub_qos_depth = MAX_QOS_DEPTH < publish_num
test_case_receive_msg_publish_num_and_sub_qos_depth_and_pub_qos_depth_are_all_max_qos_depth
check for correct behavior when sub_qos_depth = pub_qos_depth = publish_num = MAX_QOS_DEPTH
test_case_too_many_rc
check error handling when the number of pub/sub entities referencing to the message exceeds MAX_REFERENCING_PUBSUB_NUM_PER_ENTRY
test_case_one_new_pub
check that receive_msg gets the information of the publisher correctly, when the new publisher appears
test_case_pubsub_in_same_process
check that receive_msg doesn't get the information of the publisher, when the new publisher appears is the same process as the subscriber
test_case_2pub_in_same_process
check that receive_msg get the information of the publisher only once, when the new publisher appears is the same process as the other publisher.
test_case_2sub_in_same_process
check that receive_msg doesn't get the information of the publisher, if the other subscriber in the same process has already mapped the memory of the publisher process.
test_case_subscriber_too_many_mapping_processes
add many subscribers to reach MAX_PROCESS_NUM_PER_MEMPOOL. This is a complex test and will be implemented later.
Related links
How was this PR tested?
bash scripts/e2e_test_1to1_with_ros2sub
(required)bash scripts/e2e_test_2to2
(required)Notes for reviewers