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

Use ASSERT_TRUE to check for nullptr. #543

Merged
merged 1 commit into from
Nov 5, 2020

Commits on Nov 2, 2020

  1. Use ASSERT_TRUE to check for nullptr.

    clang static analysis reports this as a false positive for
    a possible memory leak.  This is incorrect, but the FAQ
    for googletest also has this tidbit:
    
    https://github.com/google/googletest/blob/master/googletest/docs/faq.md#why-does-googletest-support-expect_eqnull-ptr-and-assert_eqnull-ptr-but-not-expect_nenull-ptr-and-assert_nenull-ptr
    
    Thus, just switch to ASSERT_TRUE for the check, which is
    good enough and makes clang static analysis happier.
    
    Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
    clalancette committed Nov 2, 2020
    Configuration menu
    Copy the full SHA
    aa9ecfa View commit details
    Browse the repository at this point in the history