Skip to content
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

Fix duration bug and add tests. #98

Merged
merged 1 commit into from Jan 26, 2019

Conversation

trainman419
Copy link
Contributor

Fix bug in ros::Duration::fromNSec that was introduced in #61, where conversions from nsec were not normalized properly, and could result in Durations with a negative nsec component, which then failed to compare properly.

Since the operator- also uses fromNSec, this also resulted in cases where the diff of two durations could result in an invalid duration.

Added tests which exposed this bug, and then re-added the normalization, which fixes it.

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me, I'll defer to @dirk-thomas for merging, however.

@dirk-thomas
Copy link
Member

Thanks for the patch.

@dirk-thomas dirk-thomas merged commit 20c3462 into ros:kinetic-devel Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants