-
Notifications
You must be signed in to change notification settings - Fork 38
Add unit test in skeleton_event.h for checking timestamp #87 #125
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
base: main
Are you sure you want to change the base?
Add unit test in skeleton_event.h for checking timestamp #87 #125
Conversation
|
Hi @LittleHuba , @castler and @hoe-jo, Could you please let me know your feedbacks and help me merge this PR if possible? I don't have sufficient permissions to merge. Thanks! |
3b60016 to
11eccb3
Compare
LittleHuba
left a comment
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.
Apologies for the delay, we had vacation over Christmas and New Year.
I left you some comments. In general the test is really good. I would only prefer if we can make it more resilient against unrelated changes.
As a bonus you could try to make more variables const.
| ASSERT_TRUE(first_send_result.has_value()); | ||
|
|
||
| // THEN its timestamp should be a valid, non-zero value | ||
| auto first_final_slot_status = EventSlotStatus(first_slot_indicator.GetSlotQM().load()); |
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.
| auto first_final_slot_status = EventSlotStatus(first_slot_indicator.GetSlotQM().load()); | |
| const EventSlotStatus first_final_slot_status{first_slot_indicator.GetSlotQM().load()}; |
|
|
||
| // THEN its timestamp should be a valid, non-zero value | ||
| auto first_final_slot_status = EventSlotStatus(first_slot_indicator.GetSlotQM().load()); | ||
| EXPECT_FALSE(first_final_slot_status.IsInWriting()); |
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.
This assert is IMHO not relevant for this test. Better remove it to make this test less impacted by unrelated changes in the codebase.
| auto second_initial_status = EventSlotStatus(second_slot_indicator.GetSlotQM().load()); | ||
| ASSERT_TRUE(second_initial_status.IsInWriting()); |
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.
| auto second_initial_status = EventSlotStatus(second_slot_indicator.GetSlotQM().load()); | |
| ASSERT_TRUE(second_initial_status.IsInWriting()); |
| auto first_initial_status = EventSlotStatus(first_slot_indicator.GetSlotQM().load()); | ||
| ASSERT_TRUE(first_initial_status.IsInWriting()); |
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.
This assert is IMHO not relevant for this test. Better remove it to make this test less impacted by unrelated changes in the codebase.
| auto first_initial_status = EventSlotStatus(first_slot_indicator.GetSlotQM().load()); | |
| ASSERT_TRUE(first_initial_status.IsInWriting()); |
| auto second_final_slot_status = EventSlotStatus(second_slot_indicator.GetSlotQM().load()); | ||
| EXPECT_FALSE(second_final_slot_status.IsInWriting()); |
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.
| auto second_final_slot_status = EventSlotStatus(second_slot_indicator.GetSlotQM().load()); | |
| EXPECT_FALSE(second_final_slot_status.IsInWriting()); | |
| const EventSlotStatus second_final_slot_status{second_slot_indicator.GetSlotQM().load()}; |
|
I wonder if the test case touches any requirement and therefore should make use of test properties. |
Hi @LittleHuba,
This PR resolves issue #87 and verifies that SkeletonEvent::Send correctly updates the timestamp in the shared memory control data.
Thanks!