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

rcl_yaml_param_parser: Rearrange test logic to avoid refererence to null #862

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Nov 19, 2020

This is another theoretical issue flagged by scan-build. I don't think it's actually practically possible given the null checks above it. I suspect the issue is that EXPECT_TRUE captures its arguments by reference.

/home/brawner/workspace/ros2_master/src/ros2/rcl/rcl_yaml_param_parser/test/test_parse_yaml.cpp:83:5: warning: Forming reference to null pointer
    EXPECT_TRUE(*param_value->bool_value);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/brawner/workspace/ros2_master/install/gtest_vendor/src/gtest_vendor/include/gtest/gtest.h:1969:3: note: expanded from macro 'EXPECT_TRUE'
  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/brawner/workspace/ros2_master/install/gtest_vendor/src/gtest_vendor/include/gtest/internal/gtest-internal.h:1325:7: note: expanded from macro 'GTEST_TEST_BOOLEAN_'
      ::testing::AssertionResult(expression)) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Stephen Brawner [email protected]

@brawner brawner requested a review from clalancette November 19, 2020 20:37
@brawner brawner force-pushed the brawner/forming-ref-to-null branch from c2c556c to 9bf03d4 Compare November 20, 2020 01:43
@brawner brawner force-pushed the brawner/forming-ref-to-null branch from 9bf03d4 to cea5878 Compare November 20, 2020 01:49
@brawner brawner changed the title Rearrange test logic to avoid refererence to null rcl_yaml_param_parser: Rearrange test logic to avoid refererence to null Nov 20, 2020
@brawner
Copy link
Contributor Author

brawner commented Nov 20, 2020

Testing --packages-select rcl_yaml_param_parser

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@brawner
Copy link
Contributor Author

brawner commented Nov 20, 2020

Windows cmake warnings are due to a planned deprecation and are unrelated to this PR.

@brawner brawner merged commit dd1923b into master Nov 20, 2020
@wjwwood wjwwood deleted the brawner/forming-ref-to-null branch April 22, 2021 17:59
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.

2 participants