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(nebula_tests): fix bugprone-incorrect-roundings #219

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

kobayu858
Copy link
Contributor

@kobayu858 kobayu858 commented Nov 8, 2024

PR Type

  • Improvement

Related Links

Description

This is a fix based on clang-tidy bugprone-incorrect-roundings error.

/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vlp16.cpp:185:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_min_angle = 100 * (2 * M_PI - min_angle) * 180 / M_PI + 0.5;
                                           ^
/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vlp16.cpp:186:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_max_angle = 100 * (2 * M_PI - max_angle) * 180 / M_PI + 0.5;
                                           ^
/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vlp32.cpp:183:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_min_angle = 100 * (2 * M_PI - min_angle) * 180 / M_PI + 0.5;
                                           ^
/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vlp32.cpp:184:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_max_angle = 100 * (2 * M_PI - max_angle) * 180 / M_PI + 0.5;
                                           ^
/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vls128.cpp:188:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_min_angle = 100 * (2 * M_PI - min_angle) * 180 / M_PI + 0.5;
                                           ^
/home/emb4/autoware/autoware/src/sensor_component/external/nebula/nebula_tests/velodyne/velodyne_ros_decoder_test_vls128.cpp:189:44: error: casting (double + 0.5) to integer leads to incorrect rounding; consider using lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
    sensor_configuration.cloud_max_angle = 100 * (2 * M_PI - max_angle) * 180 / M_PI + 0.5;
                                           ^

Review Procedure

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 55.44%. Comparing base (c7456f9) to head (8f1fc03).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...tests/velodyne/velodyne_ros_decoder_test_vlp16.cpp 0.00% 4 Missing ⚠️
...tests/velodyne/velodyne_ros_decoder_test_vlp32.cpp 0.00% 4 Missing ⚠️
...ests/velodyne/velodyne_ros_decoder_test_vls128.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #219       +/-   ##
===========================================
+ Coverage   26.16%   55.44%   +29.27%     
===========================================
  Files          99       65       -34     
  Lines        9199     4280     -4919     
  Branches     2215     1140     -1075     
===========================================
- Hits         2407     2373       -34     
+ Misses       6402     1545     -4857     
+ Partials      390      362       -28     
Flag Coverage Δ
differential 55.44% <0.00%> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@veqcc veqcc requested a review from mojomex November 8, 2024 07:26
@veqcc
Copy link

veqcc commented Nov 8, 2024

@mojomex
Hi, this is a minor fix baed on clang-tidy.
Please assign another reviewer if there is someone suitable for it, thanks 👍

Copy link
Collaborator

@mojomex mojomex left a comment

Choose a reason for hiding this comment

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

LGTM!

@mojomex mojomex merged commit b48d713 into tier4:main Nov 8, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants