Skip to content

[BUG] Incorrect comparison prevents PMC_HEU from being assigned in registration test #214

Description

@ChengGMR

Describe the bug
Hi TEASER++ team, I found a small issue that consistently generates a warning whenever I compile the TEASER++ library.

In test/teaser/registration-test.cc, the QUATRO rotation test uses the equality comparison operator (==) instead of the assignment operator (=) when setting params.inlier_selection_mode:

params.inlier_selection_mode ==
    teaser::RobustRegistrationSolver::INLIER_SELECTION_MODE::PMC_HEU;

This produces the following compiler warning:

warning: equality comparison result unused [-Wunused-comparison]

Because the comparison result is discarded, PMC_HEU is not assigned to params.inlier_selection_mode, and the test may run using the default inlier-selection mode instead of the intended configuration.

The line should be changed to:

params.inlier_selection_mode =
    teaser::RobustRegistrationSolver::INLIER_SELECTION_MODE::PMC_HEU;

Have you run the unit tests?

  • Yes
  • No --- then this issue will be closed.

Installed Dependencies

  • OS: [Please add OS and version]
  • Compiler: [Please add compiler and version]
  • TEASER++ version or commit: [Please add version or commit]
  • Other dependencies: [Please add dependency versions]

To Reproduce

  1. Build TEASER++ with compiler warnings enabled.
  2. Compile test/teaser/registration-test.cc.
  3. Observe the warning around line 191:
TEASER-plusplus/test/teaser/registration-test.cc:191:34:
warning: equality comparison result unused [-Wunused-comparison]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions